[Libav-user] Changing decoder resolution does not change file output size for h264 format

Taha Ansari mtaha.ansari at gmail.com
Wed Dec 19 08:58:50 CET 2012


Hi all!

I have made a test application that captures from webcam (using dshow
filter), and saves it as a file on hard disk. My camera supports natively
640x480 resolution, so I had to forcefully open it in smaller resolution to
conduct this test:

    pFormatCtx = avformat_alloc_context();
    AVDictionary *dict = NULL;
    av_dict_set( &dict, "video_size", "160x120" ,0);
    if(avformat_open_input(&this->pFormatCtx, this->finalInputName.c_str(),
pInputFormat, &dict)!=0)
        return -1; // Couldn't open file

finalInputName is the correctly formatted video:audio string ffmpeg
recognizes for dshow.

Problem now is, no matter what the decoder's resolution is (160x120,
320x240, 640x480 etc.), output file size for approximately one minute
duration is always the same - around 3 MB.

I tried encoding to other formats like 'mpg', 'ogg', their video sizes
seems to be appropriately scaled, then what am I doing wrong with h264
format, fail to understand?

Can anyone kindly provide some guidance?

Thanks for your time!

Best regards...
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://ffmpeg.org/pipermail/libav-user/attachments/20121219/77d873c9/attachment.html>


More information about the Libav-user mailing list