5

So, I'm using ffmpeg. I can stream videos to YouTube live I've downloaded from the internet successfully using this command:

ffmpeg -re -i "C:\video.flv" -c:v libx264 -preset slow -crf 18 -c:a copy -f flv "rtmp://a.rtmp.youtube.com/live2/xyz"

When I try to stream a video that's been recorded from a specific device, that is also flv and with same command, it's not working. FFMpeg says it's transmitting, no errors there. In the live dashboard on YouTube I get a green "Starting" briefly but then it goes grey to say it's not receiving data. The only difference is the actual flv files.

Any idea why YouTube Live would say it's not receiving any data instead of giving me an error, when it clearly is receiving it because it works with other video files? Thanks

rav_kr
  • 434
  • 8
  • 16
Steve Lobdell
  • 383
  • 3
  • 9

2 Answers2

14

Well for anyone else that may come across this, my problem was that my video did not have audio. Not sure why that should matter, but putting a silent audio track over the video fixed my issue.

Steve Lobdell
  • 383
  • 3
  • 9
  • You can add silent audio with the [anullsrc audio filter](https://ffmpeg.org/ffmpeg-filters.html#anullsrc). – llogan Dec 27 '16 at 01:23
2

Yes, audio track is needed, thanks Steve.

This is my ffmpeg command (for instance) with audio null source:

ffmpeg -f lavfi -i anullsrc=r=16000:cl=mono \
   -f v4l2 -r 10 -i /dev/video1 -c:v libx264 -pix_fmt yuv420p -preset ultrafast -g 20 -b:v 2500k \
   -c:a aac -ar 44100 -threads 0 -bufsize 512k -strict experimental \
   -f flv rtmp://a.rtmp.youtube.com/live2/$CHANNELID
José Ibañez
  • 652
  • 8
  • 10