MPEG-2 TS Muxing

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

MPEG-2 TS Muxing

Peter Maersk-Moller
Hi

Trying to see if I can get gstreamer to encode a a/v source into a
H.264/aac MPEG-2 TS stream. A/V encoding seems to work well, but the TS
encoding part seems not to be supported.

I'm looking into copy some code from VLC to create a TS mux plugin, but
would like to ask first,  if anyone else is working on something like
that ? As I see it, we need to convert the two ES streams into to PES
packet stream into a TS packet stream, which then could use either a UDP
output plugin, a http server plugin (when finished) or a RTSP server
plugin (if planned). So ES in PES in TS is needed. ES in PES in TS in
RTP seems not to be widely used, so thsi is skipped.

However, we would also need to create PAT and PMT to make the stream
useful for many applications (such as Set Top Boxes not quite as clever
as Mplayer).

Best regards

Peter Maersk-Moller

-------------------------------------------------------------------------
This SF.net email is sponsored by: Microsoft
Defy all challenges. Microsoft(R) Visual Studio 2008.
http://clk.atdmt.com/MRT/go/vse0120000070mrt/direct/01/
_______________________________________________
gstreamer-devel mailing list
[hidden email]
https://lists.sourceforge.net/lists/listinfo/gstreamer-devel
Reply | Threaded
Open this post in threaded view
|

Re: MPEG-2 TS Muxing

Julien Moutte-2

Fluendo has a MPEG TS muxer. We recently introduced support M2TS 192.

https://core.fluendo.com/gstreamer/svn/trunk/gst-fluendo-mpegmux/

Best regards,

Julien Moutte,
FLUENDO S.A.

Peter Maersk-Moller wrote:

> Hi
>
> Trying to see if I can get gstreamer to encode a a/v source into a
> H.264/aac MPEG-2 TS stream. A/V encoding seems to work well, but the TS
> encoding part seems not to be supported.
>
> I'm looking into copy some code from VLC to create a TS mux plugin, but
> would like to ask first,  if anyone else is working on something like
> that ? As I see it, we need to convert the two ES streams into to PES
> packet stream into a TS packet stream, which then could use either a UDP
> output plugin, a http server plugin (when finished) or a RTSP server
> plugin (if planned). So ES in PES in TS is needed. ES in PES in TS in
> RTP seems not to be widely used, so thsi is skipped.
>
> However, we would also need to create PAT and PMT to make the stream
> useful for many applications (such as Set Top Boxes not quite as clever
> as Mplayer).
>
> Best regards
>
> Peter Maersk-Moller
>
> -------------------------------------------------------------------------
> This SF.net email is sponsored by: Microsoft
> Defy all challenges. Microsoft(R) Visual Studio 2008.
> http://clk.atdmt.com/MRT/go/vse0120000070mrt/direct/01/
> _______________________________________________
> gstreamer-devel mailing list
> [hidden email]
> https://lists.sourceforge.net/lists/listinfo/gstreamer-devel

-------------------------------------------------------------------------
This SF.net email is sponsored by: Microsoft
Defy all challenges. Microsoft(R) Visual Studio 2008.
http://clk.atdmt.com/MRT/go/vse0120000070mrt/direct/01/
_______________________________________________
gstreamer-devel mailing list
[hidden email]
https://lists.sourceforge.net/lists/listinfo/gstreamer-devel
Reply | Threaded
Open this post in threaded view
|

Re: MPEG-2 TS Muxing

Ramana_polaka

http://core.fluendo.com/gstreamer/src/gst-fluendo-mpegmux/


-----Original Message-----
From: [hidden email] [mailto:[hidden email]] On Behalf Of Julien Moutte
Sent: Tuesday, May 27, 2008 5:32 PM
To: Peter Maersk-Moller
Cc: [hidden email]
Subject: Re: [gst-devel] MPEG-2 TS Muxing


Fluendo has a MPEG TS muxer. We recently introduced support M2TS 192.

https://core.fluendo.com/gstreamer/svn/trunk/gst-fluendo-mpegmux/

Best regards,

Julien Moutte,
FLUENDO S.A.

Peter Maersk-Moller wrote:

> Hi
>
> Trying to see if I can get gstreamer to encode a a/v source into a
> H.264/aac MPEG-2 TS stream. A/V encoding seems to work well, but the TS
> encoding part seems not to be supported.
>
> I'm looking into copy some code from VLC to create a TS mux plugin, but
> would like to ask first,  if anyone else is working on something like
> that ? As I see it, we need to convert the two ES streams into to PES
> packet stream into a TS packet stream, which then could use either a UDP
> output plugin, a http server plugin (when finished) or a RTSP server
> plugin (if planned). So ES in PES in TS is needed. ES in PES in TS in
> RTP seems not to be widely used, so thsi is skipped.
>
> However, we would also need to create PAT and PMT to make the stream
> useful for many applications (such as Set Top Boxes not quite as clever
> as Mplayer).
>
> Best regards
>
> Peter Maersk-Moller
>
> -------------------------------------------------------------------------
> This SF.net email is sponsored by: Microsoft
> Defy all challenges. Microsoft(R) Visual Studio 2008.
> http://clk.atdmt.com/MRT/go/vse0120000070mrt/direct/01/
> _______________________________________________
> gstreamer-devel mailing list
> [hidden email]
> https://lists.sourceforge.net/lists/listinfo/gstreamer-devel

-------------------------------------------------------------------------
This SF.net email is sponsored by: Microsoft
Defy all challenges. Microsoft(R) Visual Studio 2008.
http://clk.atdmt.com/MRT/go/vse0120000070mrt/direct/01/
_______________________________________________
gstreamer-devel mailing list
[hidden email]
https://lists.sourceforge.net/lists/listinfo/gstreamer-devel

