我尝试了类似问题的多个命令,但没有一个对我有用。
-timecode 00:00:00:00
给出错误“时间戳超出 mov/mp4 格式的范围”
-vf
或者datetext
不起作用!
完整命令:ffmpeg -i "rtsp://192.168.0.100:554/user=admin&password=&channel=3&stream=0.sdp?real_stream--rtp-caching=100" -vcodec copy -r 60 -t 3540 -timecode 00:00:00:00 -y 3.mp4
输出日志:
ffmpeg version 2021-04-07-git-c06465a70b-full_build-www.gyan.dev Copyright (c) 2000-2021 the FFmpeg developers
built with gcc 10.2.0 (Rev6, 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-lzma --enable-libsnappy --enable-zlib --enable-librist --enable-libsrt --enable-libssh --enable-libzmq --enable-avisynth --enable-libbluray --enable-libcaca --enable-sdl2 --enable-libdav1d --enable-libzvbi --enable-librav1e --enable-libsvtav1 --enable-libwebp --enable-libx264 --enable-libx265 --enable-libxvid --enable-libaom --enable-libopenjpeg --enable-libvpx --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-libglslang --enable-vulkan --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 56. 72.100 / 56. 72.100
libavcodec 58.135.100 / 58.135.100
libavformat 58. 77.100 / 58. 77.100
libavdevice 58. 14.100 / 58. 14.100
libavfilter 7.111.100 / 7.111.100
libswscale 5. 10.100 / 5. 10.100
libswresample 3. 10.100 / 3. 10.100
libpostproc 55. 10.100 / 55. 10.100
Input #0, rtsp, from 'rtsp://192.168.0.100:554/user=admin&password=&channel=3&stream=0.sdp?real_stream--rtp-caching=100':
Metadata:
title : RTSP Session
Duration: N/A, start: 0.083333, bitrate: N/A
Stream #0:0: Video: h264 (High), yuv420p(progressive), 944x1080, 12 fps, 12 tbr, 90k tbn, 180k tbc
[mp4 @ 00000211ca19f940] Application provided duration: -9223372036854775808 / timestamp: -9223372036854775808 is out of range for mov/mp4 format
[mp4 @ 00000211ca19f940] pts has no value
Output #0, mp4, to '6.mp4':
Metadata:
title : RTSP Session
timecode : 00:00:00:00
encoder : Lavf58.77.100
Stream #0:0: Video: h264 (High) (avc1 / 0x31637661), yuv420p(progressive), 944x1080, q=2-31, 0.02 fps, 12 tbr, 15360 tbn, 60 tbc
Stream mapping:
Stream #0:0 -> #0:0 (copy)
Press [q] to stop, [?] for help
[mp4 @ 00000211ca19f940] Timestamps are unset in a packet for stream 0. This is deprecated and will stop working in the future. Fix your code to set the timestamps properly
[mp4 @ 00000211ca19f940] Non-monotonous DTS in output stream 0:0; previous: 0, current: 0; changing to 1. This may result in incorrect
timestamps in the output file.
[rtsp @ 00000211c9bdf080] max delay reached. need to consume packet=1170.6kbits/s speed=2.59x
[rtsp @ 00000211c9bdf080] RTP: missed 18 packets
[rtsp @ 00000211c9bdf080] max delay reached. need to consume packet=1082.4kbits/s speed=1.42x
[rtsp @ 00000211c9bdf080] RTP: missed 11 packets
[rtsp @ 00000211c9bdf080] max delay reached. need to consume packet=1094.2kbits/s speed=1.31x
[rtsp @ 00000211c9bdf080] RTP: missed 7 packets
[rtsp @ 00000211c9bdf080] max delay reached. need to consume packet=1212.8kbits/s speed= 1.2x
[rtsp @ 00000211c9bdf080] RTP: missed 16 packets
[rtsp @ 00000211c9bdf080] max delay reached. need to consume packet
[rtsp @ 00000211c9bdf080] RTP: missed 2 packets
frame= 205 fps= 14 q=-1.0 size= 2560kB time=00:00:17.16 bitrate=1221.7kbits/s speed=1.15x