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