Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Support additional container formats for VP8/9 #2134

Closed
cyberj0g opened this issue Dec 11, 2021 · 5 comments
Closed

Support additional container formats for VP8/9 #2134

cyberj0g opened this issue Dec 11, 2021 · 5 comments
Assignees

Comments

@cyberj0g
Copy link
Contributor

As LPMS support for VP8 and VP9 is added by this PR, we need to support containers compatible with these codecs. I propose enabling WEBM and MKV support in production libavcodec bulid. It will require adding something like that to ffmpeg build arguments:

--enable-demuxer=matroska,webm,opus

We support hardware accelerated VP8/9 decoding, but not encoding, therefore, only viable route is .mkv or .webm input and .mp4 or .ts output. We need to enable Ffmpeg's internal opus demuxer (and maybe vorbis) to support WEBM, which won't come with AAC audio. MKV support is feasible as it's a very common container format too. I'm not sure if we are interested in supporting WEBM DASH, given streaming is handled by Mist server. The question is, how .webm and .mkv would be split into segments for transcoding?

@darkdarkdragon
Copy link
Contributor

Shouldn't we also enable opus codec? I suspect main use case for VP8 will be to take in WebRTC stream (with VP8/opus) and transcode it into h264/aac.

The question is, how .webm and .mkv would be split into segments for transcoding?

It is not the job of go-livepeer node to split files (.web, .mkv) into segments.

@Thulinma
Copy link

Isn't the Opus demuxer only for .opus files? As far as I know, the matroska demuxer can handle Opus inside .mkv just fine without further requirements (but I could be wrong about this...).
Oh, perhaps good to know: webm is a strict subset of matroska. So the matroska demuxer can handle that by itself, too.

Not supporting DASH seems reasonable (and sensible) to me. 👍
If you're doing MP4/TS outputs, plain HLS of course works just fine. It would however be nice to (optionally?) support MKV format outputs as well, as the overhead is much smaller than with MP4 or TS, and parsing that format uses less RAM/CPU. It would give a decent performance boost 🙂. Of course that is something that could be added at a later date as well (perhaps when we move to a fully-streaming workflow?).

@darkdarkdragon
Copy link
Contributor

Didn't know that webm is a subset of matroska. Then it makes sense to enable them both for input and output.

@cyberj0g
Copy link
Contributor Author

Thanks for the input. I like the idea of including MKV (and WEBM) support. WEBM demuxer and muxer still needs to be explicitly enabled. Currently, relevant Ffmpeg options for production build look like this (HW codecs are included separately):

    --enable-encoder=aac,opus,libx264 \
    --enable-decoder=aac,opus,h264 \
    --enable-muxer=mpegts,hls,segment,mp4,hevc,matroska,webm,null
    --enable-demuxer=flv,mpegts,mp4,mov,webm,matroska

https://github.com/livepeer/go-livepeer/blob/ip/hevc/install_ffmpeg.sh

@yondonfu
Copy link
Member

Closed by #2135

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

4 participants