[vlc-devel] FFmpeg video scaling problem

Brian C. Wiles bwiles_videolan at poldon.com
Wed Nov 14 22:55:34 CET 2007

I finally figured out the source of my video streaming problem.  For 
some reason, it works under vlc-0.8.6c, but not under 0.9.0-svn.

In modules/codec/ffmpeg/encoder.c, starting at line 384, there is this 
chunk of code:

        p_context->width = p_enc->fmt_in.video.i_width;
        p_context->height = p_enc->fmt_in.video.i_height;
        if( p_enc->fmt_out.i_codec == VLC_FOURCC('m', 'p', '2', 'v')
             && (p_context->width > 720 || p_context->height > 576) )
            p_context->level = 4; /* High level */

  What this means is that when encoding mp2v video, it has to be at 
either 720 pixels wide or 576 pixels high.  Otherwise, I get a "set 
profile and level" error from libavcodec.  I tried scaling the video to 
720x480, and it works fine.

  To fix this, I would love to just set the profile to 4 in all cases, 
but I'm not sure if this is the right thing to do.  Any suggestions?  


More information about the vlc-devel mailing list