GNOME Bugzilla – Bug 589110
can't avidemux video/mpeg mpegversion 4 stream
Last modified: 2009-08-05 23:22:26 UTC
I have 4 custom gst plugins and these pipelines works fine : gst-launch-0.10 Custom_VideoSrc ! Custom_mpegversion4_coder ! queue2 ! filesink location=test.mpeg4 and gst-launch-0.10 filesrc location=test.mpeg4 ! queue ! Custom_mpegversion4_decoder ! Custom_VideoSink. But i have problems with avimux/demux : 1) I got an AVI file with this pipeline: (I did care that linked pads have compatibles templates). gst-launch-0.10 Custom_VideoSrc ! Custom_mpegversion4_coder ! queue2 ! m.video_00 avimux name=m ! filesink location=test.avi My Custom_mpegversion4_coder had set these caps on the buffers : GstCaps *outcaps = gst_caps_new_simple("video/mpeg", "mpegversion", G_TYPE_INT, 4, "framerate", GST_TYPE_FRACTION, 25,1, "width", G_TYPE_INT,720, "height", G_TYPE_INT,576, NULL); which belongs to templates of both avimux and avidemux (I saw this with gst-inspect). I can play the file with : ffplay test.avi but the pipeline gst-launch-0.10 filesrc location=test.avi ! avidemux name=m m.video_00 ! queue ! Custom_mpegversion4_decoder ! Custom_VideoSink ends with the error : Setting pipeline to PAUSED Pipeline is PREROLLING ERROR: from element /pipeline0/m: Internal data stream error. Additional debug info: gstavidemux.c(4153): gst_avi_demux_loop (): /pipeline0/m: streaming stopped, reason not-linked ERROR: pipeline doesn't want to preroll. Setting pipeline to NULL ... I saw with the debugger that the issue is the instruction : res = gst_avi_demux_stream_data (avi); (in gst_avi_demux_loop) 2) I got an other AVI file with the same pipeline but this time my Custom_mpegversion4_coder set these caps on the buffers : GstCaps *outcaps = gst_caps_new_simple("video/x-xvid", "framerate", GST_TYPE_FRACTION, 25,1, "width", G_TYPE_INT,720, "height", G_TYPE_INT,576, NULL); I could play this new AVI file with the pipeline gst-launch-0.10 filesrc location=test.avi ! avidemux name=m m.video_00 ! queue ! xviddec ! ximagesink wich worked fine. (the pipeline gst-launch-0.10 filesrc location=test.avi ! avidemux name=m m.video_00 ! queue ! Custom_mpegversion4_decoder ! Custom_VideoSink did not work because Custom_mpegversion4_decoder is not a xvid decoder and avimux has set xvid tags on the stream). 3) My conclusion is that avimux and avidemux process the same way some mime types and not the same way some others. Can somebody fixes the issue ? Thanks for any help. PS. I use also PCM audio compression. avidemux process PCM mime type (a-law and mu-law) but not avimux. Is it scheduled that avimux and avidemux have symetric caps ? =========== debug log (first call to gst_avi_demux_loop is OK. Second is faulty) ========== [New Thread 1127] Detaching after fork from child process 1128. Breakpoint 2 at 0x40425828: file gstavidemux.c, line 4080. Pending breakpoint "gst_avi_demux_loop" resolved [New Thread 1129] [New Thread 1130] [Switching to Thread 1130] Breakpoint 2, gst_avi_demux_loop (pad=0x4a0d0) at gstavidemux.c:4080 4080 GstAviDemux *avi = GST_AVI_DEMUX (GST_PAD_PARENT (pad)); Breakpoint 3 at 0x404116f8: file gstavidemux.c, line 43. (gdb) break 4126 Breakpoint 4 at 0x40425b50: file gstavidemux.c, line 4126. (gdb) next 4082 switch (avi->state) { (gdb) next 4084 if ((res = gst_avi_demux_stream_init_pull (avi)) != GST_FLOW_OK) { (gdb) next 4088 avi->state = GST_AVI_DEMUX_HEADER; (gdb) next 4091 if ((res = gst_avi_demux_stream_header_pull (avi)) != GST_FLOW_OK) { (gdb) next 4095 avi->state = GST_AVI_DEMUX_MOVI; (gdb) next 4096 break; (gdb) next 4120 GST_LOG_OBJECT (avi, "state: %d res:%s", avi->state, gst_flow_get_name (res)); (gdb) cont Continuing. Breakpoint 2, gst_avi_demux_loop (pad=0x4a0d0) at gstavidemux.c:4080 4080 GstAviDemux *avi = GST_AVI_DEMUX (GST_PAD_PARENT (pad)); (gdb) next 4082 switch (avi->state) { (gdb) next 4098 if (G_UNLIKELY (avi->seek_event)) { (gdb) next 4099 gst_avi_demux_push_event (avi, avi->seek_event); (gdb) next 4100 avi->seek_event = NULL; (gdb) next 4102 if (G_UNLIKELY (avi->got_tags)) { (gdb) next 4103 push_tag_lists (avi); (gdb) next 4106 res = gst_avi_demux_stream_data (avi); (gdb) next 4109 if (res != GST_FLOW_OK) { (gdb) cont Continuing. 4126 GST_LOG_OBJECT (avi, "pausing task, reason %s", gst_flow_get_name (res)); (gdb) break 4127 Breakpoint 6 at 0x40425bb8: file gstavidemux.c, line 4127. (gdb) cont Continuing. 4127 avi->segment_running = FALSE; (gdb) next 4128 gst_pad_pause_task (avi->sinkpad); (gdb) next 4130 if (GST_FLOW_IS_FATAL (res) || (res == GST_FLOW_NOT_LINKED)) { (gdb) break 4131 Breakpoint 7 at 0x40425bec: file gstavidemux.c, line 4131. (gdb) cont Continuing. 4131 gboolean push_eos = TRUE; (gdb) next 4133 if (res == GST_FLOW_UNEXPECTED) { (gdb) next 4151 GST_ELEMENT_ERROR (avi, STREAM, FAILED, (gdb) break 4155 Breakpoint 8 at 0x40425e90: file gstavidemux.c, line 4155. (gdb) cont Continuing. 4155 if (push_eos) { (gdb) next 4156 GST_INFO_OBJECT (avi, "sending eos"); (gdb) break 4157 Breakpoint 9 at 0x40425ef8: file gstavidemux.c, line 4157. (gdb) cont Continuing. 4157 if (!(gst_avi_demux_push_event (avi, gst_event_new_eos ()))) { (gdb) next 4159 GST_ELEMENT_ERROR (avi, STREAM, FAILED, (gdb) break 4165 Breakpoint 10 at 0x40426078: file gstavidemux.c, line 4165. (gdb) cont Continuing. [Thread 1129 exited] 4165 } (gdb) next gst_task_func (task=0x8dc68, tclass=0x21158) at gsttask.c:194 194 GST_OBJECT_LOCK (task); (gdb)
do you have a short example file that does not play?
gst-launch-0.10 videotestsrc num-buffers=100 ! ffenc_mpeg4 ! avimux ! avidemux ! ffdec_mpeg4 ! ffmpegcolorspace ! videoscale ! ximagesink works fine for me. > (I did care that linked pads have compatibles templates) Compatible template caps are only part of the story. Since there are dynamic pads involved here (at avidemux), you might need actually compatible caps when the videosink is open for the decoder plus videosink to get linked. Maybe there is a problem with the pixelformats/colourspaces used, or - especially if your sink does not support scaling - the pixel-aspect-ratios don't match. Hard to say without more information (such as a file or a debug log).