[Libav-user] [resize video] Lost duration

Hung Nguyen Hung.Nguyen at ambientdigitalgroup.com
Mon Oct 13 13:51:03 CEST 2014


Hello, 

I am taking transcoding example from ffmpeg source code, try to modify it to fit our current situation. 
This example work well, even with customise IOCallback or writing into output file. 
The problem I am facing now is, every time I try to change video size when initialise encoder, the output video does not have video duration: 

 enc_ctx->height = 360;
 enc_ctx->width = 640; 

But if I give it the origtial w/h, it’s fine. 
 enc_ctx->height = dec_ctx->height;
 enc_ctx->width = dec_ctx->width; 


The problem is, I have to change it size in order to encode it with different resolution, resize with scale filter and/or change bitrate…
Loosing duration, video cannot play well in some application (especially Google chrome).

Thanks in advance if someone could give me a hint, what can be the problem, where to look at, what are going wrong with transcoding.c (if changing w/h before open encoder and encode).

Regards,

Hung
 


More information about the Libav-user mailing list