Convert ASF to MPEG-2 transport stream using asfdemux & mpegtsmux

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

Convert ASF to MPEG-2 transport stream using asfdemux & mpegtsmux

Raymond Tam
Hi all,

I'm trying convert a ASF stream file (video: wmv, audio:wma) to MPEG-2 transport stream file.

I understand that 'mpgegtsmux' currently does not support wmv/wma elementary. So I made small changes to 'mpegtsmux' to support wmv/wma (in sink pad cap and in mpegtsmux_create_stream()).

Afterwards, I'm able to successfully execute the following 2 pipelines:
gst-launch filesrc location=myfile.asf ! asfdemux name=demux demux.audio_00 ! multiqueue ! mpegtsmux name=mux ! filesink location=myfile.mpg.audio
gst-launch filesrc location=myfile.asf ! asfdemux name=demux demux.video_00 ! multiqueue ! mpegtsmux name=mux ! filesink location=myfile.mpg.video
In other words, I'm able to convert a ASF file to audio-only or video-only MPEG-2 transport stream.

However, there's problem when converting the same ASF file into a single audio/video MPEG-2 transport stream, i.e.:

gst-launch filesrc location=myfile.wmv ! asfdemux name=demux demux.video_00 ! multiqueue ! mpegtsmux name=mux ! filesink location=myfile.mpg demux.audio_00 ! multiqueue ! mux.

The execution gets stuck soon after started. After some investigation, I found that 'gst_pad_push()' (inside 'gst_asf_demux_push_buffer()' of gstasfdemux.c) never returns. Furthermore, in gstdataqueue.c, both of the functions 'gst_data_queue_push()' and 'gst_data_queue_pop()' get stuck in g_cond_wait():

