[MPlayer-dev-eng] [PATCH] -ffourcc with raw video

Diego Biurrun diego at biurrun.de
Mon Jul 21 07:39:31 CEST 2008


On Fri, Jul 18, 2008 at 11:44:13AM -0400, Andrew Wason wrote:
> I'm encoding to raw audio/video in a QuickTime container. I'm encoding
> video to YUY2 but the fourcc needs to be set to yuvs for QuickTime
> Player to understand it. So I do this:
> 
> mencoder input.mp4 -of lavf -lavfopts format=mov -oac pcm -ovc raw -vf
> scale,format=YUY2 -ffourcc yuvs -o output.mov
> 
> But the -ffourcc ends up being ignored and the resulting video has it
> set to YUY2.  Same thing happens for AVI:
> 
> mencoder input.mp4 -of avi -oac pcm -ovc raw -vf scale,format=YUY2
> -ffourcc yuvs -o output.avi
> 
> 
> Initially mencoder.c sets mux_v->bih->biCompression to the value of
> force_fourcc (yuvs) but then ve_raw.c:set_format resets biCompression
> to YUY2 and this is then used by muxer_lavf.c:fix_parameters or
> muxer_avi.c:avifile_write_header to set the fourcc to YUY2 instead of
> yuvs.
> 
> This patch changes ve_raw.c:set_format to not overwrite biCompression
> if force_fourcc is set.
> 
> --- libmpcodecs/ve_raw.c	(revision 27326)
> +++ libmpcodecs/ve_raw.c	(working copy)
> @@ -27,7 +27,8 @@
>  #define mux_v (vf->priv->mux)
>  
>  static int set_format(struct vf_instance_s *vf, unsigned int fmt) {
> -    mux_v->bih->biCompression = fmt;
> +    if (!force_fourcc)
> +        mux_v->bih->biCompression = fmt;

This looks OK to me, further comments from anybody?

Diego



More information about the MPlayer-dev-eng mailing list