mardi 24 août 2021

ffmpeg random mp3 audio play

I stream images from an IP camera to an external player and play back mp3 files as background music in a loop. In order to keep the playback continuity, I combined several mp3 songs together. Each time the external player is started, the background music starts from the same track (which was saved first as a result of joining mp3 files). When I start the player, I would like to run a random mp3 file as background music and play the whole list in random order and additionally in a loop. Here is my current camera streaming code + logo position + mp3 playback

 ffmpeg -stimeout 5000000 -rtsp_transport tcp \
 -i "rtsp://IP:PORT/Streaming/Channels/101/" \
 -i /root/logo_streaming.png -filter_complex "overlay=x=main_w-overlay_w-30:y=30" -stream_loop -1 \
 -i /root/mix_57m37s.mp3 \
 -vcodec libx264 -preset veryfast -vprofile baseline -x264opts keyint=40 -b:v 4096k -bufsize 1024k \
 -f mpegts udp://IP:PORT?pkt_size=1316



Aucun commentaire:

Enregistrer un commentaire