I'm using Qt to record stream data from a Mobotix camera on Windows 7. The command I use is:
ffmpeg -f mjpeg -i "http://admin:password@192.168.0.100/control/faststream.jpg?stream=full" -c:v libx264 -preset slow -crf 22 -c:a copy out.mp4
This works fine from the command line and when I want to stop it I just do Ctrl-C. But I'm doing this from an application using Qt 5.2 via a QProcess. After 10 minutes I want to stop the recording so I tried QProcess::terminate() but this doesn't stop it. QProcess::kill() works but the resulting video won't play. This answer suggests I'm doing it the right way.
I connect to QProcess::finished() so when I call QProcess::kill() the result is:
- int exitCode = 62097
- QProcess::ExitStatus exitStatus = QProcess::CrashExit
Apparently this is the return code Qt uses when it kills a process.
So is there any other way for me to either terminate the process gracefully (the same as pressing Ctrl-C) or perform this same functionality via an ffmpeg library so I can stop it properly?