Open vlakoff opened 6 days ago
On second thought, I think the first solution (allow to use --skip
with a negative value) would be the best.
Consider it this way: --skip
and --until
are used to define a slice. In most cases, only one option is used, so the slice just goes until the start or the end of the file. But the two options can perfectly be used simultaneously. --skip
specifies the start point, and --until
the end point (absolute from the file start, from the file end, or relative from --skip
). Therefore, being able to specify the start point counting from the file end would nicely complement the existing possibilities.
FLAC is a lossless audio compressor, not audio editing software. To be honest, I'd rather be rid of --skip
and --until
altogether, because it makes the code quite complex in certain places.
I have an use case where I need to decode only about the last 10 ms of the files.
Here are the currently available options in the
flac
tool:These options don't directly suit my case. Currently, I have to use
ffprobe
to get the duration of the file, then substract from this duration and use--skip
with that result.I could suggest two solutions:
--skip
with a negative value, which would determinate the "break point" counting from the end. But maybe people would argue that it is confusing.--keep
option. With a positive value, keep the N samples from the beginning, and with a negative value, keep the N samples from the end. Sounds simple and straightforward, and would nicely complement the existing options.--keep
would be ambiguous (as there as other things such as "keep metadata" for instance). I could also suggest--only
(I don't like this one much… it's even more ambiguous), or--slice
(I like this one! unambiguous, and descriptive).