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@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@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 |
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 <[hidden email]> wrote: Hi all, _______________________________________________ gstreamer-devel mailing list [hidden email] http://lists.freedesktop.org/mailman/listinfo/gstreamer-devel |
Thanks for your response,
However, is there any other way to achieve this without decoding and encoding file again? I find a command tool called "mkvextract" in mkvtoolnix-4.5.0-1.fc15.i686 package can do it without re-encoding file. ----------------------------- $ mkvextract tracks ./test.mkv 1:extrace_file.h264 Extracting track 1 with the CodecID 'V_MPEG4/ISO/AVC' to the file 'extrace_file.h264'. Container format: AVC/h.264 elementary stream Progress: 100% ----------------------------- How does gst-launch to do the same thing? |
In reply to this post by Raymond18
Il 24/11/2011 13:53, Raymond18 ha scritto:
> 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@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@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 try adding a parser, for example h264parse before filesink, I suggest to add a muxer too, for example: gst-launch-0.10 filesrc location=/home/test.mkv ! matroskademux ! h264parse ! matroskamux ! filesink location=from_matro_h264.mkv > # gst-launch-0.10 filesrc location=/home/test.mkv ! matroskademux name=d > d.audio_00 ! filesink location=from_matro.aac same as for the video, this time use aacparse, Nicola > > > > > -- > 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 > [hidden email] > http://lists.freedesktop.org/mailman/listinfo/gstreamer-devel > _______________________________________________ gstreamer-devel mailing list [hidden email] http://lists.freedesktop.org/mailman/listinfo/gstreamer-devel |
Thanks a lot.
BUT.. # gst-launch-0.10 filesrc location=/home/test.mkv ! matroskademux ! h264parse ! matroskamux ! filesink location=from_matro_h264.mkv The above command will generate a mkv format file as following. ------------------------------ $ mediainfo from_matro_h264.mkv General Unique ID : 71489747204572974788463573681922212707 (0x35C86CAB19E3C56A9A2ECB325EC18363) Complete name : from_matro.h264 Format : Matroska Format version : Version 2 Duration : 26mn 59s Overall bit rate : 2 087 Kbps Encoded date : UTC 2011-11-25 08:01:02 ------------------------------ How to generate a pure AVC format file as following by using gst-launch without Matroska container? Which plug-in should I use? ------------------------------ $ mediainfo test_track1_jpn.h264 General Complete name : test_track1_jpn.h264 Format : AVC Format/Info : Advanced Video Codec Video Format : AVC Format/Info : Advanced Video Codec Format profile : High@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 ------------------------------ I already try # gst-launch-0.10 filesrc location=/home/test.mkv ! matroskademux ! h264parse ! filesink location=use_h264parse.h264 It doesn't work. ------------------------------ $ mediainfo use_h264parse.h264 General Complete name : from_matro.h264 File size : 402 MiB ------------------------------ Expect for all your response. |
Il 25/11/2011 09:10, Raymond18 ha scritto:
> Thanks a lot. > > BUT.. > # gst-launch-0.10 filesrc location=/home/test.mkv ! matroskademux ! > h264parse ! matroskamux ! filesink location=from_matro_h264.mkv > > The above command will generate a mkv format file as following. > ------------------------------ > $ mediainfo from_matro_h264.mkv > General > Unique ID : 71489747204572974788463573681922212707 > (0x35C86CAB19E3C56A9A2ECB325EC18363) > Complete name : from_matro.h264 > Format : Matroska > Format version : Version 2 > Duration : 26mn 59s > Overall bit rate : 2 087 Kbps > Encoded date : UTC 2011-11-25 08:01:02 > ------------------------------ > > How to generate a pure AVC format file as following by using gst-launch > without Matroska container? > Which plug-in should I use? > ------------------------------ > $ mediainfo test_track1_jpn.h264 > General > Complete name : test_track1_jpn.h264 > Format : AVC > Format/Info : Advanced Video Codec > > Video > Format : AVC > Format/Info : Advanced Video Codec > Format profile : High@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 > ------------------------------ sorry I don't know nothing about avc > > I already try > # gst-launch-0.10 filesrc location=/home/test.mkv ! matroskademux ! > h264parse ! filesink location=use_h264parse.h264 > > It doesn't work. sure without a container no player (apart gst-launch with the right pipeline) will be able to play the generated file > ------------------------------ > $ mediainfo use_h264parse.h264 > General > Complete name : from_matro.h264 > File size : 402 MiB > ------------------------------ > > Expect for all your response. > > > > -- > 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-tp4103663p4106681.html > Sent from the GStreamer-devel mailing list archive at Nabble.com. > _______________________________________________ > gstreamer-devel mailing list > [hidden email] > http://lists.freedesktop.org/mailman/listinfo/gstreamer-devel > _______________________________________________ gstreamer-devel mailing list [hidden email] http://lists.freedesktop.org/mailman/listinfo/gstreamer-devel |
In reply to this post by Raymond18
On 25 November 2011 09:10, Raymond18 <[hidden email]> wrote:
> Thanks a lot. > > BUT.. > # gst-launch-0.10 filesrc location=/home/test.mkv ! matroskademux ! > h264parse ! matroskamux ! filesink location=from_matro_h264.mkv Try: gst-launch-0.10 filesrc location=/home/test.mkv ! matroskademux ! h264parse ! 'video/x-h264,stream-format=avc' ! filesink location=rawh264.h264 Regards, Rob _______________________________________________ gstreamer-devel mailing list [hidden email] http://lists.freedesktop.org/mailman/listinfo/gstreamer-devel |
No matter I try
# gst-launch-0.10 filesrc location=/home/test.mkv ! matroskademux ! h264parse ! 'video/x-h264,stream-format=avc' ! filesink location=rawh264.h264 or # gst-launch-0.10 filesrc location=/home/test.mkv ! matroskademux name=d d.video_00 ! 'video/x-h264,stream-format=avc' ! filesink location=rawh264.h264 It still doesn't work, --------------------------------------- $ mediainfo rawh264.h264 General Complete name : rawh264.h264 File size : 402 MiB $ --------------------------------------- |
Il 25/11/2011 10:48, Raymond18 ha scritto:
> No matter I try > > # gst-launch-0.10 filesrc location=/home/test.mkv ! matroskademux ! > h264parse ! 'video/x-h264,stream-format=avc' ! filesink > location=rawh264.h264 > > or > > # gst-launch-0.10 filesrc location=/home/test.mkv ! matroskademux name=d > d.video_00 ! > 'video/x-h264,stream-format=avc' ! filesink location=rawh264.h264 > > It still doesn't work, as pointed you need a muxer to make mediainfo recognize the video > > --------------------------------------- > $ mediainfo rawh264.h264 > General > Complete name : rawh264.h264 > File size : 402 MiB > > $ > --------------------------------------- > > -- > 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-tp4103663p4106842.html > Sent from the GStreamer-devel mailing list archive at Nabble.com. > _______________________________________________ > gstreamer-devel mailing list > [hidden email] > http://lists.freedesktop.org/mailman/listinfo/gstreamer-devel > _______________________________________________ gstreamer-devel mailing list [hidden email] http://lists.freedesktop.org/mailman/listinfo/gstreamer-devel |
In reply to this post by Raymond18
How are you testing if the .h264 is a valid file or not?
If you need to play it using ffplay or gstreamer you will have to wrap it in a container. To play h264 file You will neet bitstream players like elecard. On 11/25/2011 05:48 PM, Raymond18 wrote: > No matter I try > > # gst-launch-0.10 filesrc location=/home/test.mkv ! matroskademux ! > h264parse ! 'video/x-h264,stream-format=avc' ! filesink > location=rawh264.h264 > > or > > # gst-launch-0.10 filesrc location=/home/test.mkv ! matroskademux name=d > d.video_00 ! > 'video/x-h264,stream-format=avc' ! filesink location=rawh264.h264 > > It still doesn't work, > > --------------------------------------- > $ mediainfo rawh264.h264 > General > Complete name : rawh264.h264 > File size : 402 MiB > > $ > --------------------------------------- > > -- > 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-tp4103663p4106842.html > Sent from the GStreamer-devel mailing list archive at Nabble.com. > _______________________________________________ > gstreamer-devel mailing list > [hidden email] > http://lists.freedesktop.org/mailman/listinfo/gstreamer-devel > _______________________________________________ gstreamer-devel mailing list [hidden email] http://lists.freedesktop.org/mailman/listinfo/gstreamer-devel |
In reply to this post by Robert Swain-2
On Fri, 2011-11-25 at 10:08 +0100, Rob wrote:
> > BUT.. > > # gst-launch-0.10 filesrc location=/home/test.mkv ! matroskademux ! > > h264parse ! matroskamux ! filesink location=from_matro_h264.mkv > > Try: > > gst-launch-0.10 filesrc location=/home/test.mkv ! matroskademux ! > h264parse ! 'video/x-h264,stream-format=avc' ! filesink > location=rawh264.h264 Try 'video/x-h264,stream-format=byte-stream' instead. That should create a file with H.264 data that can be read without a container. gst-typefind-0.10 foo.h264 should be able to recognise it then as well. Cheers -Tim _______________________________________________ gstreamer-devel mailing list [hidden email] http://lists.freedesktop.org/mailman/listinfo/gstreamer-devel |
In reply to this post by Deepika
To "Mailing List SVR" & "Deepika",
After using gst-launch-0.10 to generate a from_matro.h264 file, I use the "mediainfo" tool to verify that file, it should show the format of file. And VLC player also can play the h264 file that I extract from original mkv file by using "mkvextract" of mkvtoolnix-4.5.0-1 tool. Or I use following command to verify it and it works. # gst-launch-0.10 filesrc location=./test_track1_jpn.h264 ! h264parse ! ffdec_h264 ! autovideosink Or.....Can anyone tell me what container does the following file use? --------------------------------------- $ mediainfo test_track1_jpn.h264 General Complete name : 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@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 --------------------------------------- |
In reply to this post by Tim-Philipp Müller-2
To TIm,
According to your describing, The following command should create a file with H.264 data that can be read without a container. But something wrong after executing. Do I use a wrong pipeline? ------------------------------------------ $ gst-launch-0.10 filesrc location=/home/test.mkv ! matroskademux ! h264parse ! 'video/x-h264,stream-format=byte-stream' ! filesink location=from_matro.h264 Setting pipeline to PAUSED ... Pipeline is PREROLLING ... ERROR: from element /GstPipeline:pipeline0/GstMatroskaDemux:matroskademux0: GStreamer encountered a general stream error. Additional debug info: matroska-demux.c(6090): gst_matroska_demux_loop (): /GstPipeline:pipeline0/GstMatroskaDemux:matroskademux0: stream stopped, reason not-negotiated ERROR: pipeline doesn't want to preroll. Setting pipeline to NULL ... Freeing pipeline ... ----------------------------------------- |
On Fri, 2011-11-25 at 03:59 -0800, Raymond18 wrote:
Hi, > According to your describing, The following command should create a file > with H.264 data that can be read without a container. But something wrong > after executing. Do I use a wrong pipeline? > > ------------------------------------------ > $ gst-launch-0.10 filesrc location=/home/test.mkv ! matroskademux ! > h264parse ! 'video/x-h264,stream-format=byte-stream' ! filesink > location=from_matro.h264 > > ERROR: from element /GstPipeline:pipeline0/GstMatroskaDemux:matroskademux0: > GStreamer encountered a general stream error. > Additional debug info: > matroska-demux.c(6090): gst_matroska_demux_loop (): > /GstPipeline:pipeline0/GstMatroskaDemux:matroskademux0: > stream stopped, reason not-negotiated it depends a bit on the version of the plugins you're using. The above works fine for me with git, but the h264parsers have gone through some changes over time. With older versions you might have to set the output format via a property (instead of forcing it via the caps), try these: .. ! matroskademux ! h264parse output-format=byte ! filesink ... or .. ! matroskademux ! legacyh264parse output-format=byte ! filesink ... Cheers -Tim _______________________________________________ gstreamer-devel mailing list [hidden email] http://lists.freedesktop.org/mailman/listinfo/gstreamer-devel |
Free forum by Nabble | Edit this page |