How to split a mkv(AVC+AAC) file to pure video and audio files by using gst-launch?

Ashwini Sharma ak.ashwini at gmail.com
Thu Nov 24 21:08:19 PST 2011


Hi,

You should decode the video/audio and then re-encode them to separate files.
the pipe may look like

gstlaunch filesrc ! demux ! video_decoder ! queue ! encode ! mux ! filesink

-Ashwini

On Thu, Nov 24, 2011 at 6:23 PM, Raymond18 <yhung124 at gmail.com> wrote:

> Hi all,
>
> Can anyone help me to know how to split a mkv(AVC+AAC) file to pure video
> and audio files by using gst-launch-0.10?
>
> The information of the mkv file is as following,
>
> ----------------------------------------------
> General
> Unique ID                                :
> 194281003365095078203371305786156002599
> (0x92292902E8CC2D8396BA1C4306EC2D27)
> Complete name                            : test.mkv
> Format                                   : Matroska
> Format version                           : Version 2
> File size                                : 432 MiB
> Duration                                 : 26mn 59s
> Overall bit rate                         : 2 237 Kbps
> Encoded date                             : UTC 2011-11-04 19:32:20
> Writing application                      : mkvmerge v5.0.1 ('Es ist
> Sommer')
> built on Oct  9 2011 11:55:43
> Writing library                          : libebml v1.2.2 + libmatroska
> v1.3.0
>
> Video
> ID                                       : 1
> Format                                   : AVC
> Format/Info                              : Advanced Video Codec
> Format profile                           : High at L3.1
> Format settings, CABAC                   : Yes
> Format settings, ReFrames                : 1 frame
> Format settings, GOP                     : M=1, N=30
> Codec ID                                 : V_MPEG4/ISO/AVC
> Duration                                 : 26mn 59s
> Width                                    : 1 280 pixels
> Height                                   : 720 pixels
> Display aspect ratio                     : 16:9
> Frame rate mode                          : Variable
> Frame rate                               : 30.303 fps
> Color space                              : YUV
> Chroma subsampling                       : 4:2:0
> Bit depth                                : 8 bits
> Scan type                                : Progressive
> Language                                 : Japanese
> Default                                  : Yes
> Forced                                   : No
>
> Audio
> ID                                       : 2
> Format                                   : AAC
> Format/Info                              : Advanced Audio Codec
> Format profile                           : LC
> Codec ID                                 : A_AAC
> Duration                                 : 26mn 59s
> Channel(s)                               : 2 channels
> Channel positions                        : Front: L R
> Sampling rate                            : 44.1 KHz
> Compression mode                         : Lossy
> Language                                 : Japanese
> Default                                  : Yes
> Forced                                   : No
>
> ----------------------------------------------
>
> And I want to split it to pure video and audio file by using gst-launch as
> following, (I made it by a GUI tool in Windows )
>
> ----------------------------------------------
> Complete name                            : /home/test_track1_jpn.h264
> Format                                   : AVC
> Format/Info                              : Advanced Video Codec
> File size                                : 402 MiB
>
> Video
> Format                                   : AVC
> Format/Info                              : Advanced Video Codec
> Format profile                           : High at L3.1
> Format settings, CABAC                   : Yes
> Format settings, ReFrames                : 1 frame
> Format settings, GOP                     : M=1, N=30
> Width                                    : 1 280 pixels
> Height                                   : 720 pixels
> Display aspect ratio                     : 16:9
> Frame rate mode                          : Variable
> Color space                              : YUV
> Chroma subsampling                       : 4:2:0
> Bit depth                                : 8 bits
> Scan type                                : Progressive
>
> ----------------------------------------------
>
> and
>
> ----------------------------------------------
> General
> Complete name                            : from_matro.aac
> Format                                   : ADTS
> Format/Info                              : Audio Data Transport Stream
> File size                                : 29.8 MiB
> Overall bit rate mode                    : Variable
>
> Audio
> Format                                   : AAC
> Format/Info                              : Advanced Audio Codec
> Format version                           : Version 4
> Format profile                           : LC
> Bit rate mode                            : Variable
> Channel(s)                               : 2 channels
> Channel positions                        : Front: L R
> Sampling rate                            : 44.1 KHz
> Compression mode                         : Lossy
> Stream size                              : 29.8 MiB (100%)
>
> ----------------------------------------------
>
>
> I try to use following comands, but they are useless, can somebody tell me
> the right pipeline I should use?
>
> # gst-launch-0.10 filesrc location=/home/test.mkv ! matroskademux name=d
> d.video_00 ! filesink location=from_matro.h264
> # gst-launch-0.10 filesrc location=/home/test.mkv ! matroskademux name=d
> d.audio_00 ! filesink location=from_matro.aac
>
>
>
>
> --
> View this message in context:
> http://gstreamer-devel.966125.n4.nabble.com/How-to-split-a-mkv-AVC-AAC-file-to-pure-video-and-audio-files-by-using-gst-launch-tp4103663p4103663.html
> Sent from the GStreamer-devel mailing list archive at Nabble.com.
> _______________________________________________
> gstreamer-devel mailing list
> gstreamer-devel at lists.freedesktop.org
> http://lists.freedesktop.org/mailman/listinfo/gstreamer-devel
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.freedesktop.org/archives/gstreamer-devel/attachments/20111125/bebb0ac4/attachment.htm>


More information about the gstreamer-devel mailing list