General pipeline composition for decoding any video container and re-encode it into mp4 with h264 video and mp3 audio

classic Classic list List threaded Threaded
2 messages Options
Reply | Threaded
Open this post in threaded view
|

General pipeline composition for decoding any video container and re-encode it into mp4 with h264 video and mp3 audio

mapcol
This post was updated on .
So far I have worked mostly by copying pieces of code from the internet and try them and keep what worked but I need a more wider and general understanding of video decoding and gstreamer.

I need a pipeline to decode the most common video containers and re-encode them into mp4
As far as I have understood so far on media encoding theory, this pseudo pipeline should work:

filesrc --> DEMUXER(matroskademux, qtdemux, ...) --> branch1 and branch2

branch1 (audio) --> PARSER (aacparse, mp3parse, ...) --> DECODER (faad, maad, ...) --> ENCODER --> (lamemp3enc) --> MERGE_BRANCH


branch2 (video) --> PARSER(h264parse, ..., ...) --> DECODER(ffdec_h264) --> ENCODER (x264enc) --> MERGE_BRANCH

MERGE_BRANCH (final branch) --> MUXER(mp4mux) --> filesink

----------------------------------------------------------------------------------------------------------------------
The point is: to correctly transform my audio and video I need
- a parser
- a decoder
- an encoder
... right?

At the end I can just merge everything into a unique mp4 file.

This must work perfectly for any video container format. All metadata must be preserved. The final files must be correctly readable and ready to be played and streamed.


Can you please correct any mistake I might have made? Am I missing any element, any piece of pipeline?

Reply | Threaded
Open this post in threaded view
|

Re: General pipeline composition for decoding any video container and re-encode it into mp4 with h264 video and mp3 audio

Mikl
Hello, mapcol

In general you are right: need to start and finish. :)

Your question is too wide.
It is a lot "but" in every specific case.

Try to be more specific, if you need help in something.

Mikl