[MPlayer-users] Rawvideo output option ignored when using mencoder programatically

Greg Ward greg at gerg.ca
Tue Mar 13 02:34:45 CET 2012


On 11 March 2012, Marlon Smith said:
> I'm using mencoder with the -of rawvideo switch to create a raw h.264
> stream.  On the command line, it works perfectly using this command:
> 
> C:\Users\Marlon\Documents\mplayer>mencoder.exe input.mov -nosound -of
> rawvideo -ofps 30 -vf harddup -ovc x264 -x264encopts bframes=0 -o
> output.264
> 
> However when I run it programmatically, mencoder seems to ignore that
> rawvideo option and instead write a lavf format output.  I'm using a
> QProcess, and passing it these arguments:
> 
> QStringList arguments;
> arguments << input_filename << "-nosound" << "-of" << "rawvideo" <<
> "-ofps" << "30" << "-vf" << "harddup" << "-ovc" << "x264" <<
> "-x264encopts" << "bframes=0" << "-o" << output_filename;

My first guess is "Windows command-line weirdness". Even though
QProcess is being a good Unix citizen and making you pass a list of
args, that gets collapsed into a string on Windows, and then the
C runtime in the called app (mplayer.exe) has to split it back up into
a list of strings. I don't see any quotes in your command line, which
would be an obvious red flag ... but have you tried running the same
code on Unix?

Also, it could be that QProcess is doing something nutty. Try a little
C or Perl or Python (or whatever you like) program that uses system().

> I've compared the standard and error output from mencoder for both cases
> and it looks exactly the same.  I don't know what to do!  If anyone has
> an idea it would be much appreciated!

On Unix or Linux, I would suggest delving into "ps" output (or /proc)
to see the exact command line that mencoder is running with ... dunno
what the Windows equivalent is. There must be something!

Oh yeah: write a little C program that just dumps its argv to stdout,
call it mencoder.exe, and get your QProcess call to call that instead.

        Greg
-- 
Greg Ward                                http://www.gerg.ca/
The eagle may soar, but the weasel never gets sucked into a jet engine.


More information about the MPlayer-users mailing list