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

5 views
Skip to first unread message

Marlon Smith

unread,
Mar 12, 2012, 12:44:42 AM3/12/12
to mplaye...@mplayerhq.hu
Hi everyone,

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;

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!

Thanks

Marlon
_______________________________________________
MPlayer-users mailing list
MPlaye...@mplayerhq.hu
https://lists.mplayerhq.hu/mailman/listinfo/mplayer-users

Marlon Smith

unread,
Mar 12, 2012, 1:33:15 AM3/12/12
to mplaye...@mplayerhq.hu
Ok, I've tried using an mencoder configuration file to specify
of=rawvideo=1 but still mencoder refuses to output raw video!

Help anyone?

Greg Ward

unread,
Mar 12, 2012, 9:34:45 PM3/12/12
to MPlayer usage questions, feature requests, bug reports
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.

Reply all
Reply to author
Forward
0 new messages