**************** CAUTION - Disclaimer *****************
This e-mail contains PRIVILEGED AND CONFIDENTIAL INFORMATION intended solely
for the use of the addressee(s). If you are not the intended recipient, please
notify the sender by e-mail and delete the original message. Further, you are not
to copy, disclose, or distribute this e-mail or its contents to any other person and
any such actions are unlawful. This e-mail may contain viruses. Infosys has taken
every reasonable precaution to minimize this risk, but is not liable for any damage
you may sustain as a result of any virus in this e-mail. You should carry out your
own virus checks before opening the e-mail or attachment. Infosys reserves the
right to monitor and review the content of all messages sent to or from this e-mail
address. Messages sent to or from this e-mail address may be stored on the
Infosys e-mail system.
***INFOSYS******** End of Disclaimer ********INFOSYS***

-------------------------------------------------------------------------
This SF.net email is sponsored by: Microsoft
Defy all challenges. Microsoft(R) Visual Studio 2008.
http://clk.atdmt.com/MRT/go/vse0120000070mrt/direct/01/
_______________________________________________
gstreamer-devel mailing list
[hidden email]
https://lists.sourceforge.net/lists/listinfo/gstreamer-devel
Reply | Threaded
Open this post in threaded view
|

Re: MPEG-2 TS Muxing

Peter Maersk-Moller
Thanks to Ramana and Julien.

A couple of extra questions.

   a) Any progressed plans on supporting audio/mpeg mpegversion=4 ?
      (AAC-LC, HE-AAC/AACPLUS)

   b) Any progressed plans on supporting xvid/mpeg-4 part 2 ?

   c) Are there any examples of how to use it ?
      Is it muxed pretty much the same way the avimux works
http://gstreamer.freedesktop.org/data/doc/gstreamer/head/gst-plugins-good-plugins/html/gst-plugins-good-plugins-avimux.html

Something like

gst-launch-0.10 videotestsrc num-buffers=250 \
!
'video/x-raw-yuv,format=(fourcc)I420,width=320,height=240,framerate=(fraction)25/1'

\
! xvidenc ! queue ! mux. \
audiotestsrc num-buffers=440 ! audioconvert !
'audio/x-raw-int,rate=44100,channels=2' \
! lame ! queue ! mux. \
flutsmux name=mux ! filesink location=test.ts

Kind regards

P.


Ramana Reddy Polaka wrote:

> http://core.fluendo.com/gstreamer/src/gst-fluendo-mpegmux/
>
>
> -----Original Message-----
> From: [hidden email] [mailto:[hidden email]] On Behalf Of Julien Moutte
> Sent: Tuesday, May 27, 2008 5:32 PM
> To: Peter Maersk-Moller
> Cc: [hidden email]
> Subject: Re: [gst-devel] MPEG-2 TS Muxing
>
>
> Fluendo has a MPEG TS muxer. We recently introduced support M2TS 192.
>
> https://core.fluendo.com/gstreamer/svn/trunk/gst-fluendo-mpegmux/
>
> Best regards,
>
> Julien Moutte,
> FLUENDO S.A.



-------------------------------------------------------------------------
This SF.net email is sponsored by: Microsoft
Defy all challenges. Microsoft(R) Visual Studio 2008.
http://clk.atdmt.com/MRT/go/vse0120000070mrt/direct/01/
_______________________________________________
gstreamer-devel mailing list
[hidden email]
https://lists.sourceforge.net/lists/listinfo/gstreamer-devel
Reply | Threaded
Open this post in threaded view
|

Re: MPEG-2 TS Muxing

Peter Maersk-Moller
Hi Ramana.

Ramana Reddy Polaka wrote:
> Hi Peter,
> Today I tried to install Fluendo MPEG2 TS muxer. I got the following error.
> "checking for TSMUX... configure: error: you need tsmux development packages installed ! "
> Where is the tsmux library? From "README", I have got link. But that is not installable file.  Can you send me to download tsmux library installable?

The libtsmux can be found at
http://sourceforge.net/project/showfiles.php?group_id=155255

Regards
Peter

-------------------------------------------------------------------------
This SF.net email is sponsored by: Microsoft
Defy all challenges. Microsoft(R) Visual Studio 2008.
http://clk.atdmt.com/MRT/go/vse0120000070mrt/direct/01/
_______________________________________________
gstreamer-devel mailing list
[hidden email]
https://lists.sourceforge.net/lists/listinfo/gstreamer-devel
Reply | Threaded
Open this post in threaded view
|

Re: MPEG-2 TS Muxing

Peter Maersk-Moller
In reply to this post by Julien Moutte-2
Just a little remark for others wanting to test or hack. This command
will get you the lot.

   svn co https://core.fluendo.com/gstreamer/svn/trunk

Thanks

Peter Maersk-Moller

Julien Moutte wrote:

> Fluendo has a MPEG TS muxer. We recently introduced support M2TS 192.
> https://core.fluendo.com/gstreamer/svn/trunk/gst-fluendo-mpegmux/
>
> Best regards,
>
> Julien Moutte,
> FLUENDO S.A.
>
> Peter Maersk-Moller wrote:
>> Hi
>>
>> Trying to see if I can get gstreamer to encode a a/v source into a
>> H.264/aac MPEG-2 TS stream. A/V encoding seems to work well, but the TS
>> encoding part seems not to be supported.
>>
>> I'm looking into copy some code from VLC to create a TS mux plugin, but
>> would like to ask first,  if anyone else is working on something like
>> that ? As I see it, we need to convert the two ES streams into to PES
>> packet stream into a TS packet stream, which then could use either a UDP
>> output plugin, a http server plugin (when finished) or a RTSP server
>> plugin (if planned). So ES in PES in TS is needed. ES in PES in TS in
>> RTP seems not to be widely used, so thsi is skipped.
>>
>> However, we would also need to create PAT and PMT to make the stream
>> useful for many applications (such as Set Top Boxes not quite as clever
>> as Mplayer).
>>
>> Best regards
>>
>> Peter Maersk-Moller
>>
>> -------------------------------------------------------------------------
>> This SF.net email is sponsored by: Microsoft
>> Defy all challenges. Microsoft(R) Visual Studio 2008.
>> http://clk.atdmt.com/MRT/go/vse0120000070mrt/direct/01/
>> _______________________________________________
>> gstreamer-devel mailing list
>> [hidden email]
>> https://lists.sourceforge.net/lists/listinfo/gstreamer-devel


