RTMP MultiTrack usage #5553
Replies: 2 comments
-
|
looks like I was having a formatting issue with my yaml. was able to get it working by wrapping the commands in a sh -c " xxxx " and an & at the end of each line. runOnReady: > I am still struggling with getting a feed to Twitch however.. as it seems they are not doing simple MultiTrack RMTP and instead are doing some fMP4 ingest.. and I am struggeling to figure out how to replicate. |
Beta Was this translation helpful? Give feedback.
-
|
Looks like the issue is the docker build of MediaMTX has an older version of ffmpeg that doesnt support the enhanced codec for sending the multi-track video out contrary to this https://mediamtx.org/docs/read/ffmpeg -rtmp_enhanced_codecs is not a parameter ?? was this removed in later builds then 1.11.0? |
Beta Was this translation helpful? Give feedback.
Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
-
Question
I am new to MediaMTX as a whole so pardon if I overlooked something
I recently gained access to Twitchs new Dual Format stream functionality which uses RTMP MultiTrack video's. I followed the guide on getting OBS to successfully send multiple video tracks, even updated it to include both formats at multiple encodings (below 'Config Override').. I was able to open the stream in VLC using an RTSP connection and was able to successfully verify each video track.
I have now progressed to the next step which is to select video tracks and forward to various platforms, as well as forward the entire stack to twitch.
I have added the following to the config file
ffmpeg -i rtsp://localhost:8554/mystream -map 0:v:X -map 0:a:0 -c copy -f flv "rtmp://server/live/key"
where the X is the video track i want to use.
0 - 1080p
1 - 720p
3 - 1080p vertical
etc
This seems to work... but I am struggeling to figure out how to output multiple sessions with different mappings
ffmpeg -i rtsp://localhost:8554/mystream -map 0:v:0 -map 0:a:0 -c copy -f flv "rtmp://server1080/live/key"
ffmpeg -i rtsp://localhost:8554/mystream -map 0:v:1 -map 0:a:0 -c copy -f flv "rtmp://server720/live/key"
ffmpeg -i rtsp://localhost:8554/mystream -map 0:v:3 -map 0:a:0 -c copy -f flv "rtmp://serverVert/live/key"
Ideally I would also be able to feed the full stack as is onto twich or any other platform that supports this format in the future, but I assume this would follow the same logic.
Config Override
{ "encoder_configurations": [ { "type": "obs_nvenc_h264_tex", "width": 1920, "height": 1080, "framerate": { "numerator": 60, "denominator": 1 }, "settings": { "rate_control": "CBR", "bitrate": 6000, "keyint_sec": 2, "preset": "veryfast", "profile": "high", "tune": "zerolatency" }, "canvas_index": 0 }, { "type": "obs_nvenc_h264_tex", "width": 1280, "height": 720, "framerate": { "numerator": 60, "denominator": 1 }, "settings": { "rate_control": "CBR", "bitrate": 3000, "keyint_sec": 2, "preset": "veryfast", "profile": "high", "tune": "zerolatency" }, "canvas_index": 0 }, { "type": "obs_nvenc_h264_tex", "width": 640, "height": 360, "framerate": { "numerator": 30, "denominator": 1 }, "settings": { "rate_control": "CBR", "bitrate": 500, "keyint_sec": 2, "preset": "veryfast", "profile": "main", "tune": "zerolatency" }, "canvas_index": 0 }, { "type": "obs_nvenc_h264_tex", "width": 1080, "height": 1920, "framerate": { "numerator": 60, "denominator": 1 }, "settings": { "rate_control": "CBR", "bitrate": 6000, "keyint_sec": 2, "preset": "veryfast", "profile": "main", "tune": "zerolatency" }, "canvas_index": 1 }, { "type": "obs_nvenc_h264_tex", "width": 720, "height": 1280, "framerate": { "numerator": 30, "denominator": 1 }, "settings": { "rate_control": "CBR", "bitrate": 1500, "keyint_sec": 2, "preset": "veryfast", "profile": "main", "tune": "zerolatency" }, "canvas_index": 1 }, { "type": "obs_nvenc_h264_tex", "width": 360, "height": 640, "framerate": { "numerator": 30, "denominator": 1 }, "settings": { "rate_control": "CBR", "bitrate": 500, "keyint_sec": 2, "preset": "veryfast", "profile": "main", "tune": "zerolatency" }, "canvas_index": 1 } ], "audio_configurations": { "live": [ { "codec": "ffmpeg_aac", "track_id": 1, "channels": 2, "settings": { "bitrate": 160 } } ] } }Beta Was this translation helpful? Give feedback.
All reactions