From: Daniel Verkamp via ffmpeg-devel <ffmpeg-devel@ffmpeg.org>
To: FFmpeg development discussions and patches <ffmpeg-devel@ffmpeg.org>
Cc: "Jason A. Donenfeld" <Jason@zx2c4.com>, Daniel Verkamp <daniel@drv.nu>
Subject: [FFmpeg-devel] Re: [PATCH] avformat/wavenc: use RF64 when needed
Date: Mon, 29 Dec 2025 20:50:17 -0800
Message-ID: <CAGFXeQLGp3iNO5gee=AC7sskCcFQ6nor0pY9JTErKV6wUsELrw@mail.gmail.com> (raw)
In-Reply-To: <20251220212839.2451047-1-Jason@zx2c4.com>
On Sat, Dec 20, 2025 at 1:29 PM Jason A. Donenfeld via ffmpeg-devel
<ffmpeg-devel@ffmpeg.org> wrote:
>
> Currently if you encode a large wav, ffmpeg will hint after the fact
> that the resultant file is corrupted, because traditional wav cannot
> handle lengths greater than 32-bits. This isn't very useful; nobody
> benefits from getting garbage files.
>
> You can manually work around this by adding `-rf64 always`, which most
> players have support for. Most people don't remember to do this until
> after the fact when their file is corrupted, or they don't figure it out
> at all and wind up using the w64 container instead.
>
> And so that's what `-rf64 auto` is for. It uses the larger format when
> needed, and if not, uses the traditional wav that is probably more
> compatible. The result of using `-rf64 auto` is that you can add it to
> every command line -- and should add it to every command line -- to get
> either a normal small file, or a non-corrupt large file.
>
> This is a very sensible default to have on, rather than just producing
> corrupt files and having users scrambling for solutions, and then having
> to do a potentially expensive reencode after. With `-rf64 auto` on by
> default, the user always gets a readable good file. And for users who
> sometimes want corrupt files, there still exists `-rf64 never` that can
> be enabled.
> ---
Hi,
I am not opposed to changing the default, but I recall there were some
reports of problems[1] when ffmpeg began to stray from the "classic"
WAV file layout.
The `-rf64 auto` option adds an extra junk chunk near the beginning of
the file, before the "fmt " chunk, to reserve space for the extended
header if needed. While most WAV-consuming software will ignore
unknown chunk types gracefully, some tools assume a fixed header
layout and will produce garbage audio data when reading a file with
extra header chunks or with "fmt " not being the first chunk (at least
this is my vague recollection when looking into this some time ago).
That said, these issues happened years ago, and perhaps most software
is fixed by now (and arguably, any software that does not handle these
files is buggy); on the other hand, attempting to put more than 4 GB
of audio data in a WAV file is probably pretty uncommon, and there are
other formats that can handle large audio data if the specific format
doesn't have to be WAV. (WAV probably has better name recognition,
though.)
Thanks,
-- Daniel
[1]: A related mailing list thread from 2013, which unfortunately
doesn't name the specific broken software:
https://ffmpeg.org/pipermail/ffmpeg-devel/2013-April/thread.html#142560
_______________________________________________
ffmpeg-devel mailing list -- ffmpeg-devel@ffmpeg.org
To unsubscribe send an email to ffmpeg-devel-leave@ffmpeg.org
next prev parent reply other threads:[~2025-12-30 4:54 UTC|newest]
Thread overview: 7+ messages / expand[flat|nested] mbox.gz Atom feed top
2025-12-20 21:28 [FFmpeg-devel] " Jason A. Donenfeld via ffmpeg-devel
2025-12-21 3:08 ` [FFmpeg-devel] " Michael Niedermayer via ffmpeg-devel
2025-12-30 4:50 ` Daniel Verkamp via ffmpeg-devel [this message]
2025-12-30 11:17 ` Jason A. Donenfeld via ffmpeg-devel
2025-12-31 7:43 ` Daniel Verkamp via ffmpeg-devel
2025-12-31 12:53 ` Jason A. Donenfeld via ffmpeg-devel
2026-01-02 23:27 ` Michael Niedermayer via ffmpeg-devel
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to='CAGFXeQLGp3iNO5gee=AC7sskCcFQ6nor0pY9JTErKV6wUsELrw@mail.gmail.com' \
--to=ffmpeg-devel@ffmpeg.org \
--cc=Jason@zx2c4.com \
--cc=daniel@drv.nu \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Git Inbox Mirror of the ffmpeg-devel mailing list - see https://ffmpeg.org/mailman/listinfo/ffmpeg-devel
This inbox may be cloned and mirrored by anyone:
git clone --mirror https://master.gitmailbox.com/ffmpegdev/0 ffmpegdev/git/0.git
# If you have public-inbox 1.1+ installed, you may
# initialize and index your mirror using the following commands:
public-inbox-init -V2 ffmpegdev ffmpegdev/ https://master.gitmailbox.com/ffmpegdev \
ffmpegdev@gitmailbox.com
public-inbox-index ffmpegdev
Example config snippet for mirrors.
AGPL code for this site: git clone https://public-inbox.org/public-inbox.git