<div dir="ltr"><div><div><div><div><div><div><div>Hi,<br><br></div>I don't know if this is a problem or if I'm missing something. All I'm trying to do is to <span style class="">transcode</span> audio, from any format (thanks to <span style class="">decodebin</span> :-) to <span style class="">OGG</span>/<span style class="">Vorbis</span>. Just doing this for an entire file is pretty straightforward and the example code I'm providing already does that.<br>
<br></div>But when i try to extend it to seek to a specific position of the audio, and then <span style class="">transcoding</span>, then i get some problems.<br><br></div>When i perform a non-flushing seek... the seek call hangs forever. If i perform a flushing seek everything goes "<span style class="">ok</span>", but i end up with a messed up <span style class="">OGG</span> file :-(.<br>
<br></div>When i <span style class="">transcode</span> the entire file:<br><br>./<span style class="">ogg</span>-seek-test <audio-<span style class="">src</span>-file><br>file /<span style class="">tmp</span>/test.<span style class="">ogg</span><br>
/<span style class="">tmp</span>/test.<span style class="">ogg</span>: <span style class="">Ogg</span> data, <span style class="">Vorbis</span> audio, mono, 8000 Hz, ~22400 bps, created by: <span style class="">Xiph</span>.Org <span style class="">libVorbis</span> I<br>
<br>play /<span style class="">tmp</span>/test.<span style class="">ogg</span><br>/<span style class="">tmp</span>/test.<span style class="">ogg</span>:<br> File Size: 369k      Bit Rate: 23.4k<br>  Encoding: <span style class="">Vorbis</span>        <br>
  Channels: 1 @ 16-bit   <br><span style class="">Samplerate</span>: 8000Hz       <br><span style class="">Replaygain</span>: off         <br>  Duration: 00:02:06.14<br><br>When i try to seek, to <span style class="">transcode</span> only a part of the file:<br>
<br>./<span style class="">ogg</span>-seek-test <audio-<span style class="">src</span>> 10<br><br>file /<span style class="">tmp</span>/test.<span style class="">ogg</span><br>/<span style class="">tmp</span>/test.<span style class="">ogg</span>: <span style class="">Ogg</span> data<br>
<br>play /<span style class="">tmp</span>/test.<span style class="">ogg</span><br>play FAIL formats: can't open input file `/<span style class="">tmp</span>/test.ogg': Input not an <span style class="">Ogg</span> <span style class="">Vorbis</span> audio stream<br>
<br></div>The source code is here:<br>https://<span style class="">gitorious</span>.org/<span style class="">katcipis</span>-playground/playground/source/dfa5c8849e73ba15d15ea9dc11c1913d2685f5e0:c/<span style class="">gstreamer</span>/<span style class="">oggmux</span>-seek-test/<span style class="">ogg</span>-seek-test.c<br>
<br><br></div>Any help is deeply appreciated.<br><br></div>Best regards,<br><span style class="">Tiago</span> <span style class="">Katcipis</span><br></div>