0

My problem basically comes from me having 2 different streams for videoplayback and having to mux them realtime in memory. One for video, and another for audio.

My goal is to create a proxy which can mux 2 different webm streams from their URLs, while supporting range requests (requires knowing the encoded file size). Would this be possible?

This is how I mux the audio and video streams manually using ffmpeg:

ffmpeg -i video.webm -i audio.webm -c copy output.webm

But, this requires me to download the video fully to process it, which I don't want to do unfortunately.

Thanks in advance!

2 Answers2

0

If you are looking for this to work in go you can look into

github.com/at-wat/ebml-go/webm

This provides a BlockWriter interface to write to webm file using buffers; You can see the test file to checkout how to use it

https://github.com/at-wat/ebml-go

Shubham Srivastava
  • 1,807
  • 1
  • 10
  • 17
0

Checkout ffmpeg pipes.

Also since you have tagged go - i'm assuming you will use os/exec - in which case also checkout Cmd.ExtraFiles. This lets you use additional pipes(files) beyond just the standard 0, 1 and 2.

So let's say you have a stream for video and one for audio piping to 3 and 4 respectively. The ffmpeg bit of your command becomes:

ffmpeg -i pipe:3 -i pipe:4 -c copy output.webm

Kelsnare
  • 635
  • 5
  • 12
  • I see, I wanted to use some kind of ffmpeg bindings ideally, but I'll see if I can get this to work. Also, how would handling the range requests work? That's something I can't figure out how to do with the documentation. – Kavin Sundar Nov 23 '20 at 14:20