hourger.blogg.se

Ffmpeg map audio from second video
Ffmpeg map audio from second video







ffmpeg map audio from second video

This cookie is set by GDPR Cookie Consent plugin. These cookies ensure basic functionalities and security features of the website, anonymously. Necessary cookies are absolutely essential for the website to function properly. In my example above the “language” metadata is added so that the player can choose between both audio variants. Adding the second audio to the stream-map is important too. We add a new “-map a:1” to pick also the second audio input.

ffmpeg map audio from second video

var_stream_map "a:0,agroup:audio128,language:GER a:1,agroup:audio128,language:ENG v:0,agroup:audio128 v:1,agroup:audio128" stream_%v.m3u8 Now it’s easy to add a second or even more audio languages./ffmpeg -listen 1 -i rtmp:///stream01 \ You can use any name you want (I prefer here audio128 128kbit audio). The “agroup” groups audio and video streams together. First the audio, the second one the lower video resolution and the third with the high video resolution. We have now 3 blocks (separated by a space) within the stream-map. The other change we make is how the stream variants are created. Our command needs now only one audio stream so we remove the second “-map a:0”. hls_segment_filename stream_%v/data%06d.ts \ f hls -hls_time 4 -hls_playlist_type event -hls_flags independent_segments \ The master.m3u8 file contains still the metadata for the player./ffmpeg -listen 1 -i rtmp:///stream01 \ This makes it much easier to add later more audio streams. So for our example above we would have one stream variant for audio and two stream variants for the different video resolutions. The solution is very simple: Audio and video is separated into different stream variants. This is not great for the users and our servers, because they download a file with 10 audio streams and only one of them is played. Now imagine that we have 10 audio languages, then we would have still 2 stream variants but each file contains one video stream and 10 audio streams.

ffmpeg map audio from second video

The master.m3u8 file tells the player when to play which stream variant (because it has different video resolutions). Each file within a variant contains a video and an audio stream. Until now we have produced two output stream variants (stream_0 and stream_1). This article covers the answer for this question. IntroductionĪ lot of people were asking me how to add more than one audio stream. Follow the link here to get an overview over all articles.









Ffmpeg map audio from second video