Search code examples
raspberry-pirtmpavconvjustin.tv

Streaming too fast with avconv on Raspbian to justin.tv via RTMP


I want to stream *.mp4 files to justin.tv using avconv on raspbian. I'm using the following command to do this:

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

I can see my stream for a short time on justin.tv but it's streaming to fast. So the stream jumps to another part of the file and plays this part, after some time it jumps again, and so on. The fps is far to high as you can see in the output of avconv that says:

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

The frames and time is increasing that fast, like seen in the fps. I hoped that I could clamp the fps with the -r 24 command, but it's still on >200 fps. What can I do?


Solution

  • Solved it by adding -re as parameter to read input at native framerate.

    So this worked for me:

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