Hi All, I have problems with stream 0:2 (the subtitles). The problem ruins to-SRT conversions later in the work-flow. Also, stream 0:2 winds up with no duration and that screws up concatenations. A typical notice is "DTS discontinuity in stream 2: packet 12 with DTS 12859568". I'm trimming, then concatenating the segments. I'm used to working in 'N' & 'DTS' & 'PTS' for the trimming and the concatenations. I'm successful for video & audio, but subs are creating problems. I'd appreciate some wisdom regarding how to fix the 'discontinuity' issues. I have not found a 'showinfo' equivalent for subtitles. The log below is a version I cooked up to show 'N' only for I-frames. Thanks -- Mark. ffprobe version 2023-11-09-git-acf63d5350-full_build-www.gyan.dev Copyright (c) 2007-2023 the FFmpeg developers built with gcc 12.2.0 (Rev10, Built by MSYS2 project) configuration: --enable-gpl --enable-version3 --enable-static --pkg-config=pkgconf --disable-w32threads --disable-autodetect --enable-fontconfig --enable-iconv --enable-gnutls --enable-libxml2 --enable-gmp --enable-bzlib --enable-lzma --enable-libsnappy --enable-zlib --enable-librist --enable-libsrt --enable-libssh --enable-libzmq --enable-avisynth --enable-libbluray --enable-libcaca --enable-sdl2 --enable-libaribb24 --enable-libaribcaption --enable-libdav1d --enable-libdavs2 --enable-libuavs3d --enable-libzvbi --enable-librav1e --enable-libsvtav1 --enable-libwebp --enable-libx264 --enable-libx265 --enable-libxavs2 --enable-libxvid --enable-libaom --enable-libjxl --enable-libopenjpeg --enable-libvpx --enable-mediafoundation --enable-libass --enable-frei0r --enable-libfreetype --enable-libfribidi --enable-libharfbuzz --enable-liblensfun --enable-libvidstab --enable-libvmaf --enable-libzimg --enable-amf --enable-cuda-llvm --enable-cuvid --enable-ffnvcodec --enable-nvdec --enable-nvenc --enable-dxva2 --enable-d3d11va --enable-libvpl --enable-libshaderc --enable-vulkan --enable-libplacebo --enable-opencl --enable-libcdio --enable-libgme --enable-libmodplug --enable-libopenmpt --enable-libopencore-amrwb --enable-libmp3lame --enable-libshine --enable-libtheora --enable-libtwolame --enable-libvo-amrwbenc --enable-libcodec2 --enable-libilbc --enable-libgsm --enable-libopencore-amrnb --enable-libopus --enable-libspeex --enable-libvorbis --enable-ladspa --enable-libbs2b --enable-libflite --enable-libmysofa --enable-librubberband --enable-libsoxr --enable-chromaprint libavutil 58. 32.100 / 58. 32.100 libavcodec 60. 33.100 / 60. 33.100 libavformat 60. 17.100 / 60. 17.100 libavdevice 60. 4.100 / 60. 4.100 libavfilter 9. 13.100 / 9. 13.100 libswscale 7. 6.100 / 7. 6.100 libswresample 4. 13.100 / 4. 13.100 libpostproc 57. 4.100 / 57. 4.100 [mpegts @ 00000000003ad440] DTS discontinuity in stream 2: packet 12 with DTS 12859568, packet 13 with DTS 12970433 [mpegts @ 00000000003ad440] DTS discontinuity in stream 2: packet 20 with DTS 13302507, packet 21 with DTS 13417133 [mpegts @ 00000000003ad440] DTS discontinuity in stream 2: packet 28 with DTS 14965402, packet 29 with DTS 15080059 [mpegts @ 00000000003ad440] DTS discontinuity in stream 2: packet 36 with DTS 15502195, packet 37 with DTS 15613087 [mpegts @ 00000000003ad440] DTS discontinuity in stream 2: packet 44 with DTS 19788998, packet 45 with DTS 19903601 [mpegts @ 00000000003ad440] DTS discontinuity in stream 2: packet 52 with DTS 21207988, packet 53 with DTS 21543919 Input #0, mpegts, from 'H:\BDMV\STREAM\00305.m2ts': Duration: 01:36:12.73, start: 11.650667, bitrate: 20913 kb/s Program 1 Stream #0:0[0x1011]: Video: h264 (High) (HDMV / 0x564D4448), yuv420p(progressive), 1920x1080 [SAR 1:1 DAR 16:9], 23.98 fps, 23.98 tbr, 90k tbn Stream #0:1[0x1100]: Audio: dts (DTS-HD MA) ([134][0][0][0] / 0x0086), 48000 Hz, mono, s32p (24 bit) Stream #0:2[0x1200]: Subtitle: hdmv_pgs_subtitle ([144][0][0][0] / 0x0090), 1920x1080 frames.frame.0.key_frame=1 frames.frame.26.key_frame=1 frames.frame.50.key_frame=1
On 12/22/2023 3:24 PM, Mark Filipak wrote:
The log below is a version I cooked up to show 'N' only for I-frames.
Um, what's the actual command? There aren't a lot of options to ffprobe, but it's still good to show the command anyway. z!
On 12/25/23 02:05, Carl Zwanzig wrote:
On 12/22/2023 3:24 PM, Mark Filipak wrote:
The log below is a version I cooked up to show 'N' only for I-frames.
Um, what's the actual command? There aren't a lot of options to ffprobe, but it's still good to show the command anyway.
Hi Carl, Happy Christmas or Happy Holidays (whatever :-) I will give you 3 commands. But first... I'm having weeks of difficulties making a seamless join of trims shown below -- fair use copies of Criterion's BD of Ingmar Bergman's FANNY AND ALEXANDER" (the 5+ hour version) that I so love. English subtitles are crucial of course. h:\BDMV\STREAM\00305.m2ts: TRIM=-ss 20.062 -to 1:33:10.835 h:\BDMV\STREAM\00306.m2ts: TRIM=-ss 15.098 -to 1:15:18.472 I-frames on both ends of both trims. I tried all the easy ways and always got a 2 second stutter with 3 flashes (or worse) at the join (plus, MPV shows 5000+ hours of running time). The problem has always been the subtitle stream. Now I'm going the hard route of meticulously crafting the PTS offset to add to the trimmed version of 00306.m2ts to produce a perfect join, but nothing I do works. (Note that I'm going MKV so I can extract & SRT-convert the subs at the end.) There's 3 cases. (Note that I'm now analyzing h:\BDMV\STREAM\00305.m2ts as that's where the problem seems to be.) 1. ffprobe -i h:\BDMV\STREAM\00305.m2ts - This produces a suggestion to add -analyzeduration & explicit -probesize. 2. set PREP=-analyzeduration 240000000 -probesize 1000000000 ffprobe %PREP% -i h:\BDMV\STREAM\00305.m2ts - Those values eliminates the suggestion but produces the 6 'DTS discontinuity' notices shown previously. 3. set PREP=-analyzeduration 5772725000 -probesize 15091101696 ffprobe %PREP% -i h:\BDMV\STREAM\00305.m2ts - Those values produce 165 'DTS discontinuity' notices ending with packet 6027. In the context of subtitles, what is a 'DTS discontinuity'? I thought subs were jammed into private_stream_2 packets inside audio PESs and just appeared at the same time as the audio. Also, packet 6027 is almost nothing. There has to be hundreds of thousands of packets in an hour and a half. Are there more discontinuities that are beyond analyzeduration 5772725000? Also, the subtitle stream's start_pts from ffmpeg '-vf showinfo' and from ffprobe '-show_streams' don't match! To top it all off, No matter what 'analyzeduration' & 'probesize' are set to, the 00305.mkv copy is the same (or it appears to be the same to the ffmpeg/ffprobe tools).
participants (2)
-
Carl Zwanzig -
Mark Filipak