FFMPEG rtsp流将时间戳添加到输出文件中

问题描述 投票:0回答:1

我正在尝试将时间戳添加到FFMPEG的输出文件中,但出现此错误。

Filtergraph 'drawtext=fontfile=/usr/share/fonts/truetype/ttf-dejavu/DejaVuSans-Bold.ttf:text='\%T': [email protected]: x=7: y=460' was defined for video output stream 0:0 but codec copy was selected.
Filtering and streamcopy cannot be used together

我的命令是:

 ffmpeg -i rtsp://admin:[email protected]:554/11 -vf "drawtext=fontfile=/usr/share/fonts/truetype/ttf-dejavu/DejaVuSans-Bold.ttf:text='\%T': [email protected]: x=7: y=460" -acodec copy -vcodec copy test.avi

和输出:

ffmpeg版本N-75939-g6eaf97c版权所有(c)2000-2015 FFmpeg使用gcc 4.9.2(Raspbian 4.9.2-10)配置构建的开发人员:--arch = armel --target-os = linux --enable-gpl --enable-libx264 --enable-nonfree --enable-libfreetype libavutil 55. 3.100 / 55. 3.100 libavcodec 57. 5.100 / 57. 5.100 libavformat 57 。3.100 / 57. 3.100 libavdevice 57. 0.100 / 57. 0.100 libavfilter 6. 11.100 / 6. 11.100 libswscale 4. 0.100 /4. 0.100 libswresample 2. 0.100 / 2. 0.100 libpostproc 54. 0.100 / 54. 0.100输入#0,rtsp,来自'rtsp:// user:@ 192.168.1.52:554/11':元数据:标题:10时长:N / A,开始:0.159000,比特率:N / A数据流#0:0:视频:h264(主),yuv420p,1280x720、25.08 tbr,90k tbn,180k tbc流#0:1:音频:adpcm_g726,8000 Hz,单声道,s16,16 kb / s'drawtext = fontfile = / usr / share / fonts / truetype / ttf-dejavu / DejaVuSans-Bold.ttf:text ='\%T':为视频输出流定义了[email protected]:x = 7:y = 460'0:0,但已选择编解码器副本。过滤和流复制不能一起使用。

我在哪里做错了?

谢谢大家的答复:)

linux ffmpeg timestamp rtsp
1个回答
0
投票

我遇到了为ffmpeg发布的命令(感谢github用户reidransom):

ffmpeg -i video.mov -vcodec libx264 -cmp 22 -vf "drawtext=fontfile=DroidSansMono.ttf: timecode='09\:57\:00\:00': r=29.976: x=(w-tw)/2: y=h-(2*lh): fontcolor=white: box=1: boxcolor=0x00000099" -y output.mov

请记住,这是一条完整的线。时间码选项中的\字符用于将:用作字符。 r设置每秒的帧捕获率。

© www.soinside.com 2019 - 2024. All rights reserved.