[FFmpeg-user] setts difficulty

Paul B Mahol onemda at gmail.com
Tue Feb 8 10:27:29 EET 2022


On Tue, Feb 8, 2022 at 3:51 AM Mark Filipak <markfilipak.noreply at gmail.com>
wrote:

> Help!
>
> Command: ffmpeg -report
>           -i 24'fps[24pps].vob
>           -filter_complex "[0:a]asetpts=expr=N/TB*1001/24000[a]"
>           -bsf setts=pts=N/TB*1001/24000:dts=N/TB*1001/24000
>           -target ntsc-dvd -map 0:v -map "[a]"
>           -codec:v copy -codec:a ac3 -dn
>           -r 24000/1001 foo.vob
>
> 24'fps[24pps].vob, the source video, is soft telecined.
> foo.vob, the target, freezes within the 1st second. The audio plays to the
> end.
> I'm trying to fix the PTSs & DTSs via 'setts'.
> I have evidence, below.
>
> Issue: Since 24'fps[24pps].vob is soft telecined, the metadata says
> 29.970fps but we all know that
> the pictures in those frames are actually 24pps (i.e. it's not hard
> telecined).
>
> Any clue how to proceed?
> The FFmpeg LOG is below, and an FFprobe is at the end.
>
>
> Clue: What are these 3 FFmpeg LOG lines about? Any ideas?
> -----
>   Multiple -c, -codec, -acodec, -vcodec, -scodec or -dcodec options
> specified for stream 0, only the
> last option '-c:v copy' will be used.
>
>   Multiple -r options specified for stream 0, only the last option '-r
> 24000/1001' will be used.
>
>   Multiple -c, -codec, -acodec, -vcodec, -scodec or -dcodec options
> specified for stream 1, only the
> last option '-c:a ac3' will be used.
> -----
> I DID NOT have multiple '-c' & '-r' directives. Did FFmpeg add some
> internal settings without
> notifying me?
>

-r XX will insert fps filter i think, you most likely do not need it if you
want to use setts bitstream filter.
-v debug output would be more useful, or provided input file.
use -af instead of filter complex to filter audio only



