[FFmpeg-devel] [PATCH v2 9/9] avformat/pcm: decrease target audio frame per sec to 10
Tobias Rapp
t.rapp at noa-archive.com
Thu Mar 14 10:10:16 EET 2024
On 08/03/2024 01:53, Marton Balint wrote:
> This makes the wav and pcm demuxer demux bigger packets, which is more
> efficient.
>
> Signed-off-by: Marton Balint<cus at passwd.hu>
> ---
> libavformat/pcm.c | 2 +-
> tests/ref/acodec/pcm-s16be | 2 +-
> tests/ref/acodec/pcm-s16be_planar | 4 +-
> tests/ref/acodec/pcm-s16le_planar | 4 +-
> tests/ref/acodec/pcm-s24be | 2 +-
> tests/ref/acodec/pcm-s24le_planar | 4 +-
> tests/ref/acodec/pcm-s32be | 2 +-
> tests/ref/acodec/pcm-s32le_planar | 4 +-
> tests/ref/acodec/pcm-s8_planar | 4 +-
> tests/ref/acodec/pcm-u16be | 4 +-
> tests/ref/acodec/pcm-u16le | 4 +-
> tests/ref/acodec/pcm-u24be | 4 +-
> tests/ref/acodec/pcm-u24le | 4 +-
> tests/ref/acodec/pcm-u32be | 4 +-
> tests/ref/acodec/pcm-u32le | 4 +-
> tests/ref/acodec/s302m | 8 +-
> tests/ref/fate/dcinema-encode | 63 +-
> tests/ref/fate/filter-acrossfade | 623 ++++--------------
> tests/ref/fate/filter-adelay | 324 ++-------
> tests/ref/fate/filter-aecho | 324 ++-------
> tests/ref/fate/filter-aemphasis-50fm | 324 ++-------
> tests/ref/fate/filter-aemphasis-75kf | 324 ++-------
> tests/ref/fate/filter-afade-esin | 324 ++-------
> tests/ref/fate/filter-afade-exp | 324 ++-------
> tests/ref/fate/filter-afade-hsin | 324 ++-------
> tests/ref/fate/filter-afade-iqsin | 324 ++-------
> tests/ref/fate/filter-afade-log | 324 ++-------
> tests/ref/fate/filter-afade-qsin | 324 ++-------
> tests/ref/fate/filter-agate | 324 ++-------
> tests/ref/fate/filter-alimiter | 324 ++-------
> tests/ref/fate/filter-amerge | 324 ++-------
> tests/ref/fate/filter-anequalizer | 324 ++-------
> tests/ref/fate/filter-apad | 324 ++-------
> .../ref/fate/filter-asegment-samples-absolute | 324 ++-------
> .../ref/fate/filter-asegment-samples-relative | 324 ++-------
> .../fate/filter-asegment-timestamps-absolute | 326 ++-------
> .../fate/filter-asegment-timestamps-relative | 326 ++-------
> tests/ref/fate/filter-asetrate | 40 +-
> tests/ref/fate/filter-atrim-mixed | 4 +-
> tests/ref/fate/filter-atrim-time | 5 +-
> tests/ref/fate/filter-chorus | 20 +-
> tests/ref/fate/filter-compand | 40 +-
> tests/ref/fate/filter-crystalizer | 324 ++-------
> tests/ref/fate/filter-dcshift | 40 +-
> tests/ref/fate/filter-earwax | 40 +-
> tests/ref/fate/filter-extrastereo | 40 +-
> tests/ref/fate/filter-pan-downmix1 | 40 +-
> tests/ref/fate/filter-pan-downmix2 | 40 +-
> tests/ref/fate/filter-pan-mono1 | 40 +-
> tests/ref/fate/filter-pan-mono2 | 40 +-
> tests/ref/fate/filter-pan-stereo1 | 40 +-
> tests/ref/fate/filter-pan-stereo2 | 40 +-
> tests/ref/fate/filter-pan-stereo3 | 40 +-
> tests/ref/fate/filter-pan-stereo4 | 40 +-
> tests/ref/fate/filter-pan-upmix1 | 40 +-
> tests/ref/fate/filter-pan-upmix2 | 40 +-
> tests/ref/fate/filter-stereotools | 40 +-
> tests/ref/fate/flcl1905 | 612 ++++++++---------
> tests/ref/fate/g722-encode | 282 +++-----
> tests/ref/fate/g726-encode-2bit | 282 +++-----
> tests/ref/fate/g726-encode-3bit | 282 +++-----
> tests/ref/fate/g726-encode-4bit | 282 +++-----
> tests/ref/fate/g726-encode-5bit | 282 +++-----
> tests/ref/fate/matroska-move-cues-to-front | 18 +-
> tests/ref/fate/mov-channel-description | 4 +-
> tests/ref/fate/mov-mp4-pcm | 4 +-
> tests/ref/fate/mov-mp4-pcm-float | 2 +-
> tests/ref/lavf/ast | 4 +-
> tests/ref/lavf/mov | 12 +-
> tests/ref/lavf/mov_rtphint | 4 +-
> tests/ref/lavf/s16.voc | 4 +-
> tests/ref/lavf/smjpeg | 6 +-
> tests/ref/lavf/voc | 4 +-
> tests/ref/seek/acodec-adpcm-ima_wav | 54 +-
> tests/ref/seek/acodec-adpcm-ima_wav-trellis | 54 +-
> tests/ref/seek/acodec-adpcm-ms | 54 +-
> tests/ref/seek/acodec-adpcm-ms-trellis | 54 +-
> tests/ref/seek/acodec-adpcm-yamaha | 54 +-
> tests/ref/seek/acodec-adpcm-yamaha-trellis | 54 +-
> tests/ref/seek/acodec-pcm-alaw | 54 +-
> tests/ref/seek/acodec-pcm-f32be | 54 +-
> tests/ref/seek/acodec-pcm-f32le | 54 +-
> tests/ref/seek/acodec-pcm-f64be | 54 +-
> tests/ref/seek/acodec-pcm-f64le | 54 +-
> tests/ref/seek/acodec-pcm-mulaw | 54 +-
> tests/ref/seek/acodec-pcm-s16le | 54 +-
> tests/ref/seek/acodec-pcm-s24le | 54 +-
> tests/ref/seek/acodec-pcm-s32le | 54 +-
> tests/ref/seek/acodec-pcm-u8 | 54 +-
> tests/ref/seek/lavf-al | 46 +-
> tests/ref/seek/lavf-au | 30 +-
> tests/ref/seek/lavf-mov | 44 +-
> tests/ref/seek/lavf-ul | 46 +-
> tests/ref/seek/lavf-voc | 22 +-
> tests/ref/seek/lavf-wav | 30 +-
> 95 files changed, 3153 insertions(+), 7912 deletions(-)
>
> diff --git a/libavformat/pcm.c b/libavformat/pcm.c
> index b7728dd15e..314275bb0a 100644
> --- a/libavformat/pcm.c
> +++ b/libavformat/pcm.c
> @@ -25,7 +25,7 @@
> #include "internal.h"
> #include "pcm.h"
>
> -#define PCM_DEMUX_TARGET_FPS 25
> +#define PCM_DEMUX_TARGET_FPS 10
>
> int ff_pcm_default_packet_size(AVCodecParameters *par)
> {
>
> [...]
>
> diff --git a/tests/ref/fate/dcinema-encode b/tests/ref/fate/dcinema-encode
> index ce5e9d2550..9c2b6f72f1 100644
> --- a/tests/ref/fate/dcinema-encode
> +++ b/tests/ref/fate/dcinema-encode
> @@ -27,4 +27,65 @@
> 0, 34000, 34000, 2000, 24000, acffdfa3337a082091398ac8085882e1
> 0, 36000, 36000, 2000, 24000, 5daaa9b578b92270de0394baadf37a2c
> 0, 38000, 38000, 2000, 24000, 67a3b8af025b212a62229ae57f99f7a6
> -0, 40000, 40000, 960, 11520, c6d89c32b3337e204245ec6f8d144aef
> +0, 40000, 40000, 2000, 24000, e8f6f41edfdf4b198055349e90f36cd4
> +0, 42000, 42000, 2000, 24000, 43d7cd1917a7e1ecfcae1c762a4f8284
> +0, 44000, 44000, 2000, 24000, 21cc3c1b9dc3994df6ce90cc3f0bf03d
> +0, 46000, 46000, 2000, 24000, 763a76a1dca46e743fbe1ef90dac1b68
> +0, 48000, 48000, 2000, 24000, 5d307e637e1dc4218d88e48a0189beb0
> +0, 50000, 50000, 2000, 24000, dafc392287225811c1cb1c813789f2b8
> +0, 52000, 52000, 2000, 24000, c1a58740c9b731bc1f2702dc56ba3cd6
> +0, 54000, 54000, 2000, 24000, 891e6d94c34a60e24925ea28f19ccf2a
> +0, 56000, 56000, 2000, 24000, afc88ea476094f7b5accb8ca080a69a5
> +0, 58000, 58000, 2000, 24000, 74ab38c75d3810f7bf74901305eab47c
> +0, 60000, 60000, 2000, 24000, 838144d8da6a6eca8aef01195b430363
> +0, 62000, 62000, 2000, 24000, ebfb8a30c334061361241fd53067b416
> +0, 64000, 64000, 2000, 24000, 83324adc64db2f46a94363bf04a60773
> +0, 66000, 66000, 2000, 24000, 34606f116338b7045515c3b56e1633f9
> +0, 68000, 68000, 2000, 24000, 7450cc8b2c3746380140a47a47b41b73
> +0, 70000, 70000, 2000, 24000, 0f6d7bc6adf2facbd72403b17d035bf5
> +0, 72000, 72000, 2000, 24000, 844f2585154aa770ebe4df514c6139af
> +0, 74000, 74000, 2000, 24000, 36b5914af624b3f301bce43c42ec0523
> +0, 76000, 76000, 2000, 24000, 9fc415ae7ae0db7f9be51a2a5654bafd
> +0, 78000, 78000, 2000, 24000, bad8e1b1b484405ea814683eca929e1d
> +0, 80000, 80000, 2000, 24000, 25ad314aaa14e866327d9d58c65b49e7
> +0, 82000, 82000, 2000, 24000, 468fafbd7548d9c79284cdc9207bab4e
> +0, 84000, 84000, 2000, 24000, 7f3c9b931f21d4afa4319b4cd5dfc850
> +0, 86000, 86000, 2000, 24000, a96e220a2c9c4f85d843074bc4b966b6
> +0, 88000, 88000, 2000, 24000, ccaf7968a2cf2811f44e68555bdb421b
> +0, 90000, 90000, 2000, 24000, 9a308f3af192f1a232924f61e9558358
> +0, 92000, 92000, 2000, 24000, 8a11dbc1b0292a08848d6207be61cfce
> +0, 94000, 94000, 2000, 24000, ab261359b88b39c36786b6c181846096
> +0, 96000, 96000, 2000, 24000, c2dd68e56ef0d402725167cb44d57be1
> +0, 98000, 98000, 2000, 24000, 892250bb4cbce7c2784d09dfd06526b6
> +0, 100000, 100000, 2000, 24000, 121e981c4128df538fe551ea4d5a8225
> +0, 102000, 102000, 2000, 24000, 4b2a5d77951b07f81ae924abac73b8d1
> +0, 104000, 104000, 2000, 24000, b7f4c1ef2daa35c6cdcf1116eecfdb91
> +0, 106000, 106000, 2000, 24000, a9dd31482a4fa41b67ebaba1b4ff97e8
> +0, 108000, 108000, 2000, 24000, 672e5e89906d030a05b98d64d9eaefe4
> +0, 110000, 110000, 2000, 24000, 7455205e802f5c737e9867e19cb80b35
> +0, 112000, 112000, 2000, 24000, 49181c9defd9cfe163ed94bda127b64f
> +0, 114000, 114000, 2000, 24000, 76efe094889bfc9fca0a80fc628c2184
> +0, 116000, 116000, 2000, 24000, 667385cbeff8074ad31fbfaf372d3036
> +0, 118000, 118000, 2000, 24000, d5a0dd00353f92dd2d0298a98fcf68ff
> +0, 120000, 120000, 2000, 24000, c95d627e1899be337f01412ac708cebc
> +0, 122000, 122000, 2000, 24000, 0cae246a75aa327304c13b051cc43883
> +0, 124000, 124000, 2000, 24000, e244e6793f933c8309495796fd7d4cb5
> +0, 126000, 126000, 2000, 24000, d78955106c5f0acca4b61e2cc27a962b
> +0, 128000, 128000, 2000, 24000, 630581ff6634952db8ad3a791501c596
> +0, 130000, 130000, 2000, 24000, b70414eb688bc1abcd8ed08b38c90cd0
> +0, 132000, 132000, 2000, 24000, 284a1822740697edd2d6cceb4eac232e
> +0, 134000, 134000, 2000, 24000, ce67357e80bdb6bc0caa226abdf934aa
> +0, 136000, 136000, 2000, 24000, f952be1e1c7d48acd73d652ef4ea3aad
> +0, 138000, 138000, 2000, 24000, e42cbabef9d9675429dcb6fa28ce39f4
> +0, 140000, 140000, 2000, 24000, 9c6613b980bcbe9ebacbb6a492f53b16
> +0, 142000, 142000, 2000, 24000, 1882d1ae4b08fa7cc848eba60d645463
> +0, 144000, 144000, 2000, 24000, a361b56ba31c90557689631f0e7afc63
> +0, 146000, 146000, 2000, 24000, 341fbe24112c4060bb643750895a9041
> +0, 148000, 148000, 2000, 24000, 38340ef2ef764bb8007efe9cd0af54d7
> +0, 150000, 150000, 2000, 24000, 9b013a00bbedad211ba33326a3cfaa6e
> +0, 152000, 152000, 2000, 24000, 9d3469da4442cdfd2b8a5beacb789701
> +0, 154000, 154000, 2000, 24000, cf8e3880ecb46011328135dba1015044
> +0, 156000, 156000, 2000, 24000, 3be9fa7d0e0541269339ee032bda4021
> +0, 158000, 158000, 2000, 24000, ffd2646acf86524651416bc412afd846
> +0, 160000, 160000, 2000, 24000, 715163d8f82f007b1b6c42b06bd08b5a
> +0, 162000, 162000, 1840, 22080, c2079a237d021d7aa27e44acf979b1f0
Noob question: Isn't a much larger total number of samples produced here?
Also it might be good to mention in the commit that the audio duration
is less exact when using commands like "ffmpeg -i $INPUT -c:a copy -t
1.0 $OUTPUT".
Regards, Tobias
More information about the ffmpeg-devel
mailing list