34
V2EX  ›  问与答

请教: ffmpeg 推流如何循环音频

  •  
  •   34 · Apr 17, 2020 · 2022 views
    This topic created in 2244 days ago, the information mentioned may be changed or developed.

    情况是这样的,我在树莓派上通过摄像头直播推流到 B 站,但是 B 站网页版没有音频会加载不出来。

    添加了一段音频后可以正常显示,但是音频结束后还是加载黑屏。

    有人知道如何循环这段音频吗,或者是加载某个路径下的音频。

    现在的命令

    raspivid -o - -t 0 -vf -hf -w 1280 -h 720 -fps 25 -b 6000000 | ffmpeg -re -stream_loop -1 -f h264 -i - -vcodec copy -f flv <rtmp 地址>

    2 replies    2020-04-17 19:38:07 +08:00
    Lax
        1
    Lax  
       Apr 17, 2020
    加一段空的声音?
    -f lavfi -i anullsrc
    34
        2
    34  
    OP
       Apr 17, 2020
    @Lax 试了一下可以,感谢!
    About   ·   Help   ·   Advertise   ·   Blog   ·   API   ·   FAQ   ·   Solana   ·   1160 Online   Highest 6679   ·     Select Language
    创意工作者们的社区
    World is powered by solitude
    VERSION: 3.9.8.5 · 37ms · UTC 23:11 · PVG 07:11 · LAX 16:11 · JFK 19:11
    ♥ Do have faith in what you're doing.