Problem when seeking with oggmux/vorbisenc

classic Classic list List threaded Threaded
3 messages Options
Reply | Threaded
Open this post in threaded view
|

Problem when seeking with oggmux/vorbisenc

Tiago Katcipis
Hi,

I don't know if this is a problem or if I'm missing something. All I'm trying to do is to transcode audio, from any format (thanks to decodebin :-) to OGG/Vorbis. Just doing this for an entire file is pretty straightforward and the example code I'm providing already does that.

But when i try to extend it to seek to a specific position of the audio, and then transcoding, then i get some problems.

When i perform a non-flushing seek... the seek call hangs forever. If i perform a flushing seek everything goes "ok", but i end up with a messed up OGG file :-(.

When i transcode the entire file:

./ogg-seek-test <audio-src-file>
file /tmp/test.ogg
/tmp/test.ogg: Ogg data, Vorbis audio, mono, 8000 Hz, ~22400 bps, created by: Xiph.Org libVorbis I

play /tmp/test.ogg
/tmp/test.ogg:
 File Size: 369k      Bit Rate: 23.4k
  Encoding: Vorbis       
  Channels: 1 @ 16-bit  
Samplerate: 8000Hz      
Replaygain: off        
  Duration: 00:02:06.14

When i try to seek, to transcode only a part of the file:

./ogg-seek-test <audio-src> 10

file /tmp/test.ogg
/tmp/test.ogg: Ogg data

play /tmp/test.ogg
play FAIL formats: can't open input file `/tmp/test.ogg': Input not an Ogg Vorbis audio stream

The source code is here:
https://gitorious.org/katcipis-playground/playground/source/dfa5c8849e73ba15d15ea9dc11c1913d2685f5e0:c/gstreamer/oggmux-seek-test/ogg-seek-test.c


Any help is deeply appreciated.

Best regards,
Tiago Katcipis

_______________________________________________
gstreamer-devel mailing list
[hidden email]
http://lists.freedesktop.org/mailman/listinfo/gstreamer-devel
Reply | Threaded
Open this post in threaded view
|

Re: Problem when seeking with oggmux/vorbisenc

Thiago Santos
On 02/13/2014 02:16 PM, Tiago Katcipis wrote:
Hi,

Oi,


I don't know if this is a problem or if I'm missing something. All I'm trying to do is to transcode audio, from any format (thanks to decodebin :-) to OGG/Vorbis. Just doing this for an entire file is pretty straightforward and the example code I'm providing already does that.

But when i try to extend it to seek to a specific position of the audio, and then transcoding, then i get some problems.

When i perform a non-flushing seek... the seek call hangs forever. If i perform a flushing seek everything goes "ok", but i end up with a messed up OGG file :-(.

When i transcode the entire file:

./ogg-seek-test <audio-src-file>
file /tmp/test.ogg
/tmp/test.ogg: Ogg data, Vorbis audio, mono, 8000 Hz, ~22400 bps, created by: Xiph.Org libVorbis I

play /tmp/test.ogg
/tmp/test.ogg:
 File Size: 369k      Bit Rate: 23.4k
  Encoding: Vorbis       
  Channels: 1 @ 16-bit  
Samplerate: 8000Hz      
Replaygain: off        
  Duration: 00:02:06.14

When i try to seek, to transcode only a part of the file:

./ogg-seek-test <audio-src> 10

file /tmp/test.ogg
/tmp/test.ogg: Ogg data

play /tmp/test.ogg
play FAIL formats: can't open input file `/tmp/test.ogg': Input not an Ogg Vorbis audio stream

The source code is here:
https://gitorious.org/katcipis-playground/playground/source/dfa5c8849e73ba15d15ea9dc11c1913d2685f5e0:c/gstreamer/oggmux-seek-test/ogg-seek-test.c


Any help is deeply appreciated.

There was a bug in oggmux regarding proper flushing when handling a seek.

Just got fixed with commit a6890ec7ef69f34b38ae2c600f136b43574102e7 in gst-plugins-base git master.

Please report if it still doesn't work for you.

--
Cheers,
Thiago


Best regards,
Tiago Katcipis


_______________________________________________
gstreamer-devel mailing list
[hidden email]
http://lists.freedesktop.org/mailman/listinfo/gstreamer-devel


_______________________________________________
gstreamer-devel mailing list
[hidden email]
http://lists.freedesktop.org/mailman/listinfo/gstreamer-devel
Reply | Threaded
Open this post in threaded view
|

Re: Problem when seeking with oggmux/vorbisenc

Tiago Katcipis
Hi,


On Thu, Feb 13, 2014 at 5:24 PM, Thiago Santos <[hidden email]> wrote:
On 02/13/2014 02:16 PM, Tiago Katcipis wrote:
Hi,

Oi,


I don't know if this is a problem or if I'm missing something. All I'm trying to do is to transcode audio, from any format (thanks to decodebin :-) to OGG/Vorbis. Just doing this for an entire file is pretty straightforward and the example code I'm providing already does that.

But when i try to extend it to seek to a specific position of the audio, and then transcoding, then i get some problems.

When i perform a non-flushing seek... the seek call hangs forever. If i perform a flushing seek everything goes "ok", but i end up with a messed up OGG file :-(.

When i transcode the entire file:

./ogg-seek-test <audio-src-file>
file /tmp/test.ogg
/tmp/test.ogg: Ogg data, Vorbis audio, mono, 8000 Hz, ~22400 bps, created by: Xiph.Org libVorbis I

play /tmp/test.ogg
/tmp/test.ogg:
 File Size: 369k      Bit Rate: 23.4k
  Encoding: Vorbis       
  Channels: 1 @ 16-bit  
Samplerate: 8000Hz      
Replaygain: off        
  Duration: 00:02:06.14

When i try to seek, to transcode only a part of the file:

./ogg-seek-test <audio-src> 10

file /tmp/test.ogg
/tmp/test.ogg: Ogg data

play /tmp/test.ogg
play FAIL formats: can't open input file `/tmp/test.ogg': Input not an Ogg Vorbis audio stream

The source code is here:
https://gitorious.org/katcipis-playground/playground/source/dfa5c8849e73ba15d15ea9dc11c1913d2685f5e0:c/gstreamer/oggmux-seek-test/ogg-seek-test.c


Any help is deeply appreciated.

There was a bug in oggmux regarding proper flushing when handling a seek.

Just got fixed with commit a6890ec7ef69f34b38ae2c600f136b43574102e7 in gst-plugins-base git master.

That is good news :-)
 

Please report if it still doesn't work for you.

Ill check it out, sorry i didn't looked on the bug list, i really thought i was making some mistake :-). But i have another question, since we are talking about OGG/Vorbis.

I really need to use CBR on vorbisenc, but it don't matter how much i set it to be on a fixed bitrate the bitrate is still variable. If i run "file" on the ogg file it does says it has the right bitrate, but when i play it with "play" it have another bitrate (always a little higher than the one configured). Calculating the size manually also indicates the bitrate informed by play, so it seems that it is not respecting the configured bitrate.

For example i run:

gst-launch-1.0 pulsesrc ! audioconvert ! audioresample ! audio/x-raw,rate=8000,channels=1 ! vorbisenc managed=true min-bitrate=28000 bitrate=28000 max-bitrate=28000 ! oggmux ! filesink location=/tmp/test.ogg

I get:

file /tmp/test.ogg
/tmp/test.ogg: Ogg data, Vorbis audio, mono, 8000 Hz, <28000 ~28000 >28000 bps, created by: Xiph.Org libVorbis I

Its ok, but on play:
play /tmp/test.ogg
/tmp/test.ogg:
 File Size: 13.6k     Bit Rate: 35.9k

It seems that the bitrate cant be fixed, but i read that vorbis does support CBR.

Thanks for the help,
Tiago Katcipis


 

--
Cheers,
Thiago


Best regards,
Tiago Katcipis


_______________________________________________
gstreamer-devel mailing list
[hidden email]
http://lists.freedesktop.org/mailman/listinfo/gstreamer-devel


_______________________________________________
gstreamer-devel mailing list
[hidden email]
http://lists.freedesktop.org/mailman/listinfo/gstreamer-devel



_______________________________________________
gstreamer-devel mailing list
[hidden email]
http://lists.freedesktop.org/mailman/listinfo/gstreamer-devel