-------------------------------------------------------------------------
This SF.net email is sponsored by: Microsoft
Defy all challenges. Microsoft(R) Visual Studio 2008.
http://clk.atdmt.com/MRT/go/vse0120000070mrt/direct/01/
_______________________________________________
gstreamer-devel mailing list
[hidden email]
https://lists.sourceforge.net/lists/listinfo/gstreamer-devel
Reply | Threaded
Open this post in threaded view
|

Re: MPEG-2 TS Muxing

kshitij gupta
Hi,
   I am trying a similar gst pipeline to transcode a file in mp2ts file format with h264 and aac as codecs. Using the following pipeline

gst-launch -v filesrc location=/home/kgupta/testflv/limca.flv ! decodebin name=d ! queue ! videorate ! ffmpegcolorspace ! videoscale ! video/x-raw-yuv,height=144,width=176,framerate=\(fraction\)15/1 ! ffenc_h264 ! flutsmux name=mux ! filesink location=limca_aac_h264_faacadts.ts d. ! queue ! audioconvert ! audioresample ! audio/x-raw-int, endianness=1234, signed=\(boolean\)true, width=\(int\)16, depth=\(int\)16, rate=\(int\)16000,channels=\(int\)1 ! faac bitrate=16000 ! mux.    

Now I am trying to play this file with vlc.  The video plays good but no audio.  Are there some obvious mistakes in my approach ??

I am using the following versions
gst-fluendo-mpegmux-0.10.4
libtsmux-0.3.0

Thanx
Kshitij


Peter Maersk-Moller wrote
Just a little remark for others wanting to test or hack. This command
will get you the lot.

   svn co https://core.fluendo.com/gstreamer/svn/trunk

Thanks

Peter Maersk-Moller

Julien Moutte wrote:
> Fluendo has a MPEG TS muxer. We recently introduced support M2TS 192.
> https://core.fluendo.com/gstreamer/svn/trunk/gst-fluendo-mpegmux/
>
> Best regards,
>
> Julien Moutte,
> FLUENDO S.A.
>
> Peter Maersk-Moller wrote:
>> Hi
>>
>> Trying to see if I can get gstreamer to encode a a/v source into a
>> H.264/aac MPEG-2 TS stream. A/V encoding seems to work well, but the TS
>> encoding part seems not to be supported.
>>
>> I'm looking into copy some code from VLC to create a TS mux plugin, but
>> would like to ask first,  if anyone else is working on something like
>> that ? As I see it, we need to convert the two ES streams into to PES
>> packet stream into a TS packet stream, which then could use either a UDP
>> output plugin, a http server plugin (when finished) or a RTSP server
>> plugin (if planned). So ES in PES in TS is needed. ES in PES in TS in
>> RTP seems not to be widely used, so thsi is skipped.
>>
>> However, we would also need to create PAT and PMT to make the stream
>> useful for many applications (such as Set Top Boxes not quite as clever
>> as Mplayer).
>>
>> Best regards
>>
>> Peter Maersk-Moller
>>
>> -------------------------------------------------------------------------
>> This SF.net email is sponsored by: Microsoft
>> Defy all challenges. Microsoft(R) Visual Studio 2008.
>> http://clk.atdmt.com/MRT/go/vse0120000070mrt/direct/01/
>> _______________________________________________
>> gstreamer-devel mailing list
>> gstreamer-devel@lists.sourceforge.net
>> https://lists.sourceforge.net/lists/listinfo/gstreamer-devel


-------------------------------------------------------------------------
This SF.net email is sponsored by: Microsoft
Defy all challenges. Microsoft(R) Visual Studio 2008.
http://clk.atdmt.com/MRT/go/vse0120000070mrt/direct/01/
_______________________________________________
gstreamer-devel mailing list
gstreamer-devel@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/gstreamer-devel
Reply | Threaded
Open this post in threaded view
|

Re: MPEG-2 TS Muxing

Kshitij Gupta-2
In reply to this post by Peter Maersk-Moller
Hi,
   I am trying a similar gst pipeline to transcode a file in mp2ts file format with h264 and aac as codecs. Using the following pipeline

gst-launch -v filesrc location=/home/kgupta/testflv/limca.flv ! decodebin name=d ! queue ! videorate ! ffmpegcolorspace ! videoscale ! video/x-raw-yuv,height=144,width=176,framerate=\(fraction\)15/1 ! ffenc_h264 ! flutsmux name=mux ! filesink location=limca_aac_h264_faacadts.ts d. ! queue ! audioconvert ! audioresample ! audio/x-raw-int, endianness=1234, signed=\(boolean\)true, width=\(int\)16, depth=\(int\)16, rate=\(int\)16000,channels=\(int\)1 ! faac bitrate=16000 ! mux.    

Now I am trying to play this file with vlc.  The video plays good but no audio.  Are there some obvious mistakes in my approach ??

I am using the following versions
gst-fluendo-mpegmux-0.10.4
libtsmux-0.3.0

Thanx
Kshitij

On Fri, May 30, 2008 at 2:34 PM, Peter Maersk-Moller <[hidden email]> wrote:
Just a little remark for others wanting to test or hack. This command
will get you the lot.

  svn co https://core.fluendo.com/gstreamer/svn/trunk

Thanks

Peter Maersk-Moller

