[Bug 720995] matroskamux: add g726 adpcm support

GStreamer (bugzilla.gnome.org) bugzilla at gnome.org
Wed Jan 8 07:04:13 PST 2014


https://bugzilla.gnome.org/show_bug.cgi?id=720995
  GStreamer | gst-plugins-good | 1.x

--- Comment #14 from Nicola <lists at svrinformatica.it> 2014-01-08 15:04:07 UTC ---
based on this link:

http://blogs.msdn.com/b/dawate/archive/2009/06/23/intro-to-audio-programming-part-2-demystifying-the-wav-format.aspx

the block align for G726 should be:

2 for 16kbit/s
3 for 24kbit/s
4 for 32kbit/s
5 for 40kbit/s

these values are obtained as bitrate/rate, the values are confirmed here:

http://en.wikipedia.org/wiki/G.726

on my system using avconv (0.8.9 system version) like this:

avconv -f alsa -i "hw:0,0" -acodec g726 -ac 1 -ar 8000 -ab 32K /tmp/test1.mkv

I have: 
- block_align 5 for bitrate 40000 (ok)
- block_align 1 for bitrate 32000 (wrong, should be 4)
- block_align 3 for bitrate 24000 (ok)
- block_align 1 for bitrate 16000 (wrong should be 2)

gstreamer can produce g726 audio using avenc_g726, bitrate is configurable on
the encoder and works as excepected (it accept values greater that 40000 and
smaller than 16000 but if you set bitrate 12000 it will be automatically
adjusted to 16000 and 48000 will be automatically adjusted to 40000) but block
align is ever set to 0

since avconv and so many encoder out of there set wrong block align I suggest 

- to be permissive for muxing (to be able to mux audio produced by ourself), so
no change to the actual muxing code 
- in riff-media.c adjust block align based on bitrate if strf->av_bps != 0 and
so return correct bitrate and block align
- in riff-media.c return caps as "audio/x-adpcm","layout", G_TYPE_STRING,
"g726" if strf is null or strf->av_bps == 0 and block_align is invalid (<2 or
>5), this will make the file unplayable and should be correct since the bitrate
is invalid or missing
- in riff-media.c recalculate bitrate based on block-align if block align is
valid (between 2 and 5) and bitrate invalid (0)
- to be permissive if both block_align and bitrate are valid but not compatible
each other (for example bitrate 40000 and block_align 2)

what do you think about? Am I missing something?

-- 
Configure bugmail: https://bugzilla.gnome.org/userprefs.cgi?tab=email
------- You are receiving this mail because: -------
You are the QA contact for the bug.
You are the assignee for the bug.


More information about the gstreamer-bugs mailing list