GNOME Bugzilla – Bug 683622
[flvdemux] Internal flow error when demuxing speex
Last modified: 2012-09-25 23:47:56 UTC
Currently speexdec expects streamheader and vorbiscomment to be present in caps: vital speex header is extracted/generated from the former. In case these 2 are absent in caps, first 2 packets are treated as these two. In FLV format speex data is always present in Mono, Wideband as stated here: http://download.macromedia.com/f4v/video_file_format_spec_v10_1.pdf (document page 71). So, there is no speex header present in FLV and flvdemux generates none. This situation leads to speexdec trying to generate header from the first packet using speex_packet_to_header libspeex routine, which fails, and message "This doesn't look like a Speex file" is printed out.
I've made some research on the speexdec element - it looks like speex data decoding is very closely coupled with speex ogg-format header and cannot be performed without it. Speex RTP depayloading rtpspeexdepay has this problem (missing header) resolved by generating such header "manually" (check gst_rtp_speex_depay_setcaps in gst/rtp/gstrtpspeexdepay.c). I've made a patch with the same idea in mind for 0.10.31 version. If it looks like a suitable solution I can attach it here.
Dmitry: I would suggest you just attach the patch, make things much easier for everyone :) Usually "xiph headers" are put into other containers into the codec_data field with a special convention how to read the packets out again. Could you make such a speex-in-flv file available somehow? Do you know what created it?
Created attachment 223878 [details] [review] Proposed solution
Created attachment 223879 [details] FLV with speex sample
Have just attached speex sample: generated it with ffmpeg. I have spotted original problem when was working with RTMP stream generated by Flash server. I didn't reported it like that because scenario is overly-complicated: _exactly the same problem_ easily reproduces with this file - I hope it will do.
I'm kinda new to Gstreamer bugzilla: "NEEDINFO" is current issue status. Requested example file was provided. Do you need some additional info? Can I help you with something else related to the issue?
No, sorry, it's good, thanks for the sample file and the patch. Hopefully we'll be able have a look at it soonish.
Thanks, I've ported this to 1.0 and pushed it, many thanks! commit 7d4b6f655edf2ebf99f27e3b110e4deecd14b8eb Author: Dmitriy Samonenko <dmitriy.samonenko@teligent.ru> Date: Mon Sep 10 10:27:28 2012 +0400 flvdemux: fix speex audio decoding by creating fake stream header https://bugzilla.gnome.org/show_bug.cgi?id=683622 commit c203ce2dbe6597155d9c68775dccf364a1399756 Author: Tim-Philipp Müller <tim@centricular.net> Date: Wed Sep 26 00:44:59 2012 +0100 flvdemux: minor clean-up Use GstByteWriter, because we can, and g_value_take_boxed.