[MPlayer-dev-eng] mplayer and mjpegtools
D Richard Felker III
dalias at aerifal.cx
Thu Apr 11 17:08:13 CEST 2002
On Thu, Apr 11, 2002 at 04:03:49PM +0200, Emmanuel Anne wrote:
> Thanks a lot for adding yuv4mpeg support to mplayer, but to be really
> usefull, this feature requires the stream to be sent to stdout instead
> of the file stream.yuv (did you ever try to write a full 1h30 movie at
> 25fps in an yuv file ??? Don't try it !!!).
>
> If you want to do it, it's quite easy.
> Take this stdout2stderr.pl perl script :
> #!/usr/bin/perl
>
> my $nb = 0;
> while (<>) {
> $nb++ if (s/([ \t])printf ?\(/$1fprintf\(stderr,/);
> $nb++ if (s/^printf ?\(/fprintf\(stderr,/);
> print;
> }
> print STDERR "$nb replacements\n";
>
> Then go into the mplayer directory and run it with :
> for n in `find -name \*.c`; do
> perl ../stdout2stderr.pl $n > tmp
> mv -f tmp $n
> done
>
> It will replace all the printf( in the sources by fprintf(stderr,
> Then you will need to add "#include <stdio.h>" to 2 files to be able to
> compile them (forgot which files, sorry !), and finally you need to
> patch vo_yuv4mpeg.c file :
> just replace the line
> yuv_out = fopen("stream.yuv", "wb");
> by
> yuv_out = stdout;
>
> You can then run mplayer this way (for example) :
> mplayer -vo yuv4mpeg -benchmark -nosound movie.avi | mpeg2enc -a 2 -f 4
> -F 1 -S 650 -B 128 -s -o video.m2v
>
> (this will encode an mpeg2 svcd).
>
> The speed impvement compared to the divxdec from mjpegtools is not huge,
> but mplayer allows to decode many formats that mjpegtools can't deal
> with !
>
> Thanks a lot for your awesome work !
I can tell you right off that a change like this won't be accepted,
even though many (myself included) would consider it appropriate.
Instead, why don't you learn to use named pipes (RTFM man mkfifo). :)
Good luck,
Rich
More information about the MPlayer-dev-eng
mailing list