[FFmpeg-trac] #9826(undetermined:open): AVI muxer issue
FFmpeg
trac at avcodec.org
Sat Jul 9 17:49:40 EEST 2022
#9826: AVI muxer issue
-------------------------------------+-------------------------------------
Reporter: ProWo | Owner: (none)
Type: defect | Status: open
Priority: normal | Component:
| undetermined
Version: unspecified | Resolution:
Keywords: avi muxer | Blocked By:
Blocking: | Reproduced by developer: 0
Analyzed by developer: 0 |
-------------------------------------+-------------------------------------
Description changed by ProWo:
Old description:
> Summary of the bug:
> I have noticed that the FFmpeg AVI muxer creates non-compliant Avi files.
> Checking these files with AviHex shows errors.
> The files still play fine with most software players.
> Older hardware players (e.g. DVD players with USB port) can not play
> them.
> If you mux to mkv and then mux this mkv file to AVI with Avidemux, this
> new Avi file is compliant.
>
> How to reproduce:
> ffmpeg started on 2022-07-09 at 15:01:21
> Report written to "ffmpeg-20220709-150121.log"
> Log level: 48
> Command line:
> ffmpeg -i Sample_Videostream.mkv -i Sample_Audiostream.ac3 -c copy
> output.avi -report
> ffmpeg version 5.0.1-full_build-www.gyan.dev Copyright (c) 2000-2022 the
> FFmpeg developers
> built with gcc 11.2.0 (Rev7, Built by MSYS2 project)
> configuration: --enable-gpl --enable-version3 --enable-static
> --disable-w32threads --disable-autodetect --enable-fontconfig --enable-
> iconv --enable-gnutls --enable-libxml2 --enable-gmp --enable-bzlib
> --enable-lzma --enable-libsnappy --enable-zlib --enable-librist --enable-
> libsrt --enable-libssh --enable-libzmq --enable-avisynth --enable-
> libbluray --enable-libcaca --enable-sdl2 --enable-libdav1d --enable-
> libdavs2 --enable-libuavs3d --enable-libzvbi --enable-librav1e --enable-
> libsvtav1 --enable-libwebp --enable-libx264 --enable-libx265 --enable-
> libxavs2 --enable-libxvid --enable-libaom --enable-libopenjpeg --enable-
> libvpx --enable-mediafoundation --enable-libass --enable-frei0r --enable-
> libfreetype --enable-libfribidi --enable-liblensfun --enable-libvidstab
> --enable-libvmaf --enable-libzimg --enable-amf --enable-cuda-llvm
> --enable-cuvid --enable-ffnvcodec --enable-nvdec --enable-nvenc --enable-
> d3d11va --enable-dxva2 --enable-libmfx --enable-libshaderc --enable-
> vulkan --enable-libplacebo --enable-opencl --ena libavutil 57.
> 17.100 / 57. 17.100
> libavcodec 59. 18.100 / 59. 18.100
> libavformat 59. 16.100 / 59. 16.100
> libavdevice 59. 4.100 / 59. 4.100
> libavfilter 8. 24.100 / 8. 24.100
> libswscale 6. 4.100 / 6. 4.100
> libswresample 4. 3.100 / 4. 3.100
> libpostproc 56. 3.100 / 56. 3.100
> Splitting the commandline.
> Reading option '-i' ... matched as input url with argument
> 'Sample_Videostream.mkv'.
> Reading option '-i' ... matched as input url with argument
> 'Sample_Audiostream.ac3'.
> Reading option '-c' ... matched as option 'c' (codec name) with argument
> 'copy'.
> Reading option 'output.avi' ... matched as output url.
> Reading option '-report' ... matched as option 'report' (generate a
> report) with argument '1'.
> Finished splitting the commandline.
> Parsing a group of options: global .
> Applying option report (generate a report) with argument 1.
> Successfully parsed a group of options.
> Parsing a group of options: input url Sample_Videostream.mkv.
> Successfully parsed a group of options.
> Opening an input file: Sample_Videostream.mkv.
> [NULL @ 0000027d94fce900] Opening 'Sample_Videostream.mkv' for reading
> [file @ 0000027d94fcef40] Setting default whitelist 'file,crypto,data'
> [matroska,webm @ 0000027d94fce900] Format matroska,webm probed with
> size=2048 and score=100
> st:0 removing common factor 1000000 from timebase
> [matroska,webm @ 0000027d94fce900] Before avformat_find_stream_info()
> pos: 633 bytes read:32768 seeks:0 nb_streams:1
> [mpeg4 @ 0000027d94ff7700] Format yuv420p chosen by get_format().
> [matroska,webm @ 0000027d94fce900] All info found
> [matroska,webm @ 0000027d94fce900] After avformat_find_stream_info() pos:
> 4458 bytes read:32768 seeks:0 frames:1
> Input #0, matroska,webm, from 'Sample_Videostream.mkv':
> Metadata:
> ENCODER : Lavf59.16.100
> Duration: 00:00:38.37, start: 0.300000, bitrate: 734 kb/s
> Stream #0:0, 1, 1/1000: Video: mpeg4 (Simple Profile), yuv420p(tv,
> progressive), 720x480 [SAR 8:9 DAR 4:3], 29.97 fps, 29.97 tbr, 1k tbn
> Metadata:
> ENCODER : Lavc59.18.100 libxvid
> DURATION : 00:00:38.371000000
> Successfully opened the file.
> Parsing a group of options: input url Sample_Audiostream.ac3.
> Successfully parsed a group of options.
> Opening an input file: Sample_Audiostream.ac3.
> [NULL @ 0000027d94febec0] Opening 'Sample_Audiostream.ac3' for reading
> [file @ 0000027d94fcedc0] Setting default whitelist 'file,crypto,data'
> [ac3 @ 0000027d94febec0] Format ac3 probed with size=16384 and score=51
> [ac3 @ 0000027d94febec0] Before avformat_find_stream_info() pos: 0 bytes
> read:32768 seeks:0 nb_streams:1
> [ac3 @ 0000027d94febec0] All info found
> [ac3 @ 0000027d94febec0] Estimating duration from bitrate, this may be
> inaccurate
> [ac3 @ 0000027d94febec0] After avformat_find_stream_info() pos: 90112
> bytes read:98304 seeks:0 frames:50
> Input #1, ac3, from 'Sample_Audiostream.ac3':
> Duration: 00:00:37.98, start: 0.000000, bitrate: 448 kb/s
> Stream #1:0, 50, 1/90000: Audio: ac3, 48000 Hz, 5.1(side), fltp, 448
> kb/s
> Successfully opened the file.
> Parsing a group of options: output url output.avi.
> Applying option c (codec name) with argument copy.
> Successfully parsed a group of options.
> Opening an output file: output.avi.
> [file @ 0000027d9506eec0] Setting default whitelist 'file,crypto,data'
> Successfully opened the file.
> [avi @ 0000027d950702c0] reserve_index_space:0 master_index_max_size:256
> [avi @ 0000027d950702c0] duration_est:36000.000, filesize_est:2.1GiB,
> master_index_max_size:256
> Output #0, avi, to 'output.avi':
> Metadata:
> ISFT : Lavf59.16.100
> Stream #0:0, 0, 1001/60000: Video: mpeg4 (Simple Profile) (FMP4 /
> 0x34504D46), yuv420p(tv, progressive), 720x480 [SAR 8:9 DAR 4:3], q=2-31,
> 29.97 fps, 29.97 tbr, 59.94 tbn
> Metadata:
> ENCODER : Lavc59.18.100 libxvid
> DURATION : 00:00:38.371000000
> Stream #0:1, 0, 4/125: Audio: ac3 ([0] [0][0] / 0x2000), 48000 Hz,
> 5.1(side), fltp, 448 kb/s
> Stream mapping:
> Stream #0:0 -> #0:0 (copy)
> Stream #1:0 -> #0:1 (copy)
> Press [q] to stop, [?] for help
> cur_dts is invalid st:0 (0) [init:1 i_done:0 finish:0] (this is harmless
> if it occurs once at the start per stream)
> cur_dts is invalid st:1 (0) [init:1 i_done:0 finish:0] (this is harmless
> if it occurs once at the start per stream)
> frame= 1 fps=0.0 q=-1.0 size= 10kB time=00:00:00.01
> bitrate=4819.3kbits/s speed= 152x
> cur_dts is invalid st:1 (0) [init:1 i_done:0 finish:0] (this is harmless
> if it occurs once at the start per stream)
> No more output streams to write to, finishing.
> frame= 1141 fps=0.0 q=-1.0 Lsize= 5598kB time=00:00:38.05
> bitrate=1205.1kbits/s speed=5.14e+03x
> video:3429kB audio:2077kB subtitle:0kB other streams:0kB global
> headers:0kB muxing overhead: 1.667069%
> Input file #0 (Sample_Videostream.mkv):
> Input stream #0:0 (video): 1141 packets read (3511176 bytes);
> Total: 1141 packets (3511176 bytes) demuxed
> Input file #1 (Sample_Audiostream.ac3):
> Input stream #1:0 (audio): 1187 packets read (2127104 bytes);
> Total: 1187 packets (2127104 bytes) demuxed
> Output file #0 (output.avi):
> Output stream #0:0 (video): 1141 packets muxed (3511176 bytes);
> Output stream #0:1 (audio): 1187 packets muxed (2127104 bytes);
> Total: 2328 packets (5638280 bytes) muxed
> [AVIOContext @ 0000027d94ffaa80] Statistics: 5732302 bytes written, 10
> seeks, 30 writeouts
> 0 frames successfully decoded, 0 decoding errors
> [AVIOContext @ 0000027d94fed2c0] Statistics: 3523267 bytes read, 0 seeks
> [AVIOContext @ 0000027d94fec180] Statistics: 2127104 bytes read, 0 seeks
>
> '''NB output.avi in the commandline =
> Sample_muxed_with_ffmpeg_to_avi.avi'''
>
> Files:
>
> {{{
> https://files.videohelp.com/u/292773/Sample_Videostream.mkv
> https://files.videohelp.com/u/292773/Sample_Audiostream.ac3
> https://files.videohelp.com/u/292773/Sample_muxed_with_ffmpeg_to_avi.avi
> https://files.videohelp.com/u/292773/Sample_muxed_with_ffmpeg_to_mkv.mkv
> https://files.videohelp.com/u/292773/Sample_muxed_with_ffmpeg_to_mkv_then_with_avidemux_to_avi.avi
> http://www.gero-net.de/avihex/avihex253.zip
> }}}
>
> Patches should be submitted to the ffmpeg-devel mailing list and not this
> bug tracker.
New description:
'''Summary of the bug:'''
I have noticed that the FFmpeg AVI muxer creates non-compliant Avi files.
Checking these files with AviHex shows errors.
The files still play fine with most software players.
Older hardware players (e.g. DVD players with USB port) can not play them.
If you mux to mkv and then mux this mkv file to AVI with Avidemux, this
new Avi file is compliant.
'''How to reproduce:'''
ffmpeg started on 2022-07-09 at 15:01:21
Report written to "ffmpeg-20220709-150121.log"
Log level: 48
Command line:
ffmpeg -i Sample_Videostream.mkv -i Sample_Audiostream.ac3 -c copy
output.avi -report
ffmpeg version 5.0.1-full_build-www.gyan.dev Copyright (c) 2000-2022 the
FFmpeg developers
built with gcc 11.2.0 (Rev7, Built by MSYS2 project)
configuration: --enable-gpl --enable-version3 --enable-static --disable-
w32threads --disable-autodetect --enable-fontconfig --enable-iconv
--enable-gnutls --enable-libxml2 --enable-gmp --enable-bzlib --enable-lzma
--enable-libsnappy --enable-zlib --enable-librist --enable-libsrt
--enable-libssh --enable-libzmq --enable-avisynth --enable-libbluray
--enable-libcaca --enable-sdl2 --enable-libdav1d --enable-libdavs2
--enable-libuavs3d --enable-libzvbi --enable-librav1e --enable-libsvtav1
--enable-libwebp --enable-libx264 --enable-libx265 --enable-libxavs2
--enable-libxvid --enable-libaom --enable-libopenjpeg --enable-libvpx
--enable-mediafoundation --enable-libass --enable-frei0r --enable-
libfreetype --enable-libfribidi --enable-liblensfun --enable-libvidstab
--enable-libvmaf --enable-libzimg --enable-amf --enable-cuda-llvm
--enable-cuvid --enable-ffnvcodec --enable-nvdec --enable-nvenc --enable-
d3d11va --enable-dxva2 --enable-libmfx --enable-libshaderc --enable-vulkan
--enable-libplacebo --enable-opencl --ena libavutil 57. 17.100 / 57.
17.100
libavcodec 59. 18.100 / 59. 18.100
libavformat 59. 16.100 / 59. 16.100
libavdevice 59. 4.100 / 59. 4.100
libavfilter 8. 24.100 / 8. 24.100
libswscale 6. 4.100 / 6. 4.100
libswresample 4. 3.100 / 4. 3.100
libpostproc 56. 3.100 / 56. 3.100
Splitting the commandline.
Reading option '-i' ... matched as input url with argument
'Sample_Videostream.mkv'.
Reading option '-i' ... matched as input url with argument
'Sample_Audiostream.ac3'.
Reading option '-c' ... matched as option 'c' (codec name) with argument
'copy'.
Reading option 'output.avi' ... matched as output url.
Reading option '-report' ... matched as option 'report' (generate a
report) with argument '1'.
Finished splitting the commandline.
Parsing a group of options: global .
Applying option report (generate a report) with argument 1.
Successfully parsed a group of options.
Parsing a group of options: input url Sample_Videostream.mkv.
Successfully parsed a group of options.
Opening an input file: Sample_Videostream.mkv.
[NULL @ 0000027d94fce900] Opening 'Sample_Videostream.mkv' for reading
[file @ 0000027d94fcef40] Setting default whitelist 'file,crypto,data'
[matroska,webm @ 0000027d94fce900] Format matroska,webm probed with
size=2048 and score=100
st:0 removing common factor 1000000 from timebase
[matroska,webm @ 0000027d94fce900] Before avformat_find_stream_info() pos:
633 bytes read:32768 seeks:0 nb_streams:1
[mpeg4 @ 0000027d94ff7700] Format yuv420p chosen by get_format().
[matroska,webm @ 0000027d94fce900] All info found
[matroska,webm @ 0000027d94fce900] After avformat_find_stream_info() pos:
4458 bytes read:32768 seeks:0 frames:1
Input #0, matroska,webm, from 'Sample_Videostream.mkv':
Metadata:
ENCODER : Lavf59.16.100
Duration: 00:00:38.37, start: 0.300000, bitrate: 734 kb/s
Stream #0:0, 1, 1/1000: Video: mpeg4 (Simple Profile), yuv420p(tv,
progressive), 720x480 [SAR 8:9 DAR 4:3], 29.97 fps, 29.97 tbr, 1k tbn
Metadata:
ENCODER : Lavc59.18.100 libxvid
DURATION : 00:00:38.371000000
Successfully opened the file.
Parsing a group of options: input url Sample_Audiostream.ac3.
Successfully parsed a group of options.
Opening an input file: Sample_Audiostream.ac3.
[NULL @ 0000027d94febec0] Opening 'Sample_Audiostream.ac3' for reading
[file @ 0000027d94fcedc0] Setting default whitelist 'file,crypto,data'
[ac3 @ 0000027d94febec0] Format ac3 probed with size=16384 and score=51
[ac3 @ 0000027d94febec0] Before avformat_find_stream_info() pos: 0 bytes
read:32768 seeks:0 nb_streams:1
[ac3 @ 0000027d94febec0] All info found
[ac3 @ 0000027d94febec0] Estimating duration from bitrate, this may be
inaccurate
[ac3 @ 0000027d94febec0] After avformat_find_stream_info() pos: 90112
bytes read:98304 seeks:0 frames:50
Input #1, ac3, from 'Sample_Audiostream.ac3':
Duration: 00:00:37.98, start: 0.000000, bitrate: 448 kb/s
Stream #1:0, 50, 1/90000: Audio: ac3, 48000 Hz, 5.1(side), fltp, 448
kb/s
Successfully opened the file.
Parsing a group of options: output url output.avi.
Applying option c (codec name) with argument copy.
Successfully parsed a group of options.
Opening an output file: output.avi.
[file @ 0000027d9506eec0] Setting default whitelist 'file,crypto,data'
Successfully opened the file.
[avi @ 0000027d950702c0] reserve_index_space:0 master_index_max_size:256
[avi @ 0000027d950702c0] duration_est:36000.000, filesize_est:2.1GiB,
master_index_max_size:256
Output #0, avi, to 'output.avi':
Metadata:
ISFT : Lavf59.16.100
Stream #0:0, 0, 1001/60000: Video: mpeg4 (Simple Profile) (FMP4 /
0x34504D46), yuv420p(tv, progressive), 720x480 [SAR 8:9 DAR 4:3], q=2-31,
29.97 fps, 29.97 tbr, 59.94 tbn
Metadata:
ENCODER : Lavc59.18.100 libxvid
DURATION : 00:00:38.371000000
Stream #0:1, 0, 4/125: Audio: ac3 ([0] [0][0] / 0x2000), 48000 Hz,
5.1(side), fltp, 448 kb/s
Stream mapping:
Stream #0:0 -> #0:0 (copy)
Stream #1:0 -> #0:1 (copy)
Press [q] to stop, [?] for help
cur_dts is invalid st:0 (0) [init:1 i_done:0 finish:0] (this is harmless
if it occurs once at the start per stream)
cur_dts is invalid st:1 (0) [init:1 i_done:0 finish:0] (this is harmless
if it occurs once at the start per stream)
frame= 1 fps=0.0 q=-1.0 size= 10kB time=00:00:00.01
bitrate=4819.3kbits/s speed= 152x
cur_dts is invalid st:1 (0) [init:1 i_done:0 finish:0] (this is harmless
if it occurs once at the start per stream)
No more output streams to write to, finishing.
frame= 1141 fps=0.0 q=-1.0 Lsize= 5598kB time=00:00:38.05
bitrate=1205.1kbits/s speed=5.14e+03x
video:3429kB audio:2077kB subtitle:0kB other streams:0kB global
headers:0kB muxing overhead: 1.667069%
Input file #0 (Sample_Videostream.mkv):
Input stream #0:0 (video): 1141 packets read (3511176 bytes);
Total: 1141 packets (3511176 bytes) demuxed
Input file #1 (Sample_Audiostream.ac3):
Input stream #1:0 (audio): 1187 packets read (2127104 bytes);
Total: 1187 packets (2127104 bytes) demuxed
Output file #0 (output.avi):
Output stream #0:0 (video): 1141 packets muxed (3511176 bytes);
Output stream #0:1 (audio): 1187 packets muxed (2127104 bytes);
Total: 2328 packets (5638280 bytes) muxed
[AVIOContext @ 0000027d94ffaa80] Statistics: 5732302 bytes written, 10
seeks, 30 writeouts
0 frames successfully decoded, 0 decoding errors
[AVIOContext @ 0000027d94fed2c0] Statistics: 3523267 bytes read, 0 seeks
[AVIOContext @ 0000027d94fec180] Statistics: 2127104 bytes read, 0 seeks
'''NB output.avi in the commandline =
Sample_muxed_with_ffmpeg_to_avi.avi'''
'''Files:'''
{{{
https://files.videohelp.com/u/292773/Sample_Videostream.mkv
https://files.videohelp.com/u/292773/Sample_Audiostream.ac3
https://files.videohelp.com/u/292773/Sample_muxed_with_ffmpeg_to_avi.avi
https://files.videohelp.com/u/292773/Sample_muxed_with_ffmpeg_to_mkv.mkv
https://files.videohelp.com/u/292773/Sample_muxed_with_ffmpeg_to_mkv_then_with_avidemux_to_avi.avi
http://www.gero-net.de/avihex/avihex253.zip
}}}
Patches should be submitted to the ffmpeg-devel mailing list and not this
bug tracker.
--
--
Ticket URL: <https://trac.ffmpeg.org/ticket/9826#comment:2>
FFmpeg <https://ffmpeg.org>
FFmpeg issue tracker
More information about the FFmpeg-trac
mailing list