>
> Clue: The following FFprobe output showing the target's 1st 2 key frames.
> Note that the PTSs are screwy.
> -----
> frames.frame.0.key_frame=1
> frames.frame.0.pts=45000       <= should be zero
> frames.frame.0.pkt_dts=45000
> :
> frames.frame.12.key_frame=1
> frames.frame.12.pts=45012      <= should be 3753
> frames.frame.12.pkt_dts=45012
> -----
> That deltaPTS implies 90000 FPS !!
> Comment: It's stuff like this that impels me to use
> 'settb=expr=1001/24000,setpts=expr=N' (which
> always works) but 'settb' & 'setpts' mandate transcoding. I'm trying to
> avoid transcoding.
>
> Thanks for your patience and help,
> Mark Filipak.
>
>
> ===== Begin FFmpeg LOG:
>
> ffmpeg -report -i 24'fps[24pps].vob -filter_complex
> "[0:a]asetpts=expr=N/TB*1001/24000[a]" -bsf
> setts=pts=N/TB*1001/24000:dts=N/TB*1001/24000 -target ntsc-dvd -map 0:v
> -codec:v copy -map "[a]"
> -codec:a ac3 -dn -r 24000/1001 foo.vob
>
> ffmpeg started on 2022-02-07 at 17:57:06
> Report written to "ffmpeg-20220207-175706.log"
> Log level: 48
> ffmpeg version 2022-02-03-git-e1a14479a8-full_build-www.gyan.dev
> Copyright (c) 2000-2022 the FFmpeg
> developers
>    built with gcc 11.2.0 (Rev7, Built by MSYS2 project)
>    configuration: --enable-gpl --enable-version3 --enable-static
> --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-libdav1d --enable-libdavs2
> --enable-libuavs3d
> --enable-libzvbi --enable-librav1e --enable-libsvtav1 --enable-libwebp
> --enable-libx264
> --enable-libx265 --enable-libxavs2 --enable-libxvid --enable-libaom
> --enable-libopenjpeg
> --enable-libvpx --enable-mediafoundation --enable-libass --enable-frei0r
> --enable-libfreetype
> --enable-libfribidi --enable-libvidstab --enable-libvmaf --enable-libzimg
> --enable-amf
> --enable-cuda-llvm --enable-cuvid --enable-ffnvcodec --enable-nvdec
> --enable-nvenc --enable-d3d11va
> --enable-dxva2 --enable-libmfx --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-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      57. 19.100 / 57. 19.100
>    libavcodec     59. 20.100 / 59. 20.100
>    libavformat    59. 17.101 / 59. 17.101
>    libavdevice    59.  5.100 / 59.  5.100
>    libavfilter     8. 26.101 /  8. 26.101
>    libswscale      6.  5.100 /  6.  5.100
>    libswresample   4.  4.100 /  4.  4.100
>    libpostproc    56.  4.100 / 56.  4.100
> Input #0, mpeg, from '24'fps[24pps].vob':
>    Duration: 00:00:09.98, start: 0.500000, bitrate: 43021 kb/s
>    Stream #0:0[0x1e0]: Video: mpeg2video (Main), yuv420p(tv, progressive),
> 720x480 [SAR 32:27 DAR
> 16:9], Closed Captions, 29.97 fps, 59.94 tbr, 90k tbn
>      Side data:
>        cpb: bitrate max/min/avg: 8401600/0/0 buffer size: 1835008
> vbv_delay: N/A
>    Stream #0:1[0x80]: Audio: ac3, 48000 Hz, 5.1(side), fltp, 384 kb/s
> Multiple -c, -codec, -acodec, -vcodec, -scodec or -dcodec options
> specified for stream 0, only the
> last option '-c:v copy' will be used.
> Multiple -r options specified for stream 0, only the last option '-r
> 24000/1001' will be used.
> Multiple -c, -codec, -acodec, -vcodec, -scodec or -dcodec options
> specified for stream 1, only the
> last option '-c:a ac3' will be used.
> Stream mapping:
>    Stream #0:1 (ac3) -> asetpts:default
>    Stream #0:0 -> #0:0 (copy)
>    asetpts:default -> Stream #0:1 (ac3)
> Press [q] to stop, [?] for help
> Output #0, dvd, to 'foo.vob':
>    Metadata:
>      encoder         : Lavf59.17.101
>    Stream #0:0: Video: mpeg2video (Main), yuv420p(tv, progressive),
> 720x480 [SAR 32:27 DAR 16:9],
> q=2-31, 6000 kb/s, 29.97 fps, 59.94 tbr, 90k tbn
>      Side data:
>        cpb: bitrate max/min/avg: 8401600/0/0 buffer size: 1835008
> vbv_delay: N/A
>    Stream #0:1: Audio: ac3, 48000 Hz, 5.1(side), fltp, 448 kb/s
>      Metadata:
>        encoder         : Lavc59.20.100 ac3
> [dvd @ 000001c8b5094900] buffer underflow st=0 bufi=13621 size=21760
>  0.0kbits/s speed=1.37x
> [dvd @ 000001c8b5094900] buffer underflow st=0 bufi=15645 size=21760
> [dvd @ 000001c8b5094900] buffer underflow st=0 bufi=17669 size=21760
>
> et cetera
>
>
> ===== Begin FFprobe LOG:
>
> Showing the 1st 2 key frames. Note that the PTSs are wrong.
>
>
> ffprobe version 2022-02-03-git-e1a14479a8-full_build-www.gyan.dev
> Copyright (c) 2007-2022 the FFmpeg
> developers
> [mpeg @ 0000023e3f669900] start time for stream 0 is not set in
> estimate_timings_from_pts
> [mpeg @ 0000023e3f669900] stream 1 : no PTS found at end of file, duration
> not set
> Input #0, mpeg, from 'D:\D\Setup\Video\ffmpeg\HowTo ffmpeg,
> vapoursynth\24'fps[24pps]24fps &
> 48KHz[x0.999]48KHz\foo.vob':
>    Duration: 00:00:55.53, start: 0.500000, bitrate: 7823 kb/s
>    Stream #0:0[0x1bf]: Data: dvd_nav_packet
>    Stream #0:1[0x1e0]: Video: mpeg2video (Main), yuv420p(tv, progressive),
> 720x480 [SAR 32:27 DAR
> 16:9], Closed Captions, 29.97 fps, 29.97 tbr, 90k tbn
>      Side data:
>        cpb: bitrate max/min/avg: 8401600/0/0 buffer size: 1835008
> vbv_delay: N/A
>    Stream #0:2[0x80]: Audio: ac3, 48000 Hz, 5.1(side), fltp, 448 kb/s
> Unsupported codec with id 98312 for input stream 0
> frames.frame.0.key_frame=1
> frames.frame.0.pts=45000       <= should be zero
> frames.frame.0.pkt_dts=45000
> :
> frames.frame.12.key_frame=1
> frames.frame.12.pts=45012      <= should be 3753
> frames.frame.12.pkt_dts=45012
> _______________________________________________
> ffmpeg-user mailing list
> ffmpeg-user at ffmpeg.org
> https://ffmpeg.org/mailman/listinfo/ffmpeg-user
>
> To unsubscribe, visit link above, or email
> ffmpeg-user-request at ffmpeg.org with subject "unsubscribe".
>


More information about the ffmpeg-user mailing list