After an evaluation, GNOME has moved from Bugzilla to GitLab. Learn more about GitLab.
No new issues can be reported in GNOME Bugzilla anymore.
To report an issue in a GNOME project, go to GNOME GitLab.
Do not go to GNOME Gitlab for: Bluefish, Doxygen, GnuCash, GStreamer, java-gnome, LDTP, NetworkManager, Tomboy.
Bug 645152 - encodebin fails when "x-ac3" stream inside "video/mpegts" container
encodebin fails when "x-ac3" stream inside "video/mpegts" container
Status: RESOLVED FIXED
Product: rygel
Classification: Applications
Component: Transcoding
git master
Other Linux
: Normal normal
: ---
Assigned To: GStreamer Maintainers
GStreamer Maintainers
Depends on:
Blocks:
 
 
Reported: 2011-03-18 15:40 UTC by Luis de Bethencourt
Modified: 2012-01-19 12:41 UTC
See Also:
GNOME target: ---
GNOME version: ---



Description Luis de Bethencourt 2011-03-18 15:40:14 UTC
Hi,

So I have the following code:

var cont_format = Caps.from_string ("video/mpegts,"
                                     + "systemstream=True,"
                                     + "packetsize=188");

var video_format = Caps.from_string ("video/mpeg,mpegversion=(int)2,"
                                             + "systemstream=(boolean)false,"
                                             + "framerate=25/1");

var audio_format = Caps.from_string ("audio/x-ac3");

var enc_container_profile = new EncodingContainerProfile("container",
                                                         null,
                                                         cont_format,
                                                         null);
var enc_video_profile = new EncodingVideoProfile (video_format,
                                                  null,
                                                  video_restriction,
                                                  1);
var enc_audio_profile = new EncodingAudioProfile (audio_format,
                                                  null,
                                                  null,
                                                  1);

enc_container_profile.add_profile (enc_video_profile);
enc_container_profile.add_profile (enc_audio_profile);


