Re: [FFmpeg-user] Converting DTS (timestamps) in mpegts to HH:MM:SS:FF
Hi On Tue, Jun 16, 2020 at 9:51 AM Gyan Doshi wrote: > > > On 16-06-2020 02:15 pm, Kieran O Leary wrote: > > On Tue, Jun 16, 2020 at 9:40 AM Kieran O Leary > > > wrote: > > > >> OK, so I figured out that the dts needs to be divided by > >> pkt_duration_time, which in this instance was 3600. Not sure how to get > >> that aside from using ffprobe as I don't see it listed in the ffmpeg > output. > >> > > Sorry, the dts value needs to be divided by pkt_duration, which gives the > > frame number. Also ffmpeg is amazing. > > Actually, the dts is denominated in terms of the stream time_base. For > MPEG-TS, that's 9 for all streams. > This applies to the dts shown in the corrupt packet msg. After decoding, > lavc will change audio stream time base to stream sampling rate. > Argh, you're absolutely right,that produces the seconds value. Thanks Gyan! K ___ ffmpeg-user mailing list ffmpeg-user@ffmpeg.org https://ffmpeg.org/mailman/listinfo/ffmpeg-user To unsubscribe, visit link above, or email ffmpeg-user-requ...@ffmpeg.org with subject "unsubscribe".
Re: [FFmpeg-user] Converting DTS (timestamps) in mpegts to HH:MM:SS:FF
Hi Moritz, On Tue, Jun 16, 2020 at 9:55 AM Moritz Barsnick wrote: > On Tue, Jun 16, 2020 at 09:45:02 +0100, Kieran O Leary wrote: > > On Tue, Jun 16, 2020 at 9:40 AM Kieran O Leary > > > > OK, so I figured out that the dts needs to be divided by > > > pkt_duration_time, which in this instance was 3600. Not sure how to get > > > that aside from using ffprobe as I don't see it listed in the ffmpeg > output. > > > > Sorry, the dts value needs to be divided by pkt_duration, which gives the > > frame number. Also ffmpeg is amazing. > > Note that ffprobe also has those *_time fields, where the calculation > is already done for you. E.g. best_effort_timestamp_time, pkt_pts_time, > pkt_dts_time, pkt_duration_time. > > (Does ffprobe report which frames are corrupt? I didn't check.) > it does indeed - not the exact same message I received earlier, but it's enough for me to write a script to catch these: Here's a snip from the ffprobe output I posted that shows the corruption Best, Kieran ___ ffmpeg-user mailing list ffmpeg-user@ffmpeg.org https://ffmpeg.org/mailman/listinfo/ffmpeg-user To unsubscribe, visit link above, or email ffmpeg-user-requ...@ffmpeg.org with subject "unsubscribe".
Re: [FFmpeg-user] Converting DTS (timestamps) in mpegts to HH:MM:SS:FF
On Tue, Jun 16, 2020 at 09:45:02 +0100, Kieran O Leary wrote: > On Tue, Jun 16, 2020 at 9:40 AM Kieran O Leary > > OK, so I figured out that the dts needs to be divided by > > pkt_duration_time, which in this instance was 3600. Not sure how to get > > that aside from using ffprobe as I don't see it listed in the ffmpeg output. > > Sorry, the dts value needs to be divided by pkt_duration, which gives the > frame number. Also ffmpeg is amazing. Note that ffprobe also has those *_time fields, where the calculation is already done for you. E.g. best_effort_timestamp_time, pkt_pts_time, pkt_dts_time, pkt_duration_time. (Does ffprobe report which frames are corrupt? I didn't check.) Cheers, Moritz ___ ffmpeg-user mailing list ffmpeg-user@ffmpeg.org https://ffmpeg.org/mailman/listinfo/ffmpeg-user To unsubscribe, visit link above, or email ffmpeg-user-requ...@ffmpeg.org with subject "unsubscribe".
Re: [FFmpeg-user] Converting DTS (timestamps) in mpegts to HH:MM:SS:FF
On 16-06-2020 02:15 pm, Kieran O Leary wrote: On Tue, Jun 16, 2020 at 9:40 AM Kieran O Leary wrote: OK, so I figured out that the dts needs to be divided by pkt_duration_time, which in this instance was 3600. Not sure how to get that aside from using ffprobe as I don't see it listed in the ffmpeg output. Sorry, the dts value needs to be divided by pkt_duration, which gives the frame number. Also ffmpeg is amazing. Actually, the dts is denominated in terms of the stream time_base. For MPEG-TS, that's 9 for all streams. This applies to the dts shown in the corrupt packet msg. After decoding, lavc will change audio stream time base to stream sampling rate. Gyan ___ ffmpeg-user mailing list ffmpeg-user@ffmpeg.org https://ffmpeg.org/mailman/listinfo/ffmpeg-user To unsubscribe, visit link above, or email ffmpeg-user-requ...@ffmpeg.org with subject "unsubscribe".
Re: [FFmpeg-user] Converting DTS (timestamps) in mpegts to HH:MM:SS:FF
On Tue, Jun 16, 2020 at 9:40 AM Kieran O Leary wrote: > OK, so I figured out that the dts needs to be divided by > pkt_duration_time, which in this instance was 3600. Not sure how to get > that aside from using ffprobe as I don't see it listed in the ffmpeg output. > Sorry, the dts value needs to be divided by pkt_duration, which gives the frame number. Also ffmpeg is amazing. Best, Kieran. > ___ ffmpeg-user mailing list ffmpeg-user@ffmpeg.org https://ffmpeg.org/mailman/listinfo/ffmpeg-user To unsubscribe, visit link above, or email ffmpeg-user-requ...@ffmpeg.org with subject "unsubscribe".
Re: [FFmpeg-user] Converting DTS (timestamps) in mpegts to HH:MM:SS:FF
OK, so I figured out that the dts needs to be divided by pkt_duration_time, which in this instance was 3600. Not sure how to get that aside from using ffprobe as I don't see it listed in the ffmpeg output. And I also realised via this https://github.com/bavc/qctools/issues/291 that just pulling frame level data via ffprobe is a better way to get this data: ffprobe 2.m2t -show_log 16 -show_frames -of xml > bla.xml gives me lovely stuff like this: Best, Kieran ___ ffmpeg-user mailing list ffmpeg-user@ffmpeg.org https://ffmpeg.org/mailman/listinfo/ffmpeg-user To unsubscribe, visit link above, or email ffmpeg-user-requ...@ffmpeg.org with subject "unsubscribe".
[FFmpeg-user] Converting DTS (timestamps) in mpegts to HH:MM:SS:FF
Hi, I'm working with HDV tape transfers in the moment and dealing with m2t transport streams. I've found that using ffmpeg -report -loglevel debug -i input -f null - has been great at catching corrupt frames that I can investigate in playback software. I just realised that this can be done even quicker and it looks like the same corruption is detected when using -c copy. However, the report I get in the terminal just uses dts values - is there a way to convert these dts values to a frame number or preferably a HH:MM:SS:FF value? is it related to the tbn/tbc value? Either in ffmpeg or even some scriptable way. For example, one of the errors displays like this: [mpegts @ 0165bdcd34c0] Packet corrupt (stream = 1, dts = 332636400) and I can tell from using -f null - that this corresponds to approx 01:01:33.55 , but I can't find a way to get the dts value to relate to that timestamp. ffmpeg -i 2.m2t -c copy -f null - ffmpeg version N-96643-g2942b00285-g2383021a7a+1 Copyright (c) 2000-2020 the FFmpeg developers built with gcc 9.2.0 (Rev2, Built by MSYS2 project) configuration: --disable-autodetect --enable-amf --enable-bzlib --enable-cuda --enable-cuvid --enable-d3d11va --enable-dxva2 --enable-iconv --enable-lzma --enable-nvenc --enable-zlib --enable-sdl2 --enable-ffnvcodec --enable-nvdec --enable-cuda-llvm --enable-libmp3lame --enable-libopus --enable-libvorbis --enable-libx264 --enable-libdav1d --disable-debug --enable-fontconfig --enable-libass --enable-libbluray --enable-libfreetype --enable-libmfx --enable-libmysofa --enable-libopencore-amrnb --enable-libopencore-amrwb --enable-libopenjpeg --enable-libsnappy --enable-libsoxr --enable-libspeex --enable-libtheora --enable-libtwolame --enable-libvidstab --enable-libvo-amrwbenc --enable-libwavpack --enable-libwebp --enable-libxml2 --enable-libzimg --enable-libshine --enable-gpl --enable-avisynth --enable-libxvid --enable-libaom --enable-libopenmpt --enable-version3 --enable-openssl --extra-cflags=-DLIBTWOLAME_STATIC --extra-libs=-lstdc++ --extra-cflags=-DLIBXML_STATIC --extra-libs=-liconv --enable-nonfree libavutil 56. 39.100 / 56. 39.100 libavcodec 58. 67.101 / 58. 67.101 libavformat58. 37.100 / 58. 37.100 libavdevice58. 9.103 / 58. 9.103 libavfilter 7. 74.100 / 7. 74.100 libswscale 5. 6.100 / 5. 6.100 libswresample 3. 6.100 / 3. 6.100 libpostproc55. 6.100 / 55. 6.100 [mpegts @ 0180e65c24c0] PES packet size mismatch [mpegts @ 0180e65c24c0] Packet corrupt (stream = 1, dts = 437428800). [mpegts @ 0180e65c24c0] Could not find codec parameters for stream 2 (Unknown: none ([160][0][0][0] / 0x00A0)): unknown codec Consider increasing the value for the 'analyzeduration' and 'probesize' options [mpegts @ 0180e65c24c0] Could not find codec parameters for stream 3 (Unknown: none ([161][0][0][0] / 0x00A1)): unknown codec Consider increasing the value for the 'analyzeduration' and 'probesize' options Input #0, mpegts, from '82.m2t': Duration: 01:20:57.08, start: 3.44, bitrate: 26122 kb/s Program 100 Stream #0:0[0x810]: Video: mpeg2video (Main) ([2][0][0][0] / 0x0002), yuv420p(tv, bt709, top first), 1440x1080 [SAR 4:3 DAR 16:9], 25000 kb/s, 25 fps, 25 tbr, 90k tbn, 50 tbc Stream #0:1[0x814]: Audio: mp2 ([3][0][0][0] / 0x0003), 48000 Hz, stereo, fltp, 384 kb/s Stream #0:2[0x815]: Unknown: none ([160][0][0][0] / 0x00A0) Stream #0:3[0x811]: Unknown: none ([161][0][0][0] / 0x00A1) Output #0, null, to 'pipe:': Metadata: encoder : Lavf58.37.100 Stream #0:0: Video: mpeg2video (Main) ([2][0][0][0] / 0x0002), yuv420p(tv, bt709, top first), 1440x1080 [SAR 4:3 DAR 16:9], q=2-31, 25000 kb/s, 25 fps, 25 tbr, 90k tbn, 90k tbc Stream #0:1: Audio: mp2 ([3][0][0][0] / 0x0003), 48000 Hz, stereo, fltp, 384 kb/s Stream mapping: Stream #0:0 -> #0:0 (copy) Stream #0:1 -> #0:1 (copy) Press [q] to stop, [?] for help [mpegts @ 0180e65c24c0] Packet corrupt (stream = 0, dts = 5317200). [mpegts @ 0180e65c24c0] Packet corrupt (stream = 0, dts = 10821600). [mpegts @ 0180e65c24c0] Packet corrupt (stream = 0, dts = 116416800).322x [mpegts @ 0180e65c24c0] PES packet size mismatch [mpegts @ 0180e65c24c0] Packet corrupt (stream = 1, dts = 116398800). [mpegts @ 0180e65c24c0] Packet corrupt (stream = 0, dts = 332654400).341x [mpegts @ 0180e65c24c0] PES packet size mismatch [mpegts @ 0180e65c24c0] Packet corrupt (stream = 1, dts = 332636400). [mpegts @ 0180e65c24c0] PES packet size mismatch04 bitrate=N/A speed= 345x [mpegts @ 0180e65c24c0] Packet corrupt (stream = 1, dts = 437428800). frame=121338 fps=8612 q=-1.0 Lsize=N/A time=01:20:57.04 bitrate=N/A speed= 345x video:14811578kB audio:227500kB subtitle:0kB other streams:0kB global headers:0kB muxing overhead: unknown Best, Kieran O'Leary Irish Film Institute ___ ffmpeg-user mailing list ffmpeg-user@ffmpeg.org https://ffmpeg.org/mailman/lis