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 665911 - Ability to specify ignore-length in wavparse
Ability to specify ignore-length in wavparse
Status: RESOLVED FIXED
Product: GStreamer
Classification: Platform
Component: gst-plugins-good
0.10.x
Other Linux
: Normal enhancement
: 0.10.31
Assigned To: GStreamer Maintainers
GStreamer Maintainers
Depends on:
Blocks:
 
 
Reported: 2011-12-10 13:50 UTC by Roman Gaufman
Modified: 2011-12-13 14:37 UTC
See Also:
GNOME target: ---
GNOME version: ---


Attachments
wavparse: add a ignore-length property (4.04 KB, patch)
2011-12-12 16:55 UTC, Vincent Penquerc'h
none Details | Review
wavparse: add a ignore-length property (5.43 KB, patch)
2011-12-12 18:28 UTC, Vincent Penquerc'h
needs-work Details | Review
wavparse: add a ignore-length property (5.22 KB, patch)
2011-12-13 11:20 UTC, Vincent Penquerc'h
committed Details | Review
wavparse: fix format specifier signedness (6.09 KB, patch)
2011-12-13 11:50 UTC, Vincent Penquerc'h
committed Details | Review
wavparse: avoid using floating point unnecessarily (1.26 KB, patch)
2011-12-13 11:50 UTC, Vincent Penquerc'h
committed Details | Review

Description Roman Gaufman 2011-12-10 13:50:54 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.
Comment 1 Roman Gaufman 2011-12-11 13:52:35 UTC
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 :(
Comment 2 Stefan Sauer (gstreamer, gtkdoc dev) 2011-12-11 19:37:54 UTC
Please make a patch and ensure that it also works for wav files that are truncated.
Comment 3 Vincent Penquerc'h 2011-12-12 16:12:01 UTC
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.
Comment 4 Vincent Penquerc'h 2011-12-12 16:55:00 UTC
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 5 Vincent Penquerc'h 2011-12-12 17:05:09 UTC
Comment on attachment 203263 [details] [review]
wavparse: add a ignore-length property

er, not ready yet.
Comment 6 Vincent Penquerc'h 2011-12-12 18:28:34 UTC
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).
Comment 7 Roman Gaufman 2011-12-13 07:59:18 UTC
Thank you! - the patch works great for me.
Comment 8 Stefan Sauer (gstreamer, gtkdoc dev) 2011-12-13 09:24:40 UTC
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).
Comment 9 Vincent Penquerc'h 2011-12-13 11:20:09 UTC
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).
Comment 10 Vincent Penquerc'h 2011-12-13 11:23:05 UTC
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.
Comment 11 Vincent Penquerc'h 2011-12-13 11:50:16 UTC
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.
Comment 12 Vincent Penquerc'h 2011-12-13 11:50:19 UTC
Created attachment 203332 [details] [review]
wavparse: avoid using floating point unnecessarily
Comment 13 Vincent Penquerc'h 2011-12-13 11:52:27 UTC
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.
Comment 14 Vincent Penquerc'h 2011-12-13 13:05:38 UTC
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
Comment 15 Roman Gaufman 2011-12-13 14:37:18 UTC
Wow, that was quick, thank you very much :)