<div dir="ltr">Thanks Vassilis that's awesome, it worked, I just had to get the frame rate from the decoder context but now this fps problem was <a href="https://github.com/leandromoreira/ffmpeg-libav-tutorial/pull/52#issuecomment-569503206">fixed thanks to you (and James)</a>. I still need to figure it out how to fix <a href="https://github.com/leandromoreira/ffmpeg-libav-tutorial/pull/52">all the other issues</a>.<br></div><br><div class="gmail_quote"><div dir="ltr" class="gmail_attr">On Sun, Dec 29, 2019 at 3:06 AM Vassilis <<a href="mailto:bpantazhs@gmail.com">bpantazhs@gmail.com</a>> wrote:<br></div><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left:1px solid rgb(204,204,204);padding-left:1ex"><div dir="ltr"><div class="gmail_quote"><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left:1px solid rgb(204,204,204);padding-left:1ex"><div dir="ltr"><div>3) After I transcoded <a href="https://github.com/leandromoreira/ffmpeg-libav-tutorial/blob/transcoding/2_transcoding.c" target="_blank">with my code</a> I'm getting a 60.11 fps while the original video has fixed 60fps, why this usually happens?<br></div><div><br></div></div></blockquote><div>While I am not able to .help you with the two first issues I think I may have an idea for the third. This seems like an issue I faced with my own attempt at transcoding video and a fix was suggested by a member of this mailing list (thanks James). You need to set the AVPacket duration field, otherwise this issue is present. This would mean adding something in the lines of the following line of code before your av_interleaved_write_frame is called:</div><div><div><br></div><div>// for example, if 25 FPS, and time_base is 12800, then packet.duration = 12800 / 25 = 512<br></div><div>output_packet.duration = format_context->streams[stream_index]->time_base.den / format_context->streams[stream_index]->time_base.num / format_context->streams[stream_index]->avg_frame_rate.num * format_context->streams[stream_index]->avg_frame_rate.den;<br></div><div><br></div><div> /* mux encoded frame */<br>    ret = av_interleaved_write_frame(format_context, output_packet);<br></div><div><br></div><div>Hope this helps!</div></div><div><br></div><div>Vas</div><div><br></div><div><br></div><div> </div></div></div>
_______________________________________________<br>
Libav-user mailing list<br>
<a href="mailto:Libav-user@ffmpeg.org" target="_blank">Libav-user@ffmpeg.org</a><br>
<a href="https://ffmpeg.org/mailman/listinfo/libav-user" rel="noreferrer" target="_blank">https://ffmpeg.org/mailman/listinfo/libav-user</a><br>
<br>
To unsubscribe, visit link above, or email<br>
<a href="mailto:libav-user-request@ffmpeg.org" target="_blank">libav-user-request@ffmpeg.org</a> with subject "unsubscribe".</blockquote></div>