Answer the question
In order to leave comments, you need to log in
How to overlay music from a playlist on a looped video in ffmpeg for YouTube streaming?
Hello everyone, I want to make a music stream on YouTube 24/7. For this I have a VDS server.
I uploaded music to a separate folder, there is a video / gif. How to put music on the background from a playlist/folder, but make the video loop, using ffmpeg?
Channel example: https://www.youtube.com/watch?v=5qap5aO4i9A
* The option with rdp and obs does not suit
Answer the question
In order to leave comments, you need to log in
Prepare the video in advance to make life easier for ffmpeg and VDS: transcode the original video into a format that does not require encoding. In the same h264 if you will stream a video stream in it. Additional will need to be specified. parameters for a group of frames:
-c:v libx264 -pix_fmt yuv420p -preset medium -r 25 -g 50 -b:v 2500k
ffmpeg -i input1.mp4 \
-c:v libx264 \
-pix_fmt yuv420p \
-preset medium \
-r 25 -g 50 \
-b:v 2500k \
-bsf:v h264_mp4toannexb -f mpegts \
video.ts
# this is a comment
file '/mp3/day1/file1.mp3'
file '/mp3/day1/file2.mp3'
file '/mp3/day1/file3.mp3'
ffmpeg \
-loop 1 -f mpegts -i video.ts \
-f concat -safe 0 -i playlist.txt \
-c:a aac -b:a 128k \
-c:v copy \
-f flv \
rtmp://a.rtmp.youtube.com/live2/ВАШ_КЛЮЧ
I didn't check it, and most likely there is a lot of work on checking and debugging the parameters.
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question