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 683622 - [flvdemux] Internal flow error when demuxing speex
[flvdemux] Internal flow error when demuxing speex
Status: RESOLVED FIXED
Product: GStreamer
Classification: Platform
Component: gst-plugins-good
git master
Other Linux
: Normal normal
: 1.0.1
Assigned To: GStreamer Maintainers
GStreamer Maintainers
Depends on:
Blocks:
 
 
Reported: 2012-09-08 13:13 UTC by Dmitry Samonenko
Modified: 2012-09-25 23:47 UTC
See Also:
GNOME target: ---
GNOME version: ---


Attachments
Proposed solution (3.57 KB, patch)
2012-09-10 06:49 UTC, Dmitry Samonenko
committed Details | Review
FLV with speex sample (42.46 KB, application/octet-stream)
2012-09-10 06:50 UTC, Dmitry Samonenko
  Details

Description Dmitry Samonenko 2012-09-08 13:13:46 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.
Comment 1 Dmitry Samonenko 2012-09-08 13:27:42 UTC
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.
Comment 2 Tim-Philipp Müller 2012-09-09 11:07:06 UTC
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?
Comment 3 Dmitry Samonenko 2012-09-10 06:49:25 UTC
Created attachment 223878 [details] [review]
Proposed solution
Comment 4 Dmitry Samonenko 2012-09-10 06:50:18 UTC
Created attachment 223879 [details]
FLV with speex sample
Comment 5 Dmitry Samonenko 2012-09-10 06:57:43 UTC
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.
Comment 6 Dmitry Samonenko 2012-09-17 09:04:49 UTC
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?
Comment 7 Tim-Philipp Müller 2012-09-17 09:18:37 UTC
No, sorry, it's good, thanks for the sample file and the patch. Hopefully we'll be able have a look at it soonish.
Comment 8 Tim-Philipp Müller 2012-09-25 23:47:34 UTC
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.