gboolean
gst_data_queue_push (GstDataQueue * queue, GstDataQueueItem * item)
{
    ......
    while (gst_data_queue_locked_is_full (queue)) {
      g_cond_wait (queue->item_del, queue->qlock); //<--never returns
    ......
}

It looks like the queue between asfdemux and mpegtsmux is full when I convert both audio&video together.
I would very much appreciate it if someone can give me some idea what might be the problem, or some suggestions on how to further debug the problem.

Here's the gstreamer versions I'm using:
gstreamer-0.10.22, gst-plugins-bad-0.10.10, gst-plugins-ugly-0.10.10

Thanks in advance.

-Raymond




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

Re: Convert ASF to MPEG-2 transport stream using asfdemux & mpegtsmux

Raymond Tam
Looks like by experimenting with the property settings of 'multiqueue', my pipeline is now able to run all the way to the end.

-Raymond


-----Original Message-----
From: Raymond Tam
Sent: Sun 4/5/2009 7:50 AM
To: [hidden email]
Subject: Convert ASF to MPEG-2 transport stream using asfdemux & mpegtsmux
 
Hi all,

I'm trying convert a ASF stream file (video: wmv, audio:wma) to MPEG-2 transport stream file.

I understand that 'mpgegtsmux' currently does not support wmv/wma elementary. So I made small changes to 'mpegtsmux' to support wmv/wma (in sink pad cap and in mpegtsmux_create_stream()).

Afterwards, I'm able to successfully execute the following 2 pipelines:
gst-launch filesrc location=myfile.asf ! asfdemux name=demux demux.audio_00 ! multiqueue ! mpegtsmux name=mux ! filesink location=myfile.mpg.audio
gst-launch filesrc location=myfile.asf ! asfdemux name=demux demux.video_00 ! multiqueue ! mpegtsmux name=mux ! filesink location=myfile.mpg.video
In other words, I'm able to convert a ASF file to audio-only or video-only MPEG-2 transport stream.

However, there's problem when converting the same ASF file into a single audio/video MPEG-2 transport stream, i.e.:

gst-launch filesrc location=myfile.wmv ! asfdemux name=demux demux.video_00 ! multiqueue ! mpegtsmux name=mux ! filesink location=myfile.mpg demux.audio_00 ! multiqueue ! mux.

The execution gets stuck soon after started. After some investigation, I found that 'gst_pad_push()' (inside 'gst_asf_demux_push_buffer()' of gstasfdemux.c) never returns. Furthermore, in gstdataqueue.c, both of the functions 'gst_data_queue_push()' and 'gst_data_queue_pop()' get stuck in g_cond_wait():

gboolean
gst_data_queue_push (GstDataQueue * queue, GstDataQueueItem * item)
{
    ......
    while (gst_data_queue_locked_is_full (queue)) {
      g_cond_wait (queue->item_del, queue->qlock); //<--never returns
    ......
}

It looks like the queue between asfdemux and mpegtsmux is full when I convert both audio&video together.
I would very much appreciate it if someone can give me some idea what might be the problem, or some suggestions on how to further debug the problem.

Here's the gstreamer versions I'm using:
gstreamer-0.10.22, gst-plugins-bad-0.10.10, gst-plugins-ugly-0.10.10

Thanks in advance.

-Raymond





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

Question about icydemux

Raymond Tam
In reply to this post by Raymond Tam
Hi all,

I'm experimenting with the 'icydemux' plugin, and according to the comments in the code (Example launch line), I should be able to do this:

gst-launch gnomevfssrc location=http://some.server/ ! icydemux ! fakesink -t

So I do the following gst-launch command, but keep getting "not-negotiated" error from gnomevfssrc:

gst-launch -mv gnomevfssrc location=http://scfire-ntc-aa06.stream.aol.com:80/stream/1006 ! icydemux ! fakesink -t

[rtam@greylock icydemux]$ gst-launch -mv gnomevfssrc location=http://scfire-ntc-aa06.stream.aol.com:80/stream/1006 ! icydemux ! fakesink -t
Setting pipeline to PAUSED ...
Pipeline is PREROLLING ...
Got Message from element "fakesink0" (state-changed): GstMessageState, old-state=(GstState)GST_STATE_NULL, new-state=(GstState)GST_STATE_READY, pending-state=(GstState)GST_STATE_VOID_PENDING;
Got Message from element "icydemux0" (state-changed): GstMessageState, old-state=(GstState)GST_STATE_NULL, new-state=(GstState)GST_STATE_READY, pending-state=(GstState)GST_STATE_VOID_PENDING;
Got Message from element "gnomevfssrc0" (state-changed): GstMessageState, old-state=(GstState)GST_STATE_NULL, new-state=(GstState)GST_STATE_READY, pending-state=(GstState)GST_STATE_VOID_PENDING;
Got Message from element "pipeline0" (state-changed): GstMessageState, old-state=(GstState)GST_STATE_NULL, new-state=(GstState)GST_STATE_READY, pending-state=(GstState)GST_STATE_PAUSED;
Got Message from element "icydemux0" (state-changed): GstMessageState, old-state=(GstState)GST_STATE_READY, new-state=(GstState)GST_STATE_PAUSED, pending-state=(GstState)GST_STATE_VOID_PENDING;
Got Message from element "gnomevfssrc0" (state-changed): GstMessageState, old-state=(GstState)GST_STATE_READY, new-state=(GstState)GST_STATE_PAUSED, pending-state=(GstState)GST_STATE_VOID_PENDING;
Got Message from element "gnomevfssrc0" (error): GstMessageError, gerror=(GstGError)(NULL), debug=(string)"gstbasesrc.c\(2240\):\ gst_base_src_loop\ \(\):\ /pipeline0/gnomevfssrc0:\012streaming\ task\ paused\,\ reason\ not-negotiated\ \(-4\)";
ERROR: from element /pipeline0/gnomevfssrc0: Internal data flow error.
Additional debug info:
gstbasesrc.c(2240): gst_base_src_loop (): /pipeline0/gnomevfssrc0:
streaming task paused, reason not-negotiated (-4)
ERROR: pipeline doesn't want to preroll.
Setting pipeline to NULL ...
FREEING pipeline ...

Does anybody have an idea why it failed? I also tried souphttpsrc and neonhttpsrc but they make no difference.

Thank you in advance.

-Raymond

------------------------------------------------------------------------------
This SF.net email is sponsored by:
High Quality Requirements in a Collaborative Environment.
Download a free trial of Rational Requirements Composer Now!
http://p.sf.net/sfu/www-ibm-com
_______________________________________________
gstreamer-devel mailing list
[hidden email]
https://lists.sourceforge.net/lists/listinfo/gstreamer-devel
Reply | Threaded
Open this post in threaded view
|

Re: Question about icydemux

michael smith-6-3
On Tue, Apr 7, 2009 at 11:46 AM, Raymond Tam <[hidden email]> wrote:
> Hi all,
>
> I'm experimenting with the 'icydemux' plugin, and according to the comments in the code (Example launch line), I should be able to do this:
>
> gst-launch gnomevfssrc location=http://some.server/ ! icydemux ! fakesink -t

You need to set iradio-mode=true on gnomevfssrc - this'll make it
request the ICY metadata from the server. If the server provides that
metadata, then, icydemux will work with it. The example in the
documentation uses souphttpsrc, which also has this property.

Mike

------------------------------------------------------------------------------
This SF.net email is sponsored by:
High Quality Requirements in a Collaborative Environment.
Download a free trial of Rational Requirements Composer Now!
http://p.sf.net/sfu/www-ibm-com
_______________________________________________
gstreamer-devel mailing list
[hidden email]
https://lists.sourceforge.net/lists/listinfo/gstreamer-devel
Reply | Threaded
Open this post in threaded view
|

Re: Convert ASF to MPEG-2 transport stream using asfdemux & mpegtsmux

ogara
In reply to this post by Raymond Tam
Hello All,
I have the same problem as Raymond did. Using version gstreamer-0.10.22, gst-plugins-bad-0.10.10, gst-plugins-ugly-0.10.10. After some time the pipeline will get stuck (sometimes it takes seconds but sometimes it takes hours for it to get stuck). The problem happens in the gst_pad_push() method (it never returns from this method) from the decoder to the sink . If someone knows if the later versions of gstreamer behave better please let me know. Also, Raymond suggested that "Looks like by experimenting with the property settings of 'multiqueue', my pipeline is now able to run all the way to the end. ". I was wondering where do the property settings get set? If it is in the class_init method that bring even more confusion to me since I have no properties set at all.
Any help is appreciated.
Thank you
Ogara