Displaying 20 results from an estimated 22 matches for "ogg_page_granulepos".
2002 Apr 16
1
Howto use ogg_page_granulepos for exact playback position?
I have the following problem.
Be an encoder application (station) and a decoder application (receiver).
If I feed the vorbis encoder with 'n' pcm samples in the station I want to
know how many pcm samples will be decoded in the receiver if I feed the
decoder with the encoded output. The ogg_page_granulepos is right for the
purpose?
I read the documentation about the ogg_page_granulepos function. There is
the following:
"Returns the exact granular position of the packet data contained at the end
of this page.
This is useful for tracking location when seeking or decoding.
For example, in audio co...
2009 May 13
2
Speex seek with high precision
...does just that, but it never
seeks exactly where it should. For example if I use oggz_seek_units(oggz,
18450, SEEK_SET) result it's 16386 and there is a delay between the playback
and the moment where it should start. Only when I seek to position 0 I get
the desired result.
I've also used ogg_page_granulepos for seeking but it seems more difficult
to use. I use something like this:
do
{
while (ogg_sync_pageout(&oy, &og) != 1)
{
data = ogg_sync_buffer(&oy, 512);
readbytes = fread(data, 1, 512, spxfile);
ogg_sync_wrote(&oy, read...
2009 May 16
1
Speex seek with high precision
...int nPages = 0;
int nPackets = 0;
// Pone el cursor en la posici?n inicial del fichero
fseek(fin, 0, SEEK_SET);
ogg_int64_t position = (this->seek_to * rate) / 1000;
ogg_int64_t granulepos;
do
{ // Skip pages until the page we want to seek
granulepos = ogg_page_granulepos(&og); // previous granulepos
while (ogg_sync_pageout(&oy, &og) != 1)
{
data = ogg_sync_buffer(&oy, 512);
nb_read = fread(data, 1, 512, fin);
ogg_sync_wrote(&oy, nb_read);
}
nPages++;
}
while (ogg_page...
2009 May 13
0
Speex seek with high precision
...#39;s 16386 and there is a delay between the playback
> and the moment where it should start. Only when I seek to position 0 I get
> the desired result.
ok, first up I'll mention that I'm rewriting the seeking part of
liboggz atm, so this is good feedback :-)
> I've also used ogg_page_granulepos for seeking but it seems more difficult
> to use. I use something like this:
>
> ??? do
> ??? {
> ??? ??? while (ogg_sync_pageout(&oy, &og) != 1)
> ??? ??? {
> ??? ??? ??? data = ogg_sync_buffer(&oy, 512);
> ??? ??? ??? readbytes = fread(data, 1, 512, spxfile);
&...
2009 May 16
2
Speex seek with high precision
Hello Conrad,
I'm trying to seek the way you told but I'm facing a problem.
ogg_page_packets returns 164 and following code returns 189. Shouldn't it be
the same, what does that means ?
int res;
while (true)
{
res = ogg_stream_packetout(&os, &op);
if (res == 1)
nPackets++;
if (res == -1)
2008 Jul 31
1
oggz fixes for macos
...s is an array bounds guard. I guess it's defensive programming vs
warning. Making OggzStreamContent a (signed) int is probably the
safest, but I don't know the rules for enums.
> oggz-chop.c: In function 'read_plain':
> oggz-chop.c:562: warning: passing argument 1 of 'ogg_page_granulepos'
> discards qualifiers from pointer target type
> oggz-chop.c:563: warning: passing argument 1 of 'ogg_page_granulepos'
> discards qualifiers from pointer target type
> oggz-chop.c: In function 'read_gs':
> oggz-chop.c:620: warning: passing argument 1 of 'ogg_...
2009 May 15
0
[PATCH] oggz: limit seeking to specified range
...= oggz_get_unit (oggz, serialno, granulepos);
}
}
+ if (unit_begin == -1 && oggz_seek_raw (oggz, offset_begin, SEEK_SET) >= 0) {
+ ogg_int64_t granulepos;
+ if (oggz_get_next_start_page (oggz, og) >= 0) {
+ serialno = ogg_page_serialno (og);
+ granulepos = ogg_page_granulepos (og);
+ unit_begin = oggz_get_unit (oggz, serialno, granulepos);
+ }
+ }
+
+ /* Fail if target isn't in specified range. */
+ if (unit_target < unit_begin || unit_target > unit_end)
+ return -1;
+
+ /* Reduce the search range if possible using read cursor position. */
+ if...
2004 Nov 16
0
metadata switches for ffmpeg2theora
...&& (e_o_s ||
+ ((info->videotime <= info->audiotime || info->video_only) && info->videoflag == 1))){
- info.videoflag = 0;
- while(ogg_stream_pageout (&info.to, &info.videopage) > 0){
- info.videotime=
- theora_granule_time (&info.td,ogg_page_granulepos(&info.videopage));
+ info->videoflag = 0;
+ while(ogg_stream_pageout (&info->to, &info->videopage) > 0){
+ info->videotime=
+ theora_granule_time (&info->td,ogg_page_granulepos(&info->videopage));
/* flush a video page */
- info.video_byte...
2010 Jun 04
2
OGGZ Seeking in Theora
...At the start of seeking, set the Packet-/Page-Callback to a new
"Seek"-Callback
b) A first OGGZ seek jumps to the desired frame number.
c) OGGZ read() with some Bytes is called until the Seek-Packet/Page
Callback was executed
d) In the callback function, I get the granule pos
(ogg_page_granulepos or oggz_tell_granulepos?), then I extract the
keyframe number by shifting the granule position.
e) A final OGGZ seek is made to the calculated keyframe number.
f) Set callback(s) back to the actual data decoding functions.
As the callbacks are being called asynchronously, I'm not even s...
2004 Mar 13
1
Ogg / Vorbis Compiling under W32 with MingW ** Problem **
...include/ogg/ogg.h:173: parse error before '*' token
../include/ogg/ogg.h:174: parse error before '*' token
../include/ogg/ogg.h:175: parse error before '*' token
../include/ogg/ogg.h:176: parse error before '*' token
../include/ogg/ogg.h:184: parse error before "ogg_page_granulepos"
../include/ogg/ogg.h:184: warning: data definition has no type or
storage class
../include/ogg/ogg.h:189: parse error before '*' token
framing.c:45: parse error before "ogg_page_granulepos"
framing.c: In function `ogg_page_granulepos':
framing.c:47: parse error before &...
2002 Mar 10
3
Finding length (time) of encoded birstream
I'm adding some final features to my CD Ripper and Encoder before the full,
version 1 release. As part of that release, the program will offer the
ability to play (for review purposes) both WAV and OGG files. I have both
the decoder and playback code working but I have one final issue to resolve:
finding the play time for the Vorbis bitstream that is being played back. I
used the
2012 Oct 19
3
How to cross-compile opus-tools?
...rence to `ogg_stream_packetin'
/home/user/source/opus-tools/src/opusenc.c:878: undefined reference to `ogg_stream_flush_fill'
/home/user/source/opus-tools/src/opusenc.c:881: undefined reference to `ogg_page_packets'
/home/user/source/opus-tools/src/opusenc.c:881: undefined reference to `ogg_page_granulepos'
/home/user/source/opus-tools/src/opusenc.c:828: undefined reference to `ogg_stream_flush_fill'
/home/user/source/opus-tools/src/opusenc.c:830: undefined reference to `ogg_page_packets'
/home/user/source/opus-tools/src/opusenc.c:830: undefined reference to `ogg_page_granulepos'
/hom...
2007 Apr 12
0
Seek problem 1 - can't find frame number
...ind the next theora page
while ((result = ogg_sync_pageout(&sync, &page)) == 0)
bufferData();
while (ogg_page_serialno(&page) != tstream.serialno)
if (ogg_sync_pageout(&sync, &page) <= 0)
bufferData();
const ogg_int64_t actualFrame =
theora_granule_frame(&decoder, ogg_page_granulepos(&page));
With some files, this code works fine. But with others, the framenumbers I get
at the end have absolutely no resemblance to actual framenumbers. Sometimes
they are even an order of magnitude off.
Do I have to reinitialize the decode after each jump, just to be able to find
the fra...
2002 Jul 15
2
headers not correctly framed?!
Hi,
when I encode some files with the current CVS I get the following error with ogginfo:
[...]
New logical stream (#1, serial: 476aea05): type vorbis
Warning: Vorbis stream 1 does not have headers correctly framed. Terminal header page contains additional packets or has non-zero granulepos
Vorbis headers parsed for stream 1, information follows...
Version: 0
Vendor: Xiph.Org libVorbis I 20020713
2011 Mar 15
3
Time in video file
...9 fps. Since Theora is fed with a
framerate which isn't precise the time of each frame when I play it in
VLC doesn't match the exact time of when the frame occurred. So
basically I wonder how can I sync a video frame to a clock using
Theora and Ogg?
I tried looking at?th_granule_time() and?ogg_page_granulepos() but
they seem to be concerned with the frame number and not time of the
frame.
Thanks for a great video codec!
Regards
Bjoern
2005 Oct 05
1
Simple encodig sample...
...o page flushed? If not, fetch one if possible */
ret = fetch_video_page( &videopage, &to, &td );
/* no pages of either? Must be end of stream. */
if( ret == STREAM_EOS )
break;
/* Flush to stream */
videotime = theora_granule_time( &td,ogg_page_granulepos(
&videopage ) );
/* flush a video page */
video_bytesout += fwrite( videopage.header, 1,
videopage.header_len, outfile );
video_bytesout += fwrite( videopage.body, 1, videopage.body_len,
outfile );
timebase = videotime;
{
int hundredths =...
2006 Aug 30
2
Continued:How can I seek in Ogg Vorbis file, but not using Vorbisfile library?
Hello, All.
First, I want to thank Ian Malone and Ralph Giles, thanks for your kind replies. But I still have problems about seek.
As you suggested, I could use ov_open_callbacks() to supply my own read/write/seek functions. So, can you give me an example? I?m sorry for my ignorance, because I haven?t used callbacks before.
I analyzed the vorbisfile.c in Tremor, and I think I
2006 Apr 05
12
Stream Test
Hi
Seeing as other people are posting streams to test, the system I have been
developing has an Ogg/Vorbis/Theora stream that you can watch. I would
appreciate any feedback to what players can play it and which players have
problems. (I am using Icecast as the streaming server)
So far I have found VideoLan plays the stream very well. MPlayer was ok,
but wasn't as good at buffering.
2004 Jun 18
5
Patch to stop vcut from generating broken streams
Skipped content of type multipart/mixed-------------- next part --------------
A non-text attachment was scrubbed...
Name: not available
Type: application/pgp-signature
Size: 189 bytes
Desc: Digital signature
Url : http://westfish.xiph.org/pipermail/vorbis-dev/attachments/20040618/e7bee431/attachment.pgp
2008 Apr 04
0
speexdec 1.2.3
...stream_init = 1;
}
if (ogg_page_serialno(&og) != os.serialno) {
/* so all streams are read. */
ogg_stream_reset_serialno(&os, ogg_page_serialno(&og));
}
/*Add page to the bitstream*/
ogg_stream_pagein(&os, &og);
page_granule = ogg_page_granulepos(&og);
page_nb_packets = ogg_page_packets(&og);
if (page_granule>0 && frame_size)
{
/* FIXME: shift the granule values if --force-* is specified */
skip_samples = frame_size*(page_nb_packets*granule_frame_size*nframes - (page_gran...