inconsistency between avformat and mp4 demux
As of master 01d75eb6.
Note: modified stream_out_stats to display pts, dts, and current duration including the block duration.
PTS/DTS difference here:
./vlc -vv -I dummy file/avformat:///home/alexandre/Video/dog_meme.mp4 --sout="#stats"
[00007f5848000c60] stats stream out debug: stats: Adding track type:Video id:1
[00007f5848000c60] stats stream out debug: stats: track:1 type:Video segment_number:1 dts_difference:0 length:33333 dts:1 pts:33334 current_duration:33333 md5:a0877104439d57767146edbdf9f5dce3
[00007f5848000c60] stats stream out debug: stats: track:1 type:Video segment_number:2 dts_difference:0 length:33333 dts:1 pts:100001 current_duration:66666 md5:f52ed907bdfeaa3e53c364a08ab0b5ea
[00007f5848000c60] stats stream out debug: stats: track:1 type:Video segment_number:3 dts_difference:33333 length:33333 dts:33334 pts:33334 current_duration:99999 md5:3ee8c6a962f0e475d840d2b699b636aa
[00007f5848000c60] stats stream out debug: stats: track:1 type:Video segment_number:4 dts_difference:33334 length:33333 dts:66668 pts:66668 current_duration:133332 md5:a8783c5deb2a72fd5b33815fe134dbed
[00007f5848000c60] stats stream out debug: stats: track:1 type:Video segment_number:5 dts_difference:33333 length:33333 dts:100001 pts:166667 current_duration:166665 md5:8c48e08c47c017609d1a43205b0f29c4
[00007f5848000c60] stats stream out debug: stats: track:1 type:Video segment_number:6 dts_difference:33333 length:33333 dts:133334 pts:133334 current_duration:199998 md5:164b22d681533f41574b90fb7f5da3bb
[00007f5848000c60] stats stream out debug: stats: track:1 type:Video segment_number:7 dts_difference:33334 length:33333 dts:166668 pts:266668 current_duration:233331 md5:cfb688d1cb458b580a5f3818af5ffa84
[00007f5848000c60] stats stream out debug: stats: track:1 type:Video segment_number:8 dts_difference:33333 length:33333 dts:200001 pts:200001 current_duration:266664 md5:177d8b5a519ed0dc62e843fe0860282f
[00007f5848000c60] stats stream out debug: stats: track:1 type:Video segment_number:9 dts_difference:33333 length:33333 dts:233334 pts:233334 current_duration:299997 md5:58098d332ce722113280e3b23db8b6bf
And:
./vlc -vv -I dummy file/mp4:///home/alexandre/Video/dog_meme.mp4 --sout="#stats"
[00007f6018000c60] stats stream out debug: stats: Adding track type:Video id:0
[00007f6018000c60] stats stream out debug: stats: track:0 type:Video segment_number:1 dts_difference:0 length:33333 dts:-33332 pts:1 current_duration:33333 md5:a0877104439d57767146edbdf9f5dce3
[00007f6018000c60] stats stream out debug: stats: track:0 type:Video segment_number:2 dts_difference:33333 length:33333 dts:1 pts:100001 current_duration:66666 md5:f52ed907bdfeaa3e53c364a08ab0b5ea
[00007f6018000c60] stats stream out debug: stats: track:0 type:Video segment_number:3 dts_difference:33333 length:33333 dts:33334 pts:33334 current_duration:99999 md5:3ee8c6a962f0e475d840d2b699b636aa
[00007f6018000c60] stats stream out debug: stats: track:0 type:Video segment_number:4 dts_difference:33334 length:33333 dts:66668 pts:66668 current_duration:133332 md5:a8783c5deb2a72fd5b33815fe134dbed
[00007f6018000c60] stats stream out debug: stats: track:0 type:Video segment_number:5 dts_difference:33333 length:33333 dts:100001 pts:166668 current_duration:166665 md5:8c48e08c47c017609d1a43205b0f29c4
[00007f6018000c60] stats stream out debug: stats: track:0 type:Video segment_number:6 dts_difference:33333 length:33333 dts:133334 pts:133334 current_duration:199998 md5:164b22d681533f41574b90fb7f5da3bb
[00007f6018000c60] stats stream out debug: stats: track:0 type:Video segment_number:7 dts_difference:33334 length:33333 dts:166668 pts:266668 current_duration:233331 md5:cfb688d1cb458b580a5f3818af5ffa84
[00007f6018000c60] stats stream out debug: stats: track:0 type:Video segment_number:8 dts_difference:33333 length:33333 dts:200001 pts:200001 current_duration:266664 md5:177d8b5a519ed0dc62e843fe0860282f
[00007f6018000c60] stats stream out debug: stats: track:0 type:Video segment_number:9 dts_difference:33333 length:33333 dts:233334 pts:233334 current_duration:299997 md5:58098d332ce722113280e3b23db8b6bf
Almost no PTS difference for audio:
./build-native/vlc -vv -I dummy file/mp4:///home/alexandre/Video/dog_meme.mp4 --sout="#stats" --play-and-exit 2>&1 | grep :Audio | head -n 10
[00007fb2ac000c60] stats stream out debug: stats: Adding track type:Audio id:2
[00007fb2ac000c60] stats stream out debug: stats: track:2 type:Audio segment_number:1 dts_difference:0 length:23219 dts:1 pts:1 current_duration:23219 md5:93e67149332e1ac68a7e39fff8e63dd9
[00007fb2ac000c60] stats stream out debug: stats: track:2 type:Audio segment_number:2 dts_difference:23219 length:23220 dts:23220 pts:23220 current_duration:46439 md5:cc6c402e6692e5cd9894f20d03136997
[00007fb2ac000c60] stats stream out debug: stats: track:2 type:Audio segment_number:3 dts_difference:23220 length:23220 dts:46440 pts:46440 current_duration:69659 md5:daa7ca639c42ceec0c5c014677626321
[00007fb2ac000c60] stats stream out debug: stats: track:2 type:Audio segment_number:4 dts_difference:23220 length:23220 dts:69660 pts:69660 current_duration:92879 md5:4c1716ae60a3f22dc5ea78bfda78cee0
[00007fb2ac000c60] stats stream out debug: stats: track:2 type:Audio segment_number:5 dts_difference:23220 length:23220 dts:92880 pts:92880 current_duration:116099 md5:8f70beee41ff1b8cb66fb56134485858
[00007fb2ac000c60] stats stream out debug: stats: track:2 type:Audio segment_number:6 dts_difference:23220 length:23220 dts:116100 pts:116100 current_duration:139319 md5:e570325d714d9b9dd2a26b58d6382f7a
[00007fb2ac000c60] stats stream out debug: stats: track:2 type:Audio segment_number:7 dts_difference:23220 length:23220 dts:139320 pts:139320 current_duration:162539 md5:aa1e542003a625e5596bf007a2118bfd
[00007fb2ac000c60] stats stream out debug: stats: track:2 type:Audio segment_number:8 dts_difference:23220 length:23220 dts:162540 pts:162540 current_duration:185759 md5:f21993a567e231c8567518dcab96c1dd
[00007fb2ac000c60] stats stream out debug: stats: track:2 type:Audio segment_number:9 dts_difference:23220 length:23220 dts:185760 pts:185760 current_duration:208979 md5:40123cc9b3a347b40803f570a7ffbc28
./build-native/vlc -vv -I dummy file/avformat:///home/alexandre/Video/dog_meme.mp4 --sout="#stats" --play-and-exit 2>&1 | grep :Audio | head -n 10
[00007f8634000c60] stats stream out debug: stats: Adding track type:Audio id:1
[00007f8634000c60] stats stream out debug: stats: track:1 type:Audio segment_number:1 dts_difference:0 length:23219 dts:1 pts:1 current_duration:23219 md5:93e67149332e1ac68a7e39fff8e63dd9
[00007f8634000c60] stats stream out debug: stats: track:1 type:Audio segment_number:2 dts_difference:23220 length:23219 dts:23221 pts:23221 current_duration:46438 md5:cc6c402e6692e5cd9894f20d03136997
[00007f8634000c60] stats stream out debug: stats: track:1 type:Audio segment_number:3 dts_difference:23220 length:23219 dts:46441 pts:46441 current_duration:69657 md5:daa7ca639c42ceec0c5c014677626321
[00007f8634000c60] stats stream out debug: stats: track:1 type:Audio segment_number:4 dts_difference:23220 length:23219 dts:69661 pts:69661 current_duration:92876 md5:4c1716ae60a3f22dc5ea78bfda78cee0
[00007f8634000c60] stats stream out debug: stats: track:1 type:Audio segment_number:5 dts_difference:23220 length:23219 dts:92881 pts:92881 current_duration:116095 md5:8f70beee41ff1b8cb66fb56134485858
[00007f8634000c60] stats stream out debug: stats: track:1 type:Audio segment_number:6 dts_difference:23220 length:23219 dts:116101 pts:116101 current_duration:139314 md5:e570325d714d9b9dd2a26b58d6382f7a
[00007f8634000c60] stats stream out debug: stats: track:1 type:Audio segment_number:7 dts_difference:23220 length:23219 dts:139321 pts:139321 current_duration:162533 md5:aa1e542003a625e5596bf007a2118bfd
[00007f8634000c60] stats stream out debug: stats: track:1 type:Audio segment_number:8 dts_difference:23220 length:23219 dts:162541 pts:162541 current_duration:185752 md5:f21993a567e231c8567518dcab96c1dd
[00007f8634000c60] stats stream out debug: stats: track:1 type:Audio segment_number:9 dts_difference:23220 length:23219 dts:185761 pts:185761 current_duration:208971 md5:40123cc9b3a347b40803f570a7ffbc28
I'm unsure of which demux could produce the issue since I've never seen negative vlc_tick_t before. However, the mp4 demux seems to produce repeated PTS values (33334 here) which is not appreciated by following encoders.