Julien Moutte wrote:
> Fluendo has a MPEG TS muxer. We recently introduced support M2TS 192.
> https://core.fluendo.com/gstreamer/svn/trunk/gst-fluendo-mpegmux/
>
> Best regards,
>
> Julien Moutte,
> FLUENDO S.A.
>
> Peter Maersk-Moller wrote:
>> Hi
>>
>> Trying to see if I can get gstreamer to encode a a/v source into a
>> H.264/aac MPEG-2 TS stream. A/V encoding seems to work well, but the TS
>> encoding part seems not to be supported.
>>
>> I'm looking into copy some code from VLC to create a TS mux plugin, but
>> would like to ask first,  if anyone else is working on something like
>> that ? As I see it, we need to convert the two ES streams into to PES
>> packet stream into a TS packet stream, which then could use either a UDP
>> output plugin, a http server plugin (when finished) or a RTSP server
>> plugin (if planned). So ES in PES in TS is needed. ES in PES in TS in
>> RTP seems not to be widely used, so thsi is skipped.
>>
>> However, we would also need to create PAT and PMT to make the stream
>> useful for many applications (such as Set Top Boxes not quite as clever
>> as Mplayer).
>>
>> Best regards
>>
>> Peter Maersk-Moller
>>
>> -------------------------------------------------------------------------
>> This SF.net email is sponsored by: Microsoft
>> Defy all challenges. Microsoft(R) Visual Studio 2008.
>> http://clk.atdmt.com/MRT/go/vse0120000070mrt/direct/01/
>> _______________________________________________
>> gstreamer-devel mailing list
>> [hidden email]
>> https://lists.sourceforge.net/lists/listinfo/gstreamer-devel


-------------------------------------------------------------------------
This SF.net email is sponsored by: Microsoft
Defy all challenges. Microsoft(R) Visual Studio 2008.
http://clk.atdmt.com/MRT/go/vse0120000070mrt/direct/01/
_______________________________________________
gstreamer-devel mailing list
[hidden email]
https://lists.sourceforge.net/lists/listinfo/gstreamer-devel


-------------------------------------------------------------------------
This SF.Net email is sponsored by the Moblin Your Move Developer's challenge
Build the coolest Linux based applications with Moblin SDK & win great prizes
Grand prize is a trip for two to an Open Source event anywhere in the world
http://moblin-contest.org/redirect.php?banner_id=100&url=/
_______________________________________________
gstreamer-devel mailing list
[hidden email]
https://lists.sourceforge.net/lists/listinfo/gstreamer-devel
Reply | Threaded
Open this post in threaded view
|

Re: MPEG-2 TS Muxing

yangsb
This post was updated on .
I meet the same problem as you.
My pipeline is this :


gst-launch -v --gst-debug-level=$dbg \
        filesrc location=davincieffect_ntsc.264  \
        ! h264parse ! mux. \
        filesrc location=davincieffect.aac ! aacparse ! mux. \
        mpegtsmux name=mux \
        ! filesink location=out_264_for_6446.ts

When I played the ts file using mplayer, I get the following messages:


####################################################################
Playing /home/filesys/opt/gst_dm355/out_264_for_6446.ts.
TS file format detected.
VIDEO H264(pid=64) AUDIO AAC(pid=65) NO SUBS (yet)!  PROGRAM N. 1
FPS seems to be: 29.970030  
[VO_SDL] Using driver: x11.
==========================================================================
Opening video decoder: [ffmpeg] FFmpeg's libavcodec codec family
Selected video codec: [ffh264] vfm: ffmpeg (FFmpeg H.264)
==========================================================================
==========================================================================
Opening audio decoder: [faad] AAC (MPEG2/4 Advanced Audio Coding)
 
