GNOME Bugzilla – Bug 665911
Ability to specify ignore-length in wavparse
Last modified: 2011-12-13 14:37:18 UTC
This is a raw audio stream - it is a standard PCM 16khz from a D-Link DCS-932L IP Camera: http://admin:@82.13.197.168:82/audio.cgi I'm trying to record it with: gst-launch souphttpsrc location=${URL}audio.cgi ! decodebin ! audioconvert ! vorbisenc ! matroskamux ! filesink location="out.mkv" It records the first 32 seconds and then quits due to EOS. I suspect this happens because the IP camera sets the duration of the WAVE header to a single chunk but the stream is endless. In Sox, I can do this to workaround this problem: curl ${URL}audio.cgi | sox - --ignore-length -o test.wav I would love to be able to do something similar in gstreamer.
This is the sox option: --ignore-length Override an (incorrect) audio length given in an audio file's header. If this option is given then SoX will keep reading audio until it reaches the end of the input Really wish waveparse had this :(
Please make a patch and ensure that it also works for wav files that are truncated.
As a data point: Looking at the URL above, the stream puts out a single data chunk, with a data size of slightly below 1MB. This in turn causes duration to be calculated at around 32 seconds from that 1 MB and the bitrate.
Created attachment 203263 [details] [review] wavparse: add a ignore-length property This allows playing broken streams which write an incorrect length in their data chunks (such as, at least, one streaming camera).
Comment on attachment 203263 [details] [review] wavparse: add a ignore-length property er, not ready yet.
Created attachment 203277 [details] [review] wavparse: add a ignore-length property This allows playing broken streams which write an incorrect length in their data chunks (such as, at least, one streaming camera).
Thank you! - the patch works great for me.
Review of attachment 203277 [details] [review]: thanks for the quick patch. Just two minor nitpicks. ::: gst/wavparse/gstwavparse.c @@ +147,3 @@ + + /** + * GstDeinterlace:mode Please fix the docblob :) @@ +1404,3 @@ wav->offset += size; } + GST_DEBUG_OBJECT (wav, "datasize = %u", size); In earlier log statements it is still %d. 'size' is guint32, right? Could you change the otehr logs statements too (preferably as a separate commit).
Created attachment 203329 [details] [review] wavparse: add a ignore-length property This allows playing broken streams which write an incorrect length in their data chunks (such as, at least, one streaming camera).
Nice, I distinctly remember to think "and I'll have to replace the doc after adapting the property names/desc". And I still forgot :D As for the %u, size is guint32, yes. Looking now, there seems to be a HUGE amount of incorrect format specifiers in this file. The one above I fixed because it had thrown me on a wild goose chase, but a comprehensive fix will take a little while.
Created attachment 203331 [details] [review] wavparse: fix format specifier signedness Use unsigned specifiers for all unsigned values. A lot of the values used here are unsigned, and some can take high enough values that their signed counterpart will be negative.
Created attachment 203332 [details] [review] wavparse: avoid using floating point unnecessarily
While most values are guint32 or guint16, I still made use of %u since we can't run on platforms where sizeof(int) < 32, so these will be promoted to unsigned int. This makes the patch less annoying, and still correct for those platforms.
commit ecec3859d838d334bda4c48bdcfd901f63b6bc2e Author: Vincent Penquerc'h <vincent.penquerch@collabora.co.uk> Date: Tue Dec 13 11:46:43 2011 +0000 wavparse: avoid using floating point unnecessarily https://bugzilla.gnome.org/show_bug.cgi?id=665911 commit b612550379b1a01257741b6b96df576b9f43f376 Author: Vincent Penquerc'h <vincent.penquerch@collabora.co.uk> Date: Tue Dec 13 11:42:40 2011 +0000 wavparse: fix format specifier signedness Use unsigned specifiers for all unsigned values. A lot of the values used here are unsigned, and some can take high enough values that their signed counterpart will be negative. https://bugzilla.gnome.org/show_bug.cgi?id=665911 commit 734e352b73dda701905058f9cc0e375f9f2e8363 Author: Vincent Penquerc'h <vincent.penquerch@collabora.co.uk> Date: Mon Dec 12 16:49:19 2011 +0000 wavparse: add a ignore-length property This allows playing broken streams which write an incorrect length in their data chunks (such as, at least, one streaming camera). https://bugzilla.gnome.org/show_bug.cgi?id=665911
Wow, that was quick, thank you very much :)