[Flac-dev] flac seektable during encoding
Josh Coalson
xflac at yahoo.com
Mon Jun 19 15:58:30 PDT 2006
--- Avuton Olrich <avuton at 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
More information about the Flac-dev
mailing list