Too many video packets in the buffer: (1042 in 8399231 bytes).
Maybe you are playing a non-interleaved stream/file or the codec failed?
For AVI files, try to force non-interleaved mode with the -ni option.
FAAD: Failed to initialize the decoder!
ADecoder init failed :(
ADecoder init failed :(
Cannot find codec for audio format 0x4134504D.
Read DOCS/HTML/en/codecs.html!
Audio: no sound
Starting playback...
VDec: vo config request - 720 x 480 (preferred colorspace: Planar YV12)
VDec: using Planar YV12 as output csp (no 0)
Movie-Aspect is 1.50:1 - prescaling to correct movie aspect.
VO: [sdl] 720x480 => 720x480 Planar YV12

################################################################
Also , I tried the tsmuxer in gst-plugin-bad-0.10.9 ,but still no audio.
Hope to get some advice.
Thanks
Best regards.

Kshitij Gupta-2 wrote
Hi,
   I am trying a similar gst pipeline to transcode a file in mp2ts file
format with h264 and aac as codecs. Using the following pipeline

gst-launch -v filesrc location=/home/kgupta/testflv/limca.flv ! decodebin
name=d ! queue ! videorate ! ffmpegcolorspace ! videoscale !
video/x-raw-yuv,height=144,width=176,framerate=\(fraction\)15/1 ! ffenc_h264
! flutsmux name=mux ! filesink location=limca_aac_h264_faacadts.ts d. !
queue ! audioconvert ! audioresample ! audio/x-raw-int, endianness=1234,
signed=\(boolean\)true, width=\(int\)16, depth=\(int\)16,
rate=\(int\)16000,channels=\(int\)1 ! faac bitrate=16000 ! mux.

Now I am trying to play this file with vlc.  The video plays good but no
audio.  Are there some obvious mistakes in my approach ??

I am using the following versions
gst-fluendo-mpegmux-0.10.4
libtsmux-0.3.0

Thanx
Kshitij

On Fri, May 30, 2008 at 2:34 PM, Peter Maersk-Moller <
peter@maersk-moller.net> wrote:

> Just a little remark for others wanting to test or hack. This command
> will get you the lot.
>
>   svn co https://core.fluendo.com/gstreamer/svn/trunk
>
> Thanks
>
> Peter Maersk-Moller
>
> Julien Moutte wrote:
> > Fluendo has a MPEG TS muxer. We recently introduced support M2TS 192.
> > https://core.fluendo.com/gstreamer/svn/trunk/gst-fluendo-mpegmux/
> >
> > Best regards,
> >
> > Julien Moutte,
> > FLUENDO S.A.
> >
> > Peter Maersk-Moller wrote:
> >> Hi
> >>
> >> Trying to see if I can get gstreamer to encode a a/v source into a
> >> H.264/aac MPEG-2 TS stream. A/V encoding seems to work well, but the TS
> >> encoding part seems not to be supported.
> >>
> >> I'm looking into copy some code from VLC to create a TS mux plugin, but
> >> would like to ask first,  if anyone else is working on something like
> >> that ? As I see it, we need to convert the two ES streams into to PES
> >> packet stream into a TS packet stream, which then could use either a UDP
> >> output plugin, a http server plugin (when finished) or a RTSP server
> >> plugin (if planned). So ES in PES in TS is needed. ES in PES in TS in
> >> RTP seems not to be widely used, so thsi is skipped.
> >>
> >> However, we would also need to create PAT and PMT to make the stream
> >> useful for many applications (such as Set Top Boxes not quite as clever
> >> as Mplayer).
> >>
> >> Best regards
> >>
> >> Peter Maersk-Moller
> >>
> >>
> -------------------------------------------------------------------------
> >> This SF.net email is sponsored by: Microsoft
> >> Defy all challenges. Microsoft(R) Visual Studio 2008.
> >> http://clk.atdmt.com/MRT/go/vse0120000070mrt/direct/01/
> >> _______________________________________________
> >> gstreamer-devel mailing list
> >> gstreamer-devel@lists.sourceforge.net
> >> https://lists.sourceforge.net/lists/listinfo/gstreamer-devel
>
>
> -------------------------------------------------------------------------
> This SF.net email is sponsored by: Microsoft
> Defy all challenges. Microsoft(R) Visual Studio 2008.
> http://clk.atdmt.com/MRT/go/vse0120000070mrt/direct/01/
> _______________________________________________
> gstreamer-devel mailing list
> gstreamer-devel@lists.sourceforge.net
> https://lists.sourceforge.net/lists/listinfo/gstreamer-devel
>

-------------------------------------------------------------------------
This SF.Net email is sponsored by the Moblin Your Move Developer's challenge
Build the coolest Linux based applications with Moblin SDK & win great prizes
Grand prize is a trip for two to an Open Source event anywhere in the world
http://moblin-contest.org/redirect.php?banner_id=100&url=/
_______________________________________________
gstreamer-devel mailing list
gstreamer-devel@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/gstreamer-devel
Reply | Threaded
Open this post in threaded view
|

Re: MPEG-2 TS Muxing

Kshitij Gupta-2
Hi,
  I was able to solve the problem in the follwing way.  The aac
encoder must produce an adts output stream for this way to work,
1. Modify the mpegtsmux_aac.c to not insert adts header on it's own

GstBuffer * flutsmux_prepare_aac (GstBuffer * buf, FluTsPadData * data,
    FluTsMux * mux)
{
  //guint8 * adts_header = g_malloc0 (7);
  //GstBuffer * out_buf = gst_buffer_new_and_alloc (GST_BUFFER_SIZE (buf) + 7);
  GstBuffer * out_buf = gst_buffer_new_and_alloc (GST_BUFFER_SIZE (buf));
  gsize out_offset = 0;
  guint8 rate_idx = 0, channels = 0, obj_type = 0;

  GST_DEBUG_OBJECT (mux, "Preparing AAC buffer for output");

  /* We want the same metadata */
  gst_buffer_copy_metadata (out_buf, buf, GST_BUFFER_COPY_ALL);

#if 0
  /* Generate ADTS header */
  obj_type = (GST_READ_UINT8 (GST_BUFFER_DATA (data->codec_data)) & 0xC) >> 2;
  obj_type++;
  rate_idx = (GST_READ_UINT8 (GST_BUFFER_DATA (data->codec_data)) & 0x3) << 1;
  rate_idx |=
      (GST_READ_UINT8 (GST_BUFFER_DATA (data->codec_data) + 1) & 0x80) >> 7;
  channels =
      (GST_READ_UINT8 (GST_BUFFER_DATA (data->codec_data) + 1) & 0x78) >> 3;
  GST_DEBUG_OBJECT (mux, "Rate index %u, channels %u, object type %u", rate_idx,
      channels, obj_type);
  /* Sync point over a full byte */
  adts_header[0] = 0xFF;
  /* Sync point continued over first 4 bits + static 4 bits
   * (ID, layer, protection)*/
  adts_header[1] = 0xF1;
  /* Object type over first 2 bits */
  adts_header[2] = obj_type << 6;
  /* rate index over next 4 bits */
  adts_header[2] |= (rate_idx << 2);
  /* channels over last 2 bits */
  adts_header[2] |= (channels & 0x4) >> 2;
  /* channels continued over next 2 bits + 4 bits at zero */
  adts_header[3] = (channels & 0x3) << 6;
  /* frame size over last 2 bits */
  adts_header[3] |= (GST_BUFFER_SIZE (out_buf) & 0x1800) >> 11;
  /* frame size continued over full byte */
  adts_header[4] = (GST_BUFFER_SIZE (out_buf) & 0x1FF8) >> 3;
  /* frame size continued first 3 bits */
  adts_header[5] = (GST_BUFFER_SIZE (out_buf) & 0x7) << 5;
  /* buffer fullness (0x7FF for VBR) over 5 last bits*/
  adts_header[5] |= 0x1F;
  /* buffer fullness (0x7FF for VBR) continued over 6 first bits + 2 zeros for
   * number of raw data blocks */
  adts_header[6] = 0xFC;
  /* Insert ADTS header */
  memcpy (GST_BUFFER_DATA (out_buf) + out_offset, adts_header, 7);
  g_free (adts_header);
  out_offset += 7;
#endif

  /* Now copy complete frame */
  //memcpy (GST_BUFFER_DATA (out_buf) + out_offset, GST_BUFFER_DATA
(buf), GST_BUFFER_SIZE (buf));
  memcpy (GST_BUFFER_DATA (out_buf) , GST_BUFFER_DATA (buf),
GST_BUFFER_SIZE (buf));

  return out_buf;
}

The above code snippet is from flumpegtsmux_aac.c which is exactly
same as  mpegtsmux_aac.c except the variable names etc.

regards
Kshitij

On Fri, Mar 20, 2009 at 8:54 AM, yangsb <[hidden email]> wrote:

>
> I meet the same problem as you.
> Also , I tried the tsmuxer in gst-plugin-bad-0.10.9 ,but still no audio.
> Hope to get some advice.
> Thanks
> Best regards.
>
>
> Kshitij Gupta-2 wrote:
>>
>> Hi,
>>    I am trying a similar gst pipeline to transcode a file in mp2ts file
>> format with h264 and aac as codecs. Using the following pipeline
>>
>> gst-launch -v filesrc location=/home/kgupta/testflv/limca.flv ! decodebin
>> name=d ! queue ! videorate ! ffmpegcolorspace ! videoscale !
>> video/x-raw-yuv,height=144,width=176,framerate=\(fraction\)15/1 !
>> ffenc_h264
>> ! flutsmux name=mux ! filesink location=limca_aac_h264_faacadts.ts d. !
>> queue ! audioconvert ! audioresample ! audio/x-raw-int, endianness=1234,
>> signed=\(boolean\)true, width=\(int\)16, depth=\(int\)16,
>> rate=\(int\)16000,channels=\(int\)1 ! faac bitrate=16000 ! mux.
>>
>> Now I am trying to play this file with vlc.  The video plays good but no
>> audio.  Are there some obvious mistakes in my approach ??
>>
>> I am using the following versions
>> gst-fluendo-mpegmux-0.10.4
>> libtsmux-0.3.0
>>
>> Thanx
>> Kshitij
>>
>> On Fri, May 30, 2008 at 2:34 PM, Peter Maersk-Moller <
>> [hidden email]> wrote:
>>
>>> Just a little remark for others wanting to test or hack. This command
>>> will get you the lot.
>>>
>>>   svn co https://core.fluendo.com/gstreamer/svn/trunk
>>>
>>> Thanks
>>>
>>> Peter Maersk-Moller
>>>
>>> Julien Moutte wrote:
>>> > Fluendo has a MPEG TS muxer. We recently introduced support M2TS 192.
>>> > https://core.fluendo.com/gstreamer/svn/trunk/gst-fluendo-mpegmux/
>>> >
>>> > Best regards,
>>> >
>>> > Julien Moutte,
>>> > FLUENDO S.A.
>>> >
>>> > Peter Maersk-Moller wrote:
>>> >> Hi
>>> >>
>>> >> Trying to see if I can get gstreamer to encode a a/v source into a
>>> >> H.264/aac MPEG-2 TS stream. A/V encoding seems to work well, but the
>>> TS
>>> >> encoding part seems not to be supported.
>>> >>
>>> >> I'm looking into copy some code from VLC to create a TS mux plugin,
>>> but
>>> >> would like to ask first,  if anyone else is working on something like
>>> >> that ? As I see it, we need to convert the two ES streams into to PES
>>> >> packet stream into a TS packet stream, which then could use either a
>>> UDP
>>> >> output plugin, a http server plugin (when finished) or a RTSP server
>>> >> plugin (if planned). So ES in PES in TS is needed. ES in PES in TS in
>>> >> RTP seems not to be widely used, so thsi is skipped.
>>> >>
>>> >> However, we would also need to create PAT and PMT to make the stream
>>> >> useful for many applications (such as Set Top Boxes not quite as
>>> clever
>>> >> as Mplayer).
>>> >>
>>> >> Best regards
>>> >>
>>> >> Peter Maersk-Moller
>>> >>
>>> >>
>>> -------------------------------------------------------------------------
>>> >> This SF.net email is sponsored by: Microsoft
>>> >> Defy all challenges. Microsoft(R) Visual Studio 2008.
>>> >> http://clk.atdmt.com/MRT/go/vse0120000070mrt/direct/01/
>>> >> _______________________________________________
>>> >> gstreamer-devel mailing list
>>> >> [hidden email]
>>> >> https://lists.sourceforge.net/lists/listinfo/gstreamer-devel
>>>
>>>
>>> -------------------------------------------------------------------------
>>> This SF.net email is sponsored by: Microsoft
>>> Defy all challenges. Microsoft(R) Visual Studio 2008.
>>> http://clk.atdmt.com/MRT/go/vse0120000070mrt/direct/01/
>>> _______________________________________________
>>> gstreamer-devel mailing list
>>> [hidden email]
>>> https://lists.sourceforge.net/lists/listinfo/gstreamer-devel
>>>
>>
>> -------------------------------------------------------------------------
>> This SF.Net email is sponsored by the Moblin Your Move Developer's
>> challenge
>> Build the coolest Linux based applications with Moblin SDK & win great
>> prizes
>> Grand prize is a trip for two to an Open Source event anywhere in the
>> world
>> http://moblin-contest.org/redirect.php?banner_id=100&url=/
>> _______________________________________________
>> gstreamer-devel mailing list
>> [hidden email]
>> https://lists.sourceforge.net/lists/listinfo/gstreamer-devel
>>
>>
>
> --
> View this message in context: http://www.nabble.com/MPEG-2-TS-Muxing-tp17485498p22613710.html
> Sent from the GStreamer-devel mailing list archive at Nabble.com.
>
>
> ------------------------------------------------------------------------------
> Apps built with the Adobe(R) Flex(R) framework and Flex Builder(TM) are
> powering Web 2.0 with engaging, cross-platform capabilities. Quickly and
> easily build your RIAs with Flex Builder, the Eclipse(TM)based development
> software that enables intelligent coding and step-through debugging.
> Download the free 60 day trial. http://p.sf.net/sfu/www-adobe-com
> _______________________________________________
> gstreamer-devel mailing list
> [hidden email]
> https://lists.sourceforge.net/lists/listinfo/gstreamer-devel
>

------------------------------------------------------------------------------
_______________________________________________
gstreamer-devel mailing list
[hidden email]
https://lists.sourceforge.net/lists/listinfo/gstreamer-devel
Reply | Threaded
Open this post in threaded view
|

Re: MPEG-2 TS Muxing

Julien Moutte-2

Hi,

flutsmux is running the prepare_aac function only if the incoming AAC
data is RAW AAC with an AudioSpecificConfig buffer set on the caps as
codec_data.

So if your faac encoder generates raw AAC with a codec data this
function will be called. If it generates AAC with ADTS headers it won't
be called.

This muxer works just fine and we are using it in various environments.

I think you need to investigate the AAC encoder to see what it generates
exactly.

Best regards,

Julien Moutte,
FLUENDO S.A.

Kshitij Gupta wrote:

> Hi,
>   I was able to solve the problem in the follwing way.  The aac
> encoder must produce an adts output stream for this way to work,
> 1. Modify the mpegtsmux_aac.c to not insert adts header on it's own
>
> GstBuffer * flutsmux_prepare_aac (GstBuffer * buf, FluTsPadData * data,
>     FluTsMux * mux)
> {
>   //guint8 * adts_header = g_malloc0 (7);
>   //GstBuffer * out_buf = gst_buffer_new_and_alloc (GST_BUFFER_SIZE (buf) + 7);
>   GstBuffer * out_buf = gst_buffer_new_and_alloc (GST_BUFFER_SIZE (buf));
>   gsize out_offset = 0;
>   guint8 rate_idx = 0, channels = 0, obj_type = 0;
>
>   GST_DEBUG_OBJECT (mux, "Preparing AAC buffer for output");
>
>   /* We want the same metadata */
>   gst_buffer_copy_metadata (out_buf, buf, GST_BUFFER_COPY_ALL);
>
> #if 0
>   /* Generate ADTS header */
>   obj_type = (GST_READ_UINT8 (GST_BUFFER_DATA (data->codec_data)) & 0xC) >> 2;
>   obj_type++;
>   rate_idx = (GST_READ_UINT8 (GST_BUFFER_DATA (data->codec_data)) & 0x3) << 1;
>   rate_idx |=
>       (GST_READ_UINT8 (GST_BUFFER_DATA (data->codec_data) + 1) & 0x80) >> 7;
>   channels =
>       (GST_READ_UINT8 (GST_BUFFER_DATA (data->codec_data) + 1) & 0x78) >> 3;
>   GST_DEBUG_OBJECT (mux, "Rate index %u, channels %u, object type %u", rate_idx,
>       channels, obj_type);
>   /* Sync point over a full byte */
>   adts_header[0] = 0xFF;
>   /* Sync point continued over first 4 bits + static 4 bits
>    * (ID, layer, protection)*/
>   adts_header[1] = 0xF1;
>   /* Object type over first 2 bits */
>   adts_header[2] = obj_type << 6;
>   /* rate index over next 4 bits */
>   adts_header[2] |= (rate_idx << 2);
>   /* channels over last 2 bits */
>   adts_header[2] |= (channels & 0x4) >> 2;
>   /* channels continued over next 2 bits + 4 bits at zero */
>   adts_header[3] = (channels & 0x3) << 6;
>   /* frame size over last 2 bits */
>   adts_header[3] |= (GST_BUFFER_SIZE (out_buf) & 0x1800) >> 11;
>   /* frame size continued over full byte */
>   adts_header[4] = (GST_BUFFER_SIZE (out_buf) & 0x1FF8) >> 3;
>   /* frame size continued first 3 bits */
>   adts_header[5] = (GST_BUFFER_SIZE (out_buf) & 0x7) << 5;
>   /* buffer fullness (0x7FF for VBR) over 5 last bits*/
>   adts_header[5] |= 0x1F;
>   /* buffer fullness (0x7FF for VBR) continued over 6 first bits + 2 zeros for
>    * number of raw data blocks */
>   adts_header[6] = 0xFC;
>   /* Insert ADTS header */
>   memcpy (GST_BUFFER_DATA (out_buf) + out_offset, adts_header, 7);
>   g_free (adts_header);
>   out_offset += 7;
> #endif
>
>   /* Now copy complete frame */
>   //memcpy (GST_BUFFER_DATA (out_buf) + out_offset, GST_BUFFER_DATA
> (buf), GST_BUFFER_SIZE (buf));
>   memcpy (GST_BUFFER_DATA (out_buf) , GST_BUFFER_DATA (buf),
> GST_BUFFER_SIZE (buf));
>
>   return out_buf;
> }
>
> The above code snippet is from flumpegtsmux_aac.c which is exactly
> same as  mpegtsmux_aac.c except the variable names etc.
>
> regards
> Kshitij
>
> On Fri, Mar 20, 2009 at 8:54 AM, yangsb <[hidden email]> wrote:
>> I meet the same problem as you.
>> Also , I tried the tsmuxer in gst-plugin-bad-0.10.9 ,but still no audio.
>> Hope to get some advice.
>> Thanks
>> Best regards.
>>
>>
>> Kshitij Gupta-2 wrote:
>>> Hi,
>>>    I am trying a similar gst pipeline to transcode a file in mp2ts file
>>> format with h264 and aac as codecs. Using the following pipeline
>>>
>>> gst-launch -v filesrc location=/home/kgupta/testflv/limca.flv ! decodebin
>>> name=d ! queue ! videorate ! ffmpegcolorspace ! videoscale !
>>> video/x-raw-yuv,height=144,width=176,framerate=\(fraction\)15/1 !
>>> ffenc_h264
>>> ! flutsmux name=mux ! filesink location=limca_aac_h264_faacadts.ts d. !
>>> queue ! audioconvert ! audioresample ! audio/x-raw-int, endianness=1234,
>>> signed=\(boolean\)true, width=\(int\)16, depth=\(int\)16,
>>> rate=\(int\)16000,channels=\(int\)1 ! faac bitrate=16000 ! mux.
>>>
>>> Now I am trying to play this file with vlc.  The video plays good but no
>>> audio.  Are there some obvious mistakes in my approach ??
>>>
>>> I am using the following versions
>>> gst-fluendo-mpegmux-0.10.4
>>> libtsmux-0.3.0
>>>
>>> Thanx
>>> Kshitij
>>>
>>> On Fri, May 30, 2008 at 2:34 PM, Peter Maersk-Moller <
>>> [hidden email]> wrote:
>>>
>>>> Just a little remark for others wanting to test or hack. This command
>>>> will get you the lot.
>>>>
>>>>   svn co https://core.fluendo.com/gstreamer/svn/trunk
>>>>
>>>> Thanks
>>>>
>>>> Peter Maersk-Moller
>>>>
>>>> Julien Moutte wrote:
>>>>> Fluendo has a MPEG TS muxer. We recently introduced support M2TS 192.
>>>>> https://core.fluendo.com/gstreamer/svn/trunk/gst-fluendo-mpegmux/
>>>>>
>>>>> Best regards,
>>>>>
>>>>> Julien Moutte,
>>>>> FLUENDO S.A.
>>>>>
>>>>> Peter Maersk-Moller wrote:
>>>>>> Hi
>>>>>>
>>>>>> Trying to see if I can get gstreamer to encode a a/v source into a
>>>>>> H.264/aac MPEG-2 TS stream. A/V encoding seems to work well, but the
>>>> TS
>>>>>> encoding part seems not to be supported.
>>>>>>
>>>>>> I'm looking into copy some code from VLC to create a TS mux plugin,
>>>> but
>>>>>> would like to ask first,  if anyone else is working on something like
>>>>>> that ? As I see it, we need to convert the two ES streams into to PES
>>>>>> packet stream into a TS packet stream, which then could use either a
>>>> UDP
>>>>>> output plugin, a http server plugin (when finished) or a RTSP server
>>>>>> plugin (if planned). So ES in PES in TS is needed. ES in PES in TS in
>>>>>> RTP seems not to be widely used, so thsi is skipped.
>>>>>>
>>>>>> However, we would also need to create PAT and PMT to make the stream
>>>>>> useful for many applications (such as Set Top Boxes not quite as
>>>> clever
>>>>>> as Mplayer).
>>>>>>
>>>>>> Best regards
>>>>>>
>>>>>> Peter Maersk-Moller
>>>>>>
>>>>>>
>>>> -------------------------------------------------------------------------
>>>>>> This SF.net email is sponsored by: Microsoft
>>>>>> Defy all challenges. Microsoft(R) Visual Studio 2008.
>>>>>> http://clk.atdmt.com/MRT/go/vse0120000070mrt/direct/01/
>>>>>> _______________________________________________
>>>>>> gstreamer-devel mailing list
>>>>>> [hidden email]
>>>>>> https://lists.sourceforge.net/lists/listinfo/gstreamer-devel
>>>>
>>>> -------------------------------------------------------------------------
>>>> This SF.net email is sponsored by: Microsoft
>>>> Defy all challenges. Microsoft(R) Visual Studio 2008.
>>>> http://clk.atdmt.com/MRT/go/vse0120000070mrt/direct/01/
>>>> _______________________________________________
>>>> gstreamer-devel mailing list
>>>> [hidden email]
>>>> https://lists.sourceforge.net/lists/listinfo/gstreamer-devel
>>>>
>>> -------------------------------------------------------------------------
>>> This SF.Net email is sponsored by the Moblin Your Move Developer's
>>> challenge
>>> Build the coolest Linux based applications with Moblin SDK & win great
>>> prizes
>>> Grand prize is a trip for two to an Open Source event anywhere in the
>>> world
>>> http://moblin-contest.org/redirect.php?banner_id=100&url=/
>>> _______________________________________________
>>> gstreamer-devel mailing list
>>> [hidden email]
>>> https://lists.sourceforge.net/lists/listinfo/gstreamer-devel
>>>
>>>
>> --
>> View this message in context: http://www.nabble.com/MPEG-2-TS-Muxing-tp17485498p22613710.html
>> Sent from the GStreamer-devel mailing list archive at Nabble.com.
>>
>>
>> ------------------------------------------------------------------------------
>> Apps built with the Adobe(R) Flex(R) framework and Flex Builder(TM) are
>> powering Web 2.0 with engaging, cross-platform capabilities. Quickly and
>> easily build your RIAs with Flex Builder, the Eclipse(TM)based development
>> software that enables intelligent coding and step-through debugging.
>> Download the free 60 day trial. http://p.sf.net/sfu/www-adobe-com
>> _______________________________________________
>> gstreamer-devel mailing list
>> [hidden email]
>> https://lists.sourceforge.net/lists/listinfo/gstreamer-devel
>>
>
> ------------------------------------------------------------------------------
> _______________________________________________
> gstreamer-devel mailing list
> [hidden email]
> https://lists.sourceforge.net/lists/listinfo/gstreamer-devel

------------------------------------------------------------------------------
_______________________________________________
gstreamer-devel mailing list
[hidden email]
https://lists.sourceforge.net/lists/listinfo/gstreamer-devel
Reply | Threaded
Open this post in threaded view
|

Re: MPEG-2 TS Muxing

jalajgupta1604
In reply to this post by Julien Moutte-2
i am also doing encoding using x264enc encoder and using mpegtsmux muxer for
generating transport stream i could successful to generate ts file and that
ts file is easily decoded by VLC but when i am seeing op in TS analyzer
there are no video output why ?  video source is decklink
following is my pipeline

/gst-launch-1.0 decklinkvideosrc do-timestamp=true mode=0 connection=1
device-number=0 !  videoconvert ! x264enc tune=zerolatency  ! mpegtsmux !
queue !  filesink location=test1.ts



--
Sent from: http://gstreamer-devel.966125.n4.nabble.com/
_______________________________________________
gstreamer-devel mailing list
[hidden email]
https://lists.freedesktop.org/mailman/listinfo/gstreamer-devel