Opened 5 years ago

Last modified 5 years ago

#1771 open defect

The file size limit almost never works.

Reported by: agusdallalba Owned by:
Priority: minor Component: documentation
Version: git-master Keywords: limit_size
Cc: Blocked By:
Blocking: Reproduced by developer: yes
Analyzed by developer: no

Description

Just what it says on the tin. I couldn't find a single file-codec combination such that ffmpeg obeys the file size limit imposed with the -fs switch. It always overshoots.

How to reproduce:

  1. Pick any file
  2. Transcode/remux/cut it with ffmpeg while specifying a file size limit with -fs
  3. Measure the size of the resulting file. It's almost always slightly bigger than requested.

Change History (4)

comment:1 follow-up: Changed 5 years ago by cehoyos

  • Component changed from undetermined to documentation
  • Priority changed from normal to minor
  • Reproduced by developer set
  • Status changed from new to open

Imo, this is a documentation issue.

comment:2 Changed 5 years ago by agusdallalba

So it's supposed to work this way? Should I make this ticket a feature request then or open a new one?

comment:3 in reply to: ↑ 1 ; follow-up: Changed 5 years ago by saste

Replying to cehoyos:

Imo, this is a documentation issue.

IMO, this is a bug. If the user needs this option, it is because she usually has an upper bound size constraint, getting a "slightly bigger" file is not very helpful. Thus the behaviour should be changed.
On the other hand, the additional size may be due to the format trailer, which is not always (easily) predictable, so that may be the reason of the observed behavior.

comment:4 in reply to: ↑ 3 Changed 5 years ago by agusdallalba

Replying to saste:

On the other hand, the additional size may be due to the format trailer, which is not always (easily) predictable, so that may be the reason of the observed behavior.

I tried with ffmpeg -i dinah.mp4 -an -f rawvideo -fs xxxx -y out.raw, where dinah.mp4 is a yuv420p 480x360 video. Each frame is (6B/4px)*480*360px = 259200 bytes of raw video. Coincidentally out.raw is always the smallest multiple of 259200 bytes that's bigger than xxxx in the command line.

Note: See TracTickets for help on using tickets.