but when I try to play the pipeline I get...
GStreamer-CRITICAL **: gst_element_get_compatible_pad: assertion `GST_PAD_PEER (pad) == NULL' failed

it does work nicely when audio_format = Caps.from_string ("audio/mpeg");

why aren't the pads compatible? how to fix this?
Comment 1 Edward Hervey 2011-03-18 16:10:15 UTC
Please provide a backtrace of where that assertion is raised. I'm pretty sure I removed usage of gst_element_get_compatible_pad in encodebin.
Comment 2 Luis de Bethencourt 2011-03-18 17:22:19 UTC


  • #0 g_logv
    at gmessages.c line 563
  • #1 g_log
    at gmessages.c line 577
  • #2 gst_element_get_compatible_pad
    at gstutils.c line 1099
  • #3 rygel_transcoder_connect_decoder_pad
    at rygel-transcoder.c line 580
  • #4 rygel_transcoder_on_decoder_pad_added
    at rygel-transcoder.c line 555
  • #5 _rygel_transcoder_on_decoder_pad_added_gst_element_pad_added
    at rygel-transcoder.c line 273
  • #6 g_closure_invoke
    at gclosure.c line 767
  • #7 signal_emit_unlocked_R
    at gsignal.c line 3252
  • #8 g_signal_emit_valist
    at gsignal.c line 2983
  • #9 g_signal_emit
    at gsignal.c line 3040
  • #10 gst_element_add_pad
    at gstelement.c line 769
  • #11 gst_decode_bin_expose
    at gstdecodebin2.c line 3287
  • #12 source_pad_blocked_cb
    at gstdecodebin2.c line 3424
  • #13 handle_pad_block
    at gstpad.c line 4049
  • #14 gst_pad_push_event
    at gstpad.c line 5220
  • #15 gst_ffmpegdec_sink_event
    at gstffmpegdec.c line 2426
  • #16 gst_pad_send_event
    at gstpad.c line 5396
  • #17 gst_pad_push_event
    at gstpad.c line 5248
  • #18 gst_single_queue_push_one
    at gstmultiqueue.c line 944
  • #19 gst_multi_queue_loop
    at gstmultiqueue.c line 1101
  • #20 gst_task_func
    at gsttask.c line 318
  • #21 g_thread_pool_thread_proxy
    at gthreadpool.c line 319
  • #22 g_thread_create_proxy
    at gthread.c line 1897
  • #23 start_thread
    from /lib/libpthread.so.0
  • #24 clone
    from /lib/libc.so.6

Comment 3 Edward Hervey 2011-03-18 17:34:03 UTC
Do not use gst_element_get_compatible_pad(), it has side effects you don't seem to be controlling in Rygel.

The parameters you gave work fine btw, you can try with the encoding examples in gst-plugins-base/tests/examples/encoding

./encoding -o file://... \
   -v "video/mpeg,mpegversion=2,systemstream=False,framerate=25/1" \
   -f "video/mpegts,systemstream=True,packetsize=188" -a "audio/x-ac3" \
   <inputfile>

=> produces a valid file with mpeg2video and ac3 in mpeg-ts
Comment 4 Edward Hervey 2011-03-18 17:34:24 UTC
In fact, use the code in encoding.c for the logic you should be implementing.
Comment 5 Zeeshan Ali 2011-03-22 15:40:12 UTC
(In reply to comment #3)
> Do not use gst_element_get_compatible_pad(), it has side effects you don't seem
> to be controlling in Rygel.

  The docs neglect to mention that so its understandable why app developers would get confused. :) It doesn't discourage it's usage or specify in which situations does this function likely to fail or succeed.

> The parameters you gave work fine btw, you can try with the encoding examples
> in gst-plugins-base/tests/examples/encoding

  But that example *is* using gst_element_get_compatible_pad(), though it tries the request_pad when that fails.
Comment 6 Zeeshan Ali 2011-04-19 20:20:39 UTC
Luis, this issue seems to be exactly what was reported yesterday by our debian users. You said on IRC that you might have an idea of what Edward is talking about. Did you got around to fixing this?
Comment 7 Zeeshan Ali 2011-04-19 20:22:34 UTC
I meant to say the *error* is the same:

GStreamer-CRITICAL **: gst_element_get_compatible_pad: assertion `GST_PAD_PEER
(pad) == NULL' failed
Comment 8 Luis de Bethencourt 2011-04-20 09:45:31 UTC
What I meant is that I fixed the code that links the decodebin and encodebin elements.

What Edward had suggested was to follow the same logic used in the encoding.c example, and that is what I did.
Comment 9 Zeeshan Ali 2011-04-20 20:48:31 UTC
(In reply to comment #8)
> What I meant is that I fixed the code that links the decodebin and encodebin
> elements.
> 
> What Edward had suggested was to follow the same logic used in the encoding.c
> example, and that is what I did.

Good! So the issue observed by debian guys was unrelated? Looks really bad on rygel if ALL transcoding breaks in the first release that uses encodebin. :(
Comment 10 Jens Georg 2011-09-30 06:59:23 UTC
Luis: This still valid with the changes you did and gstreamer 0.10.35?
Comment 11 Tobias Mueller 2012-01-18 14:15:49 UTC
Luis, ping.
Comment 12 Luis de Bethencourt Guimera 2012-01-18 14:50:31 UTC
This should be fixed. If that is what you are asking :)
Comment 13 Luis de Bethencourt Guimera 2012-01-18 14:50:57 UTC
I mean it is fixed
Comment 14 Zeeshan Ali 2012-01-18 16:38:36 UTC
(In reply to comment #13)
> I mean it is fixed


 Cool! Could you then please mark it as such with commit hashes/repo names?
Comment 15 Luis de Bethencourt Guimera 2012-01-19 12:05:58 UTC
I don't have enough priviledges to change the status. Weird :(

Commit hashes:
3f2ecfe8
4c55853f
8def3163
Comment 16 Jens Georg 2012-01-19 12:40:36 UTC
Closing, was never transferred to GStreamer for some reason
Comment 17 Jens Georg 2012-01-19 12:41:23 UTC
(In reply to comment #16)
> Closing, was never transferred to GStreamer for some reason

er. And never needed to actually.