Fwd: [Vorbis-dev] Zero length reported.
Jim Credland <[email protected]> Fri, 7 Apr 2017 13:31:21 +0100
| Newsgroups | gmane.comp.multimedia.ogg.vorbis.general |
|---|---|
| Message-ID | <[email protected]> |
--===============0754775618941823206== Content-Type: multipart/alternative; boundary="Apple-Mail=_213993BC-0AD3-4810-A0DF-2FA10509EA84" --Apple-Mail=_213993BC-0AD3-4810-A0DF-2FA10509EA84 Content-Transfer-Encoding: quoted-printable Content-Type: text/plain; charset=utf-8 Hello - I send this to the vorbis-dev list yesterday, but I=E2=80=99m = working if it would not have been better targeted at this list.=20 Sorry for the spam if you are on both :) > Begin forwarded message: >=20 > From: Jim Credland <[email protected]> > Subject: [Vorbis-dev] Zero length reported. > Date: 6 April 2017 at 15:43:18 BST > To: [email protected] > Cc: Maciej Dudek <[email protected]> >=20 > Hello - I have two files which play back in VLC correctly. >=20 > They were encoded using this command: >=20 > ffmpeg -y -i = '/tmp/2e905b981d30324f9a0664cbabb3f59a20170406-21128-r0neh9.wav' -acodec = libvorbis = '/tmp/2e905b981d30324f9a0664cbabb3f59a20170406-21128-r0neh920170406-21128-= 146yyex.ogg >=20 > However ov_pcm_total reports a zero length for one of the two files. = Is this a problem with my use of the ov_pcm_total function or a problem = with the encoding? The files are here http://www.credland.net/ogg/ = along with a copy of the source code. >=20 > This is a problem because the same function call is used by the JUCE = ogg decoder we are using in an application. =20 >=20 > Any thoughts? >=20 > thanks in advance, Jim. >=20 >=20 >=20 > The output is: >=20 > jim@snoopy ~/trouble.vorbis/a > $ ./a < = 53884c2935e6b47938f91ca78b0c2473a85730833138370caedbb66a74995130.ogg > encoder=3DLavf53.32.100 >=20 > Bitstream is 2 channel, 44100Hz > Encoded by: Lavf53.32.100 >=20 > Length: 0 >=20 > jim@snoopy ~/trouble.vorbis/a > $ ./a < = d7d5ef8e6c7fad33f922924d0a05591277654d53941d43518f1fe8580c7ea3f9.ogg > encoder=3DLavf53.32.100 >=20 > Bitstream is 2 channel, 44100Hz > Encoded by: Lavf53.32.100 >=20 > Length: 1146624 >=20 >=20 > Source: >=20 > #include <stdio.h> > #include <stdlib.h> > #include <math.h> > #include "vorbis/codec.h" > #include "vorbis/vorbisfile.h" >=20 > #ifdef _WIN32 > #include <io.h> > #include <fcntl.h> > #endif >=20 > char pcmout[4096]; >=20 > int main (int argc, char** argv) > { > OggVorbis_File vf; > int eof =3D 0; > int current_section; >=20 > #ifdef _WIN32 > _setmode (_fileno (stdin), _O_BINARY); > _setmode (_fileno (stdout), _O_BINARY); > #endif >=20 > if (ov_open_callbacks (stdin, &vf, NULL, 0, OV_CALLBACKS_NOCLOSE) < = 0) > { > fprintf (stderr, "Input does not appear to be an Ogg = bitstream.\n"); > exit (1); > } >=20 > { > char** ptr =3D ov_comment (&vf, -1)->user_comments; > vorbis_info* vi =3D ov_info (&vf, -1); >=20 > while (*ptr) > { > fprintf (stderr, "%s\n", *ptr); > ++ptr; > } >=20 > fprintf (stderr, "\nBitstream is %d channel, %ldHz\n", = vi->channels, vi->rate); > fprintf (stderr, "Encoded by: %s\n\n", ov_comment (&vf, = -1)->vendor); > fprintf (stderr, "Length: %lld\n\n", ov_pcm_total(&vf, -1)); > } >=20 > return 0; > } > _______________________________________________ > Vorbis-dev mailing list > [email protected] > http://lists.xiph.org/mailman/listinfo/vorbis-dev --Apple-Mail=_213993BC-0AD3-4810-A0DF-2FA10509EA84 Content-Transfer-Encoding: quoted-printable Content-Type: text/html; charset=utf-8 <html><head><meta http-equiv=3D"Content-Type" content=3D"text/html = charset=3Dutf-8"></head><body style=3D"word-wrap: break-word; = -webkit-nbsp-mode: space; -webkit-line-break: after-white-space;" = class=3D"">Hello - I send this to the vorbis-dev list yesterday, but = I=E2=80=99m working if it would not have been better targeted at this = list. <div class=3D""><br class=3D""></div><div class=3D"">Sorry = for the spam if you are on both :)<br class=3D""><div><br = class=3D""><blockquote type=3D"cite" class=3D""><div class=3D"">Begin = forwarded message:</div><br class=3D"Apple-interchange-newline"><div = style=3D"margin-top: 0px; margin-right: 0px; margin-bottom: 0px; = margin-left: 0px;" class=3D""><span style=3D"font-family: = -webkit-system-font, Helvetica Neue, Helvetica, sans-serif; = color:rgba(0, 0, 0, 1.0);" class=3D""><b class=3D"">From: = </b></span><span style=3D"font-family: -webkit-system-font, Helvetica = Neue, Helvetica, sans-serif;" class=3D"">Jim Credland <<a = href=3D"mailto:[email protected]" class=3D"">[email protected]</a>><br = class=3D""></span></div><div style=3D"margin-top: 0px; margin-right: = 0px; margin-bottom: 0px; margin-left: 0px;" class=3D""><span = style=3D"font-family: -webkit-system-font, Helvetica Neue, Helvetica, = sans-serif; color:rgba(0, 0, 0, 1.0);" class=3D""><b class=3D"">Subject: = </b></span><span style=3D"font-family: -webkit-system-font, Helvetica = Neue, Helvetica, sans-serif;" class=3D""><b class=3D"">[Vorbis-dev] Zero = length reported.</b><br class=3D""></span></div><div style=3D"margin-top: = 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 0px;" = class=3D""><span style=3D"font-family: -webkit-system-font, Helvetica = Neue, Helvetica, sans-serif; color:rgba(0, 0, 0, 1.0);" class=3D""><b = class=3D"">Date: </b></span><span style=3D"font-family: = -webkit-system-font, Helvetica Neue, Helvetica, sans-serif;" class=3D"">6 = April 2017 at 15:43:18 BST<br class=3D""></span></div><div = style=3D"margin-top: 0px; margin-right: 0px; margin-bottom: 0px; = margin-left: 0px;" class=3D""><span style=3D"font-family: = -webkit-system-font, Helvetica Neue, Helvetica, sans-serif; = color:rgba(0, 0, 0, 1.0);" class=3D""><b class=3D"">To: </b></span><span = style=3D"font-family: -webkit-system-font, Helvetica Neue, Helvetica, = sans-serif;" class=3D""><a href=3D"mailto:[email protected]" = class=3D"">[email protected]</a><br class=3D""></span></div><div = style=3D"margin-top: 0px; margin-right: 0px; margin-bottom: 0px; = margin-left: 0px;" class=3D""><span style=3D"font-family: = -webkit-system-font, Helvetica Neue, Helvetica, sans-serif; = color:rgba(0, 0, 0, 1.0);" class=3D""><b class=3D"">Cc: </b></span><span = style=3D"font-family: -webkit-system-font, Helvetica Neue, Helvetica, = sans-serif;" class=3D"">Maciej Dudek <<a = href=3D"mailto:[email protected]" = class=3D"">[email protected]</a>><br class=3D""></span></div><br = class=3D""><div class=3D""><div class=3D"">Hello - I have two files = which play back in VLC correctly.<br class=3D""><br class=3D"">They were = encoded using this command:<br class=3D""><br class=3D"">ffmpeg -y -i = '/tmp/2e905b981d30324f9a0664cbabb3f59a20170406-21128-r0neh9.wav' -acodec = libvorbis = '/tmp/2e905b981d30324f9a0664cbabb3f59a20170406-21128-r0neh920170406-21128-= 146yyex.ogg<br class=3D""><br class=3D"">However ov_pcm_total reports a = zero length for one of the two files. Is this a problem with my = use of the ov_pcm_total function or a problem with the encoding? = The files are here <a href=3D"http://www.credland.net/ogg/" = class=3D"">http://www.credland.net/ogg/</a> along with a copy of the = source code.<br class=3D""><br class=3D"">This is a problem because the = same function call is used by the JUCE ogg decoder we are using in an = application. <br class=3D""><br class=3D"">Any thoughts?<br = class=3D""><br class=3D"">thanks in advance, Jim.<br class=3D""><br = class=3D""><br class=3D""><br class=3D"">The output is:<br class=3D""><br = class=3D"">jim@snoopy ~/trouble.vorbis/a<br class=3D""> $ ./a < = 53884c2935e6b47938f91ca78b0c2473a85730833138370caedbb66a74995130.ogg<br = class=3D"">encoder=3DLavf53.32.100<br class=3D""><br class=3D"">Bitstream = is 2 channel, 44100Hz<br class=3D"">Encoded by: Lavf53.32.100<br = class=3D""><br class=3D"">Length: 0<br class=3D""><br = class=3D"">jim@snoopy ~/trouble.vorbis/a<br class=3D""> $ ./a < = d7d5ef8e6c7fad33f922924d0a05591277654d53941d43518f1fe8580c7ea3f9.ogg<br = class=3D"">encoder=3DLavf53.32.100<br class=3D""><br class=3D"">Bitstream = is 2 channel, 44100Hz<br class=3D"">Encoded by: Lavf53.32.100<br = class=3D""><br class=3D"">Length: 1146624<br class=3D""><br class=3D""><br= class=3D"">Source:<br class=3D""><br class=3D"">#include = <stdio.h><br class=3D"">#include <stdlib.h><br = class=3D"">#include <math.h><br class=3D"">#include = "vorbis/codec.h"<br class=3D"">#include "vorbis/vorbisfile.h"<br = class=3D""><br class=3D"">#ifdef _WIN32<br class=3D"">#include = <io.h><br class=3D"">#include <fcntl.h><br = class=3D"">#endif<br class=3D""><br class=3D"">char pcmout[4096];<br = class=3D""><br class=3D"">int main (int argc, char** argv)<br = class=3D"">{<br class=3D""> OggVorbis_File vf;<br = class=3D""> int eof =3D 0;<br class=3D""> = int current_section;<br class=3D""><br class=3D"">#ifdef= _WIN32<br class=3D""> _setmode (_fileno (stdin), = _O_BINARY);<br class=3D""> _setmode (_fileno (stdout), = _O_BINARY);<br class=3D"">#endif<br class=3D""><br class=3D""> = if (ov_open_callbacks (stdin, &vf, NULL, 0, = OV_CALLBACKS_NOCLOSE) < 0)<br class=3D""> {<br = class=3D""> fprintf (stderr, = "Input does not appear to be an Ogg bitstream.\n");<br class=3D""> = exit (1);<br class=3D""> = }<br class=3D""><br class=3D""> {<br = class=3D""> char** ptr =3D = ov_comment (&vf, -1)->user_comments;<br class=3D""> = vorbis_info* vi =3D ov_info = (&vf, -1);<br class=3D""><br class=3D""> = while (*ptr)<br class=3D""> = {<br class=3D""> = fprintf = (stderr, "%s\n", *ptr);<br class=3D""> = ++ptr;<b= r class=3D""> }<br = class=3D""><br class=3D""> = fprintf (stderr, "\nBitstream = is %d channel, %ldHz\n", vi->channels, vi->rate);<br class=3D""> = fprintf (stderr, "Encoded by: = %s\n\n", ov_comment (&vf, -1)->vendor);<br class=3D""> = fprintf (stderr, "Length: = %lld\n\n", ov_pcm_total(&vf, -1));<br class=3D""> = }<br class=3D""><br class=3D""> = return 0;<br class=3D"">}<br = class=3D"">_______________________________________________<br = class=3D"">Vorbis-dev mailing list<br class=3D""><a = href=3D"mailto:[email protected]" class=3D"">[email protected]</a><br = class=3D"">http://lists.xiph.org/mailman/listinfo/vorbis-dev<br = class=3D""></div></div></blockquote></div><br = class=3D""></div></body></html>= --Apple-Mail=_213993BC-0AD3-4810-A0DF-2FA10509EA84-- --===============0754775618941823206== Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: base64 Content-Disposition: inline X19fX19fX19fX19fX19fX19fX19fX19fX19fX19fX19fX19fX19fX19fX19fX18KVm9yYmlzIG1h aWxpbmcgbGlzdApWb3JiaXNAeGlwaC5vcmcKaHR0cDovL2xpc3RzLnhpcGgub3JnL21haWxtYW4v bGlzdGluZm8vdm9yYmlzCg== --===============0754775618941823206==--