Answer the question
In order to leave comments, you need to log in
How to stream video from camera to youtube?
Good afternoon!
Task:
There is a camera giving a stream through rtsp. On the site you need to display video from this camera.
I tried to organize a publication on youtube via ffmpeg. But youtube does not see the stream, in the panel it constantly displays "Unable to receive data from the video encoder. Check its parameters in the broadcast settings."
Channel with a good reputation, video broadcasts are allowed.
The script of a certain olasd was taken as a basis https://gist.github.com/olasd/9841772
VBR="2500k"
FPS="30"
QUAL="medium"
YOUTUBE_URL="rtmp://a.rtmp.youtube.com/live2"
SOURCE="rtsp://109.87.205.23:554/user=admin&password=admin&channel=3&stream=0.sdp?real_stream--rtp-caching=100"
KEY="awesome.drx2-d9q7-xx4z-ac8q" # Название потока в Youtube
ffmpeg \
-rtsp_transport tcp -i "$SOURCE" \
-vcodec libx264 -pix_fmt yuv420p -preset $QUAL -r $FPS -g $(($FPS * 2)) -b:v $VBR \
-f flv "$YOUTUBE_URL/$KEY"
Answer the question
In order to leave comments, you need to log in
I think you should look here
for encoding parameters.
In turn, I can offer my encoding settings for uploading to YouTube (Made according to the above recommendations):
ffmpeg -i *.mp4 \
-pix_fmt yuv420p -r 25 -g 12 -bf 2 \
-c:v libx264 -profile:v high \
-b:v 8M -bufsize 4M -maxrate 8M -minrate 128k \
-c:a libvo_aacenc -b:a 384k -ar 48000 \
output.mp4
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question