<?xml version="1.0" encoding="UTF-8"?><rss xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:content="http://purl.org/rss/1.0/modules/content/" xmlns:atom="http://www.w3.org/2005/Atom" version="2.0"><channel><title><![CDATA[Calling ffmpeg with QProcess: crashes]]></title><description><![CDATA[<p dir="auto">Hi. I am making a GUI for ffmpeg and trying to call ffmpeg with QProcess. No matter what I do, I always get<br />
"qtc.process_stub: Inferior error:  QProcess::Crashed "Process crashed".</p>
<ul>
<li>I am working on Windows.</li>
<li>ffmpeg is on my path.</li>
<li>ffmpeg works in command line.</li>
<li>I tried giving the absolute path of ffmpeg to QProcess, no use.</li>
<li>QtCreator version 17, with Qt 6.</li>
</ul>
<p dir="auto">The code I am running is below. Basically, when user clicks "convert" button, the app should start ffmpeg with QProcess. To be simple, I tried to get only version information with ffmpeg.</p>
<pre><code>MainWindow::MainWindow(QWidget *parent)
    : QMainWindow(parent)
    , ui(new Ui::MainWindow)
{
    ui-&gt;setupUi(this);
    QProcess *ffmpegProcess = new QProcess(this);
    ffmpegProcess-&gt;setWorkingDirectory(QCoreApplication::applicationDirPath());
    ffmpegProcess-&gt;setProcessChannelMode(QProcess::MergedChannels);
    
    // Connect buttons
    connect(ui-&gt;btnSelFile, &amp;QPushButton::clicked, this, &amp;MainWindow::selectInputFile);
    connect(ui-&gt;btnConvert, &amp;QPushButton::clicked, this, &amp;MainWindow::startConversion);

    // Connect FFmpeg process signals
    connect(ffmpegProcess, &amp;QProcess::readyReadStandardOutput, this, &amp;MainWindow::readProcessOutput);
    connect(ffmpegProcess, &amp;QProcess::readyReadStandardError, this, &amp;MainWindow::readProcessOutput);
    connect(ffmpegProcess, QOverload&lt;int, QProcess::ExitStatus&gt;::of(&amp;QProcess::finished),
            this, &amp;MainWindow::processFinished);
}

void MainWindow::selectInputFile()
{
    QString filePath = QFileDialog::getOpenFileName(this, "Select Video File", "", "Videos (*.mp4 *.mkv *.avi)");
    if (!filePath.isEmpty()) {
        inputFilePath = filePath;
        ui-&gt;txtLog-&gt;append("Selected file: " + filePath);
    }
}

void MainWindow::startConversion()
{
    QString ffmpegPath = "ffmpeg";
    QStringList args;
    args &lt;&lt; "-version";
    ui-&gt;txtLog-&gt;append("Trying to run: " + ffmpegPath + " " + args.join(" "));
    ffmpegProcess-&gt;start(ffmpegPath, args);

    }
}

void MainWindow::readProcessOutput()
{
    QByteArray output = ffmpegProcess-&gt;readAllStandardOutput();
    QByteArray errorOutput = ffmpegProcess-&gt;readAllStandardError();

    if (!output.isEmpty()) {
        ui-&gt;txtLog-&gt;append(QString::fromLocal8Bit(output));
    }
    if (!errorOutput.isEmpty()) {
        ui-&gt;txtLog-&gt;append(QString::fromLocal8Bit(errorOutput));
    }
}


void MainWindow::processFinished(int exitCode, QProcess::ExitStatus status)
{
    Q_UNUSED(status);
    if (exitCode == 0) {
        ui-&gt;txtLog-&gt;append("✅ Conversion finished successfully!");
    } else {
        ui-&gt;txtLog-&gt;append("❌ Conversion failed.");
    }
}
</code></pre>
]]></description><link>https://forum.qt.io/topic/163084/calling-ffmpeg-with-qprocess-crashes</link><generator>RSS for Node</generator><lastBuildDate>Wed, 21 Oct 2026 12:55:06 GMT</lastBuildDate><atom:link href="https://forum.qt.io/topic/163084.rss" rel="self" type="application/rss+xml"/><pubDate>Tue, 26 Aug 2025 16:42:30 GMT</pubDate><ttl>60</ttl><item><title><![CDATA[Reply to Calling ffmpeg with QProcess: crashes on Tue, 26 Aug 2025 16:47:09 GMT]]></title><description><![CDATA[<p dir="auto"><a class="plugin-mentions-user plugin-mentions-a" href="/user/utkugulgec">@<bdi>utkugulgec</bdi></a> said in <a href="/post/830897">Calling ffmpeg with QProcess: crashes</a>:</p>
<blockquote>
<p dir="auto">QProcess *ffmpegProcess = new QProcess(this);</p>
</blockquote>
<p dir="auto">This is a local variable...</p>
]]></description><link>https://forum.qt.io/post/830898</link><guid isPermaLink="true">https://forum.qt.io/post/830898</guid><dc:creator><![CDATA[Christian Ehrlicher]]></dc:creator><pubDate>Tue, 26 Aug 2025 16:47:09 GMT</pubDate></item><item><title><![CDATA[Reply to Calling ffmpeg with QProcess: crashes on Tue, 26 Aug 2025 16:54:15 GMT]]></title><description><![CDATA[<p dir="auto"><a class="plugin-mentions-user plugin-mentions-a" href="/user/christian-ehrlicher">@<bdi>Christian-Ehrlicher</bdi></a> oh, silly me, how I couldn't see it. It worked out. sorry for this thread.</p>
]]></description><link>https://forum.qt.io/post/830900</link><guid isPermaLink="true">https://forum.qt.io/post/830900</guid><dc:creator><![CDATA[utkugulgec]]></dc:creator><pubDate>Tue, 26 Aug 2025 16:54:15 GMT</pubDate></item><item><title><![CDATA[Reply to Calling ffmpeg with QProcess: crashes on Tue, 26 Aug 2025 16:47:09 GMT]]></title><description><![CDATA[<p dir="auto"><a class="plugin-mentions-user plugin-mentions-a" href="/user/utkugulgec">@<bdi>utkugulgec</bdi></a> said in <a href="/post/830897">Calling ffmpeg with QProcess: crashes</a>:</p>
<blockquote>
<p dir="auto">QProcess *ffmpegProcess = new QProcess(this);</p>
</blockquote>
<p dir="auto">This is a local variable...</p>
]]></description><link>https://forum.qt.io/post/830898</link><guid isPermaLink="true">https://forum.qt.io/post/830898</guid><dc:creator><![CDATA[Christian Ehrlicher]]></dc:creator><pubDate>Tue, 26 Aug 2025 16:47:09 GMT</pubDate></item></channel></rss>