gpt4 book ai didi

linux - FFMPEG rtsp流向输出文件添加时间戳

转载 作者:太空宇宙 更新时间:2023-11-04 03:32:07 25 4
gpt4 key购买 nike

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

Filtergraph 'drawtext=fontfile=/usr/share/fonts/truetype/ttf-dejavu/DejaVuSans-Bold.ttf:text='\%T': fontcolor=white@0.8: 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:password@192.168.1.52:554/11 -vf "drawtext=fontfile=/usr/share/fonts/truetype/ttf-dejavu/DejaVuSans-Bold.ttf:text='\%T': fontcolor=white@0.8: x=7: y=460" -acodec copy -vcodec copy test.avi

输出:

ffmpeg version N-75939-g6eaf97c Copyright (c) 2000-2015 the FFmpeg developers built with gcc 4.9.2 (Raspbian 4.9.2-10) configuration: --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 Input #0, rtsp, from 'rtsp://user:@192.168.1.52:554/11':
Metadata:
title : 10 Duration: N/A, start: 0.159000, bitrate: N/A
Stream #0:0: Video: h264 (Main), yuv420p, 1280x720, 25.08 tbr, 90k tbn, 180k tbc
Stream #0:1: Audio: adpcm_g726, 8000 Hz, mono, s16, 16 kb/s Filtergraph 'drawtext=fontfile=/usr/share/fonts/truetype/ttf-dejavu/DejaVuSans-Bold.ttf:text='\%T': fontcolor=white@0.8: 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 发布的命令(感谢 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 设置每秒帧数捕获率。

关于linux - FFMPEG rtsp流向输出文件添加时间戳,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/33130927/

25 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com