Opened 6 years ago

Last modified 6 years ago

#7155 reopened enhancement

Add option to stop writing at position relative to EOF

Reported by: clone206 Owned by:
Priority: wish Component: ffmpeg
Version: unspecified Keywords:
Cc: ffmpeg@gyani.pro Blocked By:
Blocking: Reproduced by developer: no
Analyzed by developer: no

Description

Summary of the bug:
Feature request
How to reproduce:
N/A

Add main option to allow stopping of writing to output at position relative to "end of file", where 0 is eof, and negative values are earlier in the file.

Proposed switch: "-toeof", like "-sseof" but for stopping point instead of beginning point.

Background: I have ripped SACD audio tracks with extraneous loud noises at the last few hundred milliseconds of each track, and want to chop off that duration from the end of each file as part of a batch process. I would like to do something like the following on each file:

ffmpeg -i input.flac -toeof -00:00:00.9 output.flac

Change History (14)

in reply to:  description comment:1 by Carl Eugen Hoyos, 6 years ago

Component: ffmpegundetermined
Keywords: seek removed
Priority: wishnormal
Resolution: invalid
Status: newclosed
Type: enhancementdefect
Version: 3.4unspecified

Replying to clone206:
No new options can be requested for releases and I don't think this can be implemented.

Background: I have ripped SACD audio tracks with extraneous loud noises at the last few hundred milliseconds of each track, and want to chop off that duration from the end of each file as part of a batch process. I would like to do something like the following on each file:

Instead, please explain how we can reproduce (and fix) this bug.

comment:2 by clone206, 6 years ago

This is not a bug that needs fixing. It's a feature request. Are you saying you don't accept feature requests, or rather that because I chose a release number the feature request is invalid?

I'm quite certain it could be implemented, since you already basically did the same thing with the -sseof option.

comment:3 by clone206, 6 years ago

Resolution: invalid
Status: closedreopened

comment:4 by clone206, 6 years ago

Type: defectenhancement

comment:5 by Gyan, 6 years ago

Cc: ffmpeg@gyani.pro added

comment:6 by withmorten, 6 years ago

Hi clone206,

I ran into a similar problem this week when I wanted to cut off one second of silence at the end of some files which I had added earlier (with ffmpeg).

It wasn't too hard to implement and can probably be improved on sanity check-wise, but it works for my purposes and can probably be used as a good starting point for properly implementing this by somebody who knows how ffmpeg is supposed to work:

https://gist.github.com/withmorten/ea585798076fa020b757437f23aca768

Diffed against ffmpeg 3.4.2.

It only works as input option (duration seemed to be unknown in open_output_file), so you'll have to use it like:

ffmpeg -toeof -00:00:00.9 -i input.flac output.flac

It basically makes the input file shorter by whatever amount you tell it.

Not entirely sure why this would be impossible to implement ...?

comment:7 by clone206, 6 years ago

Thanks, withmorten! That's basically exactly the way I would've done it. Might be worth forking the current github and making a pull request, though I don't know if Gyan is already working on it.

comment:8 by Gyan, 6 years ago

Generate a patch against git master and send it to the mailing list.

comment:9 by withmorten, 6 years ago

Should I modify the ffmpeg.texi file as well to include the new commandline switch?

Such as:

@item -toeof @var{position} (@emph{input})
Stop writing the output at @var{position} relative to the "end of file". That is negative
values are later in the file, 0 is at EOF.

Last edited 6 years ago by withmorten (previous) (diff)

comment:10 by Gyan, 6 years ago

Please do. Thanks.

comment:11 by Carl Eugen Hoyos, 6 years ago

Component: undeterminedffmpeg
Priority: normalwish

I didn't consider -sseof working for any interpretation but if that is what you need, it may be possible.

Please do not forget to report the original bug, it would be nice to fix it.

comment:12 by clone206, 6 years ago

cehoyos,

In what way is -sseof not working? For those of us interested in possibly contributing, it would be good to know, as I haven't had any issues with that option, which has been available for some time now.

Also, sorry if it wasn't clear, but I never reported a bug that needs fixing, but rather a feature request. If there is any documentation on how to properly make a feature request I would gladly familiarize myself with it.

in reply to:  12 comment:13 by Carl Eugen Hoyos, 6 years ago

Replying to clone206:

Also, sorry if it wasn't clear, but I never reported a bug

This is not true, you just didn't explain how we can reproduce.

comment:14 by clone206, 6 years ago

Reproduce what?

Note: See TracTickets for help on using tickets.