通过RTMP将Rasconbian上的avconv流式传输到justin.tv

时间:2014-05-29 16:33:34

标签: raspberry-pi rtmp avconv justin.tv

我想在raspbian上使用avconv将* .mp4文件流式传输到justin.tv。我正在使用以下命令执行此操作:

avconv  -i ./${FILE_TO_STREAM} \
    -vcodec copy \
    -acodec copy \
    -threads 0 \
    -r 24 \
    -f flv rtmp://live-fra.justin.tv/${SECRET_KEY}

我可以在justin.tv上看到我的短暂时间流,但它正在快速流式传输。因此,流跳转到文件的另一部分并播放此部分,一段时间后它再次跳转,依此类推。 fps远远高于你在avconv的输出中所看到的那样:

frame= 2673 fps=423 q=-1.0 Lsize=    4431kB time=106.58 bitrate= 340.6kbits/s

框架和时间正在快速增加,就像在fps中看到的那样。我希望我能用-r 24命令钳制fps,但它仍然在> 200 fps。我该怎么办?

1 个答案:

答案 0 :(得分:1)

通过添加-re作为参数来解决它,以本机帧速率读取输入。

所以这对我有用:

#!/bin/bash
avconv  -re \
    -i ${FILE_TO_STREAM} \
    -threads 0 \
    -vcodec copy \
    -acodec copy \
    -f flv rtmp://live-fra.justin.tv/${SECRET_KEY}