Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Gstreamer : transcoding Matroska video to mp4

Tags:

gstreamer

The hardware on which we are working on doesnt support playing of mkv files. So i'm required to transcode Matroska (mkv) video filea to mp4 video file.

As I have understood from the material available online on transcoding,I'm required to do the following :

  1. separate out different streams of mkv file using matroskademux element.
  2. decode the audio and Video streams into raw format using available mkv decoder and
    supply this data to the mp4 Muxer element and re-encode to required format.

Could anyone please tell me if I applying right approach? Any information/link on this would be very helpful.

vikram

like image 961
Vikram Desai Avatar asked Oct 10 '22 07:10

Vikram Desai


1 Answers

Depending on what is in the Matroska file you might not need to decode it at all, just remux.

I assume the video for instance is H264, so just remux that. Below is an example pipeline for gst-launch for remuxing a file with h264 and mp3.

gst-launch-0.10 -v filesrc location=$file \
! matroskademux name="demux" demux. ! h264parse ! queue \
! mp4mux name=mux ! filesink location=$file._out.mp4 demux. \
! mp3parse ! queue ! mux.`

You can also look at the Transmageddon transcoder (www.linuxrising.org) which should give you want you want.

like image 190
Christian Schaller Avatar answered Oct 13 '22 10:10

Christian Schaller