[FFmpeg-devel] [PATCHv2] movenc: Write durations based on pts into mvhd/mdhd/tkhd/elst
Michael Niedermayer
michael at niedermayer.cc
Sat Dec 21 00:35:41 EET 2019
On Tue, Dec 17, 2019 at 03:15:09PM +0200, Martin Storsjö wrote:
> Keep all the existing data fields as they are (there's lots and
> lots of nontrivial calculation and heuristics based on them in
> their current form), but derive the duration as the difference
> between the pts of the first packet to the maximum pts+duration
> (not necessarily the last packet); use this duration in any box
> where the actual presentation duration is supposed to be.
>
> Fixes: 8420
> ---
> Fixed to fetch the duration for tmcd tracks from their designated
> source track.
> ---
> libavformat/movenc.c | 35 ++++++++++++++++++++++++++++-------
> 1 file changed, 28 insertions(+), 7 deletions(-)
I found another case that changes, again dont know which is more correct
make -j12 && ./ffmpeg -i ~/tickets/3453/mov_with_tmcd.mov -y -bitexact -codec copy -map 0 -t 2 file.mov ; ./ffprobe -v 0 file.mov -show_packets -print_format compact > /tmp/before
--- /tmp/before 2019-12-20 23:28:04.009327038 +0100
+++ /tmp/after 2019-12-20 23:27:17.213326052 +0100
@@ -188,7 +188,7 @@
packet|codec_type=audio|stream_index=1|pts=88320|pts_time=1.840000|dts=88320|dts_time=1.840000|duration=1024|duration_time=0.021333|convergence_duration=N/A|convergence_duration_time=N/A|size=4096|pos=408905|flags=K_
packet|codec_type=data|stream_index=2|pts=46|pts_time=1.840000|dts=46|dts_time=1.840000|duration=1|duration_time=0.040000|convergence_duration=N/A|convergence_duration_time=N/A|size=4|pos=413001|flags=K_
packet|codec_type=audio|stream_index=1|pts=89344|pts_time=1.861333|dts=89344|dts_time=1.861333|duration=896|duration_time=0.018667|convergence_duration=N/A|convergence_duration_time=N/A|size=3584|pos=413005|flags=K_
-packet|codec_type=video|stream_index=0|pts=26624|pts_time=2.080000|dts=24064|dts_time=1.880000|duration=512|duration_time=0.040000|convergence_duration=N/A|convergence_duration_time=N/A|size=776|pos=416589|flags=_D
+packet|codec_type=video|stream_index=0|pts=26624|pts_time=2.080000|dts=24064|dts_time=1.880000|duration=512|duration_time=0.040000|convergence_duration=N/A|convergence_duration_time=N/A|size=776|pos=416589|flags=__
packet|codec_type=audio|stream_index=1|pts=90240|pts_time=1.880000|dts=90240|dts_time=1.880000|duration=1024|duration_time=0.021333|convergence_duration=N/A|convergence_duration_time=N/A|size=4096|pos=417365|flags=K_
packet|codec_type=data|stream_index=2|pts=47|pts_time=1.880000|dts=47|dts_time=1.880000|duration=1|duration_time=0.040000|convergence_duration=N/A|convergence_duration_time=N/A|size=4|pos=421461|flags=K_
packet|codec_type=audio|stream_index=1|pts=91264|pts_time=1.901333|dts=91264|dts_time=1.901333|duration=896|duration_time=0.018667|convergence_duration=N/A|convergence_duration_time=N/A|size=3584|pos=421465|flags=K_
file should be here:
https://samples.ffmpeg.org/ffmpeg-bugs/trac/ticket3453/
[...]
--
Michael GnuPG fingerprint: 9FF2128B147EF6730BADF133611EC787040B0FAB
Awnsering whenever a program halts or runs forever is
On a turing machine, in general impossible (turings halting problem).
On any real computer, always possible as a real computer has a finite number
of states N, and will either halt in less than N cycles or never halt.
-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 181 bytes
Desc: not available
URL: <https://ffmpeg.org/pipermail/ffmpeg-devel/attachments/20191220/de4398a6/attachment.sig>
More information about the ffmpeg-devel
mailing list