[FFmpeg-user] 'setts=dts' is changing all PTSs instead

Mark Filipak markfilipak.imdb at gmail.com
Sat Apr 6 09:26:57 EEST 2024


Does anyone see what I'm doing wrong?

BEFORE.
0,  503945955,  503957216,     3753,   640646, 0x90f222e3
0,  503957216,  503964723,     3753,   125904, 0x3f60a4e2
0,  503960970,  503960970,     3753,   106426, 0xe5c85d36
0,  503964723,  503975985,     3753,   126806, 0x9c5d46c5

COMMAND to change the 1st frame's DTS from 503945955 to 503953462.
ffmpeg -copyts -i in.m2ts -map 0 -bsf:v setts=dts='if(eq(DTS\,503945955)\,503953462\,DTS)' -c copy 
-dn -muxdelay 0 out.m2ts

PROVOKED:
[vost#0:0/copy @ 0000000002ac04c0] Invalid DTS: 503953462 PTS: 503945955, replacing by guess

AFTER, all the PTSs have been changed.
0,  503945955,  503945955,     3753,   640646, 0x90f222e3
0,  503957216,  503957216,     3753,   125904, 0x3f60a4e2
0,  503960970,  503960970,     3753,   106426, 0xe5c85d36
0,  503964723,  503964723,     3753,   126806, 0x9c5d46c5

in.m2ts, there is _no_ PTS==503945955. FFmpeg appears to be mixing up PTS with DTS. Terminal output 
is below.

Thanks,
Mark.


C:\Windows\System32>ffmpeg -copyts -i c:\in.m2ts -map 0 -bsf:v 
setts=dts='if(eq(DTS\,503945955)\,503953463\,DTS)' -c copy -dn -muxdelay 0 c:\out.m2ts
ffmpeg version 2024-04-04-git-478d97f303-full_build-www.gyan.dev Copyright (c) 2000-2024 the FFmpeg 
developers
   built with gcc 13.2.0 (Rev5, Built by MSYS2 project)
   configuration: --enable-gpl --enable-version3 --enable-static --disable-w32threads 
--disable-autodetect --enable-fontconfig --enable-iconv --enable-gnutls --enable-li
bxml2 --enable-gmp --enable-bzlib --enable-lzma --enable-libsnappy --enable-zlib --enable-librist 
--enable-libsrt --enable-libssh --enable-libzmq --enable-avisynth --en
able-libbluray --enable-libcaca --enable-sdl2 --enable-libaribb24 --enable-libaribcaption 
--enable-libdav1d --enable-libdavs2 --enable-libuavs3d --enable-libxevd --enab
le-libzvbi --enable-librav1e --enable-libsvtav1 --enable-libwebp --enable-libx264 --enable-libx265 
--enable-libxavs2 --enable-libxeve --enable-libxvid --enable-libaom -
-enable-libjxl --enable-libopenjpeg --enable-libvpx --enable-mediafoundation --enable-libass 
--enable-frei0r --enable-libfreetype --enable-libfribidi --enable-libharfbu
zz --enable-liblensfun --enable-libvidstab --enable-libvmaf --enable-libzimg --enable-amf 
--enable-cuda-llvm --enable-cuvid --enable-dxva2 --enable-d3d11va --enable-d3d
12va --enable-ffnvcodec --enable-libvpl --enable-nvdec --enable-nvenc --enable-vaapi 
--enable-libshaderc --enable-vulkan --enable-libplacebo --enable-opencl --enable-li
bcdio --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-lads
pa --enable-libbs2b --enable-libflite --enable-libmysofa --enable-librubberband --enable-libsoxr 
--enable-chromaprint
   libavutil      59. 13.100 / 59. 13.100
   libavcodec     61.  5.101 / 61.  5.101
   libavformat    61.  3.100 / 61.  3.100
   libavdevice    61.  2.100 / 61.  2.100
   libavfilter    10.  2.101 / 10.  2.101
   libswscale      8.  2.100 /  8.  2.100
   libswresample   5.  2.100 /  5.  2.100
   libpostproc    58.  2.100 / 58.  2.100
[mpegts @ 00000000005631c0] start time for stream 2 is not set in estimate_timings_from_pts
[mpegts @ 00000000005631c0] Could not find codec parameters for stream 2 (Subtitle: 
hdmv_pgs_subtitle (pgssub) ([144][0][0][0] / 0x0090)): unspecified size
Consider increasing the value for the 'analyzeduration' (0) and 'probesize' (5000000) options
Input #0, mpegts, from 'c:\in.m2ts':
   Duration: 00:03:04.85, start: 5599.524622, bitrate: 15195 kb/s
   Program 1
     Metadata:
       service_name    : Service01
       service_provider: FFmpeg
   Stream #0:0[0x1011]: Video: h264 (High) ([27][0][0][0] / 0x001B), yuv420p(progressive), 1920x1080 
[SAR 1:1 DAR 16:9], 23.98 fps, 23.98 tbr, 90k tbn
   Stream #0:1[0x1100]: Audio: dts (dca) (DTS-HD MA) ([130][0][0][0] / 0x0082), 48000 Hz, mono, s32p 
(24 bit)
   Stream #0:2[0x1200]: Subtitle: hdmv_pgs_subtitle (pgssub) ([144][0][0][0] / 0x0090)
File 'c:\out.m2ts' already exists. Overwrite? [y/N] y
Stream mapping:
   Stream #0:0 -> #0:0 (copy)
   Stream #0:1 -> #0:1 (copy)
   Stream #0:2 -> #0:2 (copy)
Output #0, mpegts, to 'c:\out.m2ts':
   Metadata:
     encoder         : Lavf61.3.100
   Stream #0:0: Video: h264 (High) ([27][0][0][0] / 0x001B), yuv420p(progressive), 1920x1080 [SAR 
1:1 DAR 16:9], q=2-31, 23.98 fps, 23.98 tbr, 90k tbn
   Stream #0:1: Audio: dts (DTS-HD MA) ([130][0][0][0] / 0x0082), 48000 Hz, mono, s32p (24 bit)
   Stream #0:2: Subtitle: hdmv_pgs_subtitle ([144][0][0][0] / 0x0090)
Press [q] to stop, [?] for help
[vost#0:0/copy @ 0000000003a9f980] Invalid DTS: 503953463 PTS: 503945955, replacing by guess
[out#0/mpegts @ 00000000004f7340] video:302944KiB audio:23295KiB subtitle:0KiB other streams:0KiB 
global headers:0KiB muxing overhead: 5.101183%
size=  342882KiB time=N/A bitrate=N/A speed=N/A


More information about the ffmpeg-user mailing list