[FFmpeg-devel] [PATCH] libavformat: fix copyts and muxrate in mpegts muxer
andreas.hakon at protonmail.com
Fri Apr 19 11:47:34 EEST 2019
‐‐‐‐‐‐‐ Original Message ‐‐‐‐‐‐‐
On Thursday, 18 de April de 2019 11:01, Andreas Håkon via ffmpeg-devel <ffmpeg-devel at ffmpeg.org> wrote:
> This patch resolves one very specific use case:
> - When you use the mpegts muxer;
> - And use the global parameter “-copyts”;
> - And use the parameter “-muxrate” for the mpegts muxer;
> - And use too the parameter “-mpegts_copyts”.
> The problem is created because the member “first_pcr” of the MpegTSWrite struct isn’t initialized with a correct timestamp (so when copying the timestamps the initial value is 0). And in this case an infinite loop is created because the code never writes PES packets when the “mux_rate” isn’t VBR (equals to 1). See the block that creates the loop here (note the "continue" command at end):
> So, this patch fixes the problem initializing the “first_pcr” with the first DTS value that comes when using the incoming timestamps.
Here a new version of the patch.
The "fist_pcr" value is now derived from DTS in a more consistent way.
-------------- next part --------------
An embedded and charset-unspecified text was scrubbed...
More information about the ffmpeg-devel