Please excuse me, I haven't yet dug into the code too far. What I'd like to do: I'm using ecasound to record for 24 hour periods, which pipes the output directly to flac. I would like to be able to decode sections of this (using until/skip) during recording/encoding. I understand currently that flac can't do this, unless I pipe into dd to skip after decoding (which would be an incredible waste of resources). Would it be possible to write the seektable dynamically (would that be a bit of a cpu hog?), or is there possibly a better way I'm not thinking of? I'm not asking for anyone to code, I could attempt hack something for my purposes. Thanks! -- avuton -- Anyone who quotes me in their sig is an idiot. -- Rusty Russell.
--- Avuton Olrich <avuton@gmail.com> wrote:> What I'd like to do: I'm using ecasound to record for 24 hour > periods, > which pipes the output directly to flac. I would like to be able to > decode sections of this (using until/skip) during recording/encoding. > > I understand currently that flac can't do this, unless I pipe into dd > to skip after decoding (which would be an incredible waste of > resources). Would it be possible to write the seektable dynamically > (would that be a bit of a cpu hog?), or is there possibly a better > way > I'm not thinking of?first question, does your seek have to be sample-accurate? if not, you can get frame-accurate seeking by building a little proggie to scan by frame headers looking for a nearby frame_number*blocksize sample number, then forge a STREAMINFO block and cat it + the flac file from that offset to another copy of 'flac -d -' with no --skip argument. the other thing is, are you using --input-size? I think if you do, the total_samples count in the STREAMINFO block should be written up front and seek should work, but just slower since the seektable is not built yet. flac decoding is pretty fast though, maybe just skipping the pcm samples with dd is not so bad? writing the SEEKTABLE in bits is an interesting idea but would be pretty hard. Josh __________________________________________________ Do You Yahoo!? Tired of spam? Yahoo! Mail has the best spam protection around http://mail.yahoo.com
On 6/19/06, Josh Coalson <xflac@yahoo.com> wrote:> --- Avuton Olrich <avuton@gmail.com> wrote: > > What I'd like to do: I'm using ecasound to record for 24 hour > > periods, > > which pipes the output directly to flac. I would like to be able to > > decode sections of this (using until/skip) during recording/encoding. > > > > I understand currently that flac can't do this, unless I pipe into dd > > to skip after decoding (which would be an incredible waste of > > resources). Would it be possible to write the seektable dynamically > > (would that be a bit of a cpu hog?), or is there possibly a better > > way > > I'm not thinking of?[..]> the other thing is, are you using --input-size? I think if you[..]> Josh--input-size is exactly what I was looking for, I looked through the args one by one but somehow still missed that one. With that I am able to get to my goal (without coding!). Thanks alot! -- avuton -- Anyone who quotes me in their sig is an idiot. -- Rusty Russell.