Menu

#6 Broken pipe/stdin support in ttaenc.exe

v1.0_(example)
closed
nobody
None
8
2015-02-24
2009-12-27
roozhou
No

stdin in ttaenc isn't working. You cannot use ttaenc.exe with foobar2000, mplayer/mencoder/ffmpeg or other cmdline tools. There are two problems in function compress() :

1) Trying to seek backwards if there is no id3v2 tag. You cannot seek backwards in a pipe.
2) Must know PCM length before encoding. Unlike other container formats, tta writes a variable size seek table at the beginning of the file. Unfortunately while reading from stdin SubchunkSize should be ignored and the encoder should read until EOF. This also allows larger than 4GB PCM, but it seems samples in tta is limited to 4G.

Problem 1 is easy to fix.

My solution to problem 2:
1) Allocate a large enough seek table or use a linked list.
2) After encoding finishes, update the tta header and seek table, then truncate the unwanted part of seek table by move frame bytes backwards. This requires extra processing time if the output file is larger than disk cache but there is no better ways.

And the stdout support in ttaenc is also a joke. You have to write a non-seekable tta file since you cannot seek to the beginning and update seek table after writing to a pipe.

Discussion

  • roozhou

    roozhou - 2009-12-27
    • priority: 5 --> 8
     
  • Aleksander Djuric

    • status: open --> closed
    • Group: --> v1.0_(example)
     

Log in to post a comment.