Big thanks to 6by9 for helping me get this project this far!
I'm trying to set up my Pi to Stream to Twitch.tv without having to buy a second PC with a capture card just to stream. Especially when the Pi setup with the B101 and an SD Card is around the same price as a good capture card.
This is my current pipeline, that is still giving me some buffering issues when I stream to RTMP, but is pretty good when I stream to a file.
- gst-launch-1.0 flvmux streamable=true name=mux
- ! rtmpsink location="rtmp://live.justin.tv/app/STREAMKEY" v4l2src io-mode=4
- ! "video/x-raw,framerate=60/1,format=UYVY"
- ! v4l2h264enc output-io-mode=5 extra-controls="controls,video_bitrate=2000;"
- ! video/x-h264,profile=high
- ! h264parse
- ! queue
- ! mux. alsasrc device=hw:1
- ! audio/x-raw,rate=48000,channels=2
- ! audioconvert
- ! avenc_aac bitrate=128000
- ! aacparse
- ! queue ! mux.
At the moment, whenever I start the stream and don't do anything, it's fine. As soon as pixels start to change I get this message which appears as choppyness and buffering on Twitch:
WARNING: from element /GstPipeline:pipeline0/GstAlsaSrc:alsasrc0: Can't record audio fast enough
Additional debug info:
gstaudiobasesrc.c(849): gst_audio_base_src_create (): /GstPipeline:pipeline0/GstAlsaSrc:alsasrc0:
Dropped 106560 samples. This is most likely because downstream can't keep up and is consuming samples too slowly.
From testing for a few hours, I noticed that Twitch is sending me the video at over 20000 kbps even though I set the bitrate down to 2000. I am positive this is where my issue is coming from. - I noticed no matter what I do in the extra-controls section for v4l2h264enc, nothing changes at all. It's as if it's ignoring everything in there.
Pi 3B - Kernel 4.19
Auvidea B101 rev4
gst-launch-1.0 version 1.14.4
Unknown package origin