我正在尝试从 ffmpeg 保存一个片段但一直收到以下错误:
[mpegts @ 0000000003a20560] Invalid segment filename template 'Test-%date:~7,4%
%date:~3,3%-%date:~0,2%_%time:~0,2%-%time:~3,2%-%time:~6,2%.ts'
Could not write header for output file #0 (incorrect codec parameters ?): Inval
d argument
我确实知道我尝试获取日期/时间的方式不正确。有人能帮我纠正一下吗?
命令如下:
ffmpeg -i rtp://10.0.0.239:1234 -vcodec copy -acodec copy -f segment -segment_time 60 -segment_format ts "Test-
%date:~7,4%-%date:~3,3%-%date:~0,2%_%time:~0,2%-%time:~3,2%-%time:~6,2%.ts"
答案1
尝试此选项-strftime 1 "%Y-%m-%d_%H-%M-%S.jpg"