Hi Carl,

Yes, I also scale the input using scale filter. 
The filter I use is as following:
filter_spec = "scale=iw*min(640/iw\\,360/ih):ih*min(640/iw\\,360/ih), 
pad=640:360:(640-iw*min(640/iw\\,360/ih))/2:(360-ih*min(640/iw\\,360/ih))/2”;

I still don’t understand why scale video cause duration metadata lost. 

Thanks,

—
Hưng



On Oct 13, 2014, at 11:59 PM, Carl Eugen Hoyos <[email protected]> wrote:

> Hung Nguyen <Hung.Nguyen@...> writes:
> 
>> 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; 
> 
> Did you just set the dimensions in the codec context 
> or did you also use the scale your input (with the 
> scale filter)?
> 
> Carl Eugen
> 
> _______________________________________________
> Libav-user mailing list
> [email protected]
> http://ffmpeg.org/mailman/listinfo/libav-user

_______________________________________________
Libav-user mailing list
[email protected]
http://ffmpeg.org/mailman/listinfo/libav-user

Reply via email to