GNOME Bugzilla – Bug 142962
Error converting wav file to ogg/vorbis
Last modified: 2004-12-22 21:47:04 UTC
I'm using the following script to read a wav file and encode to ogg/vorbis: INFILE=$1 shift OUTFILE=$1 shift gst-launch filesrc location="$INFILE" ! typefind ! spider ! \ audioconvert ! rawvorbisenc managed=true quality=0.85 ! { queue ! oggmux ! filesink location="$OUTFILE" } $@ The file output has 4096 null (\0) bytes at the start before the Ogg header. It seems to be cause by a DISCONT event to new offset 4096 feeding down the pipeline before any buffers are pushed from oggmux. rawvorbisenc and oggmux just pass it on, resulting in filesink seeking to 4096 bytes in before data output. My reasoning for it looks like: * spider instantiates wavparse to read the file * wavparse does some seek in the filesrc to a different offset, resulting in a DISCONT downstream * the DISCONT is passed downstream. Since they're encoders, either oggmux or rawvorbisenc should handle this discont, shouldn't they?
filesink should ignore the discont. Why does it handle that? Who implemented that? This is the exact reason that downstream seeking happens via a SEEK event and not via a DISCONT event.
Added by wim in 2002, apparently. revision 1.3 date: 2002/06/08 15:00:30; author: wtay; state: Exp; lines: +10 -0 A discont event is the right way to handle seeking on filesink IMO Wim, do you remember your reasoning? :) I also think that filesink should ignore the discont offset, however it is also a problem that the offset in the event still seems to be relative to the original file, it hasn't been transformed to match the data coming out of each element. Shouldn't that happen the same as it would for a seek event?
oggmux now discards disconts. It's a workaround until we know if anything uses disconts in filesink. I still think it should ignore them... It doesn't work for me yet, however: Starting program: /media/gnome/src/gstreamer/gstreamer/tools/.libs/lt-gst-launch-0.8 filesrc location=/tmp/af.wav ! spider ! rawvorbisenc managed=true quality=0.85 ! { queue ! oggmux ! filesink location=/tmp/af.ogg } [New Thread 16384 (LWP 15294)] RUNNING pipeline ... [New Thread 32769 (LWP 15295)] [New Thread 16386 (LWP 15296)] (process:15294): GStreamer-CRITICAL **: file gstcaps.c: line 413 (gst_caps_get_structure): assertion `GST_IS_CAPS (caps)' failed (process:15294): GStreamer-CRITICAL **: file gstcaps.c: line 576 (gst_caps_is_fixed): assertion `GST_IS_CAPS (caps)' failed ** (process:15294): CRITICAL **: file gstaudioconvert.c: line 329 (gst_audio_convert_parse_caps): assertion `gst_caps_is_fixed (gst_caps)' failed ** (process:15294): CRITICAL **: internal negotiation error Program received signal SIGSEGV, Segmentation fault.
+ Trace 46930
Thread 16384 (LWP 15294)
Nevermind, works after wim's latest opt fixes.