Given the x264 stream and vgbis ogg stream, how do I create a multiplexed stream that mplayer / VLC can read?

I got confused and a bit stuck on this issue. All I can find on Google is the main use of transcoding software, which is not related to the issue.

I am making a game and I would like to enable the built-in capture ability for streaming video. I would really like to pass this on to standard clients like VLC. It must be in the format that it recognizes, and it must be multiplexed for this to work.

So my question is: I know how to encode material from raw video frames to x264 (see also How to encode a series of images in H264 using the x264 C API? ). I know how to encode raw sound samples in ogg / vorbis. Now, how do I put one and one together for a VLC?

+3
source share
1 answer

x264not a stream format. This is a piece of software. This software encodes video in H.264 format. AFAIK, it does not multiplex video + audio to MP4 or AVI file files. Take a look at ffmpeg / libav for a complete set. There are other programs for multimedia video and audio streams.

Here was an experiment:

youtube-dl "http://www.youtube.com/watch?v=0Bmhjf0rKe8"
avconv -i 0Bmhjf0rKe8.flv -vn -c:a libvorbis -b:a 64k 0Bmhjf0rKe8.ogg
avconv -i 0Bmhjf0rKe8.flv -c:v copy -bsf:v h264_mp4toannexb -an 0Bmhjf0rKe8.h264
avconv -i 0Bmhjf0rKe8.h264 -i 0Bmhjf0rKe8.ogg -c copy 0Bmhjf0rKe8.mkv
mplayer 0Bmhjf0rKe8.mkv
avconv -i 0Bmhjf0rKe8.flv -i 0Bmhjf0rKe8.ogg -c copy -map 0:0 -map 1:0 0Bmhjf0rKe8.mp4
mplayer 0Bmhjf0rKe8.mp4

You can do this programmatically using libav.

+3
source

All Articles