gpt4 book ai didi

FFMPEG 将 RTSP 转换为 RTMP 覆盖管道

转载 作者:行者123 更新时间:2023-12-04 23:20:19 25 4
gpt4 key购买 nike

我有 ffmpeg 命令,我想将 RTSP 转换为 RTMP 广播。
在广播之前,我想用图像覆盖框架。
所以,这是我的管道:

  • 从 RTSP 读取流
  • 叠加图像
  • 广播 RTMP (Youtube)

  • 我尝试了一些命令,但遇到了错误消息:
  • 这是我的命令

  • 我之所以使用anullsrc是因为RTMP服务器必须输入一个音频流,而我的视频流没有音频
    ffmpeg -i image.jpg -i <rtsp://server> -filter_complex "[1:v][0:v]overlay"  -f lavfi -i anullsrc -rtsp_transport udp -t 12:00:00 -pix_fmt + -tune zerolatency -sstrict expreimental -f flv <rtmp:// server>
  • 错误信息
  • [rtsp @ 0000021890521700] Thread message queue blocking; consider raising the thread_queue_size option (current value: 8)
    The filters 'graph 0 input from stream 0:0' and 'Parsed_overlay_0' do not have a common format and automatic conversion is disabled.
    Error reinitializing filters!
    Failed to inject frame into filter network: Invalid argument
    Error while processing the decoded data for stream #0:0
    Conversion failed!
  • 所有留言
  • Input #0, image2, from 'image.jpg':
    Duration: 00:00:00.04, start: 0.000000, bitrate: 1763 kb/s
    Stream #0:0: Video: mjpeg (Baseline), yuvj420p(pc, bt470bg/unknown/unknown), 225x225 [SAR 1:1 DAR 1:1], 25 fps, 25 tbr, 25 tbn
    Input #1, rtsp, from 'rtsp://~~~~~~~~~~~~~~~':
    Metadata:
    title : RTMP Server
    comment : RTMP Server Session Description : standard
    Duration: N/A, start: 0.034000, bitrate: N/A
    Stream #1:0: Video: h264 (Main), yuvj420p(pc, bt709, progressive), 1920x1080, 30 tbr, 90k tbn
    Input #2, lavfi, from 'anullsrc':
    Duration: N/A, start: 0.000000, bitrate: 705 kb/s
    Stream #2:0: Audio: pcm_u8, 44100 Hz, stereo, u8, 705 kb/s
    Codec AVOption tune (The metric that the encoder tunes for. Automatically chosen by the encoder by default) specified for output file #0 (rtmp://a.rtmp.youtube.com/live2/~~~~~~~~~~~~~~~) has not been used for any stream. The most likely reason is either wrong type (e.g. a video option with no video streams) or that it is a private option of some encoder which was not actually used for any stream.
    Stream mapping:
    Stream #0:0 (mjpeg) -> overlay:overlay (graph 0)
    Stream #1:0 (h264) -> overlay:main (graph 0)
    overlay (graph 0) -> Stream #0:0 (flv)
    Stream #2:0 -> #0:1 (pcm_u8 (native) -> mp3 (libmp3lame))
    Press [q] to stop, [?] for help
    [rtsp @ 0000021890521700] Thread message queue blocking; consider raising the thread_queue_size option (current value: 8)
    The filters 'graph 0 input from stream 0:0' and 'Parsed_overlay_0' do not have a common format and automatic conversion is disabled.
    Error reinitializing filters!
    Failed to inject frame into filter network: Invalid argument
    Error while processing the decoded data for stream #0:0
    Conversion failed!
    谢谢。

    最佳答案

    我自己解决了。
    这是我的命令:

    ffmpeg -f lavfi -i anullsrc  -rtsp_transport udp -i <rtsp:~> -i <image.jpg> -filter_complex "[1:v][2:v]overlay" -tune zerolatency -vcodec libx264 -t 12:00:00 -pix_fmt yuvj420p -c:v libx264 -c:a aac -sstrict expreimental -f flv <rtmp:~>

    谢谢。

    关于FFMPEG 将 RTSP 转换为 RTMP 覆盖管道,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/68222503/

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