Opened 18 months ago

Closed 18 months ago

Last modified 16 months ago

#7696 closed defect (invalid)

XVID AVI with pcm_s24le audio gets weird format tag

Reported by: Ruuttu Owned by:
Priority: normal Component: undetermined
Version: git-master Keywords:
Cc: Blocked By:
Blocking: Reproduced by developer: no
Analyzed by developer: no


TL;DR: When encoding AVIs using libxvid and using pcm_s24le for audio rather than pcm_s16le, I get a file where the audio can't be imported by Sony Vegas.

Here are examples to reproduce the issue:

ffmpeg -i BigBuckBunny_30s.mp4 -acodec pcm_s16le -vcodec libxvid works.avi
ffmpeg -i BigBuckBunny_30s.mp4 -acodec pcm_s24le -vcodec libxvid doesnt_work.avi

When using pcm_s16le, there's a wFormatTag in the AVI that's set to 1. With pcm_s24le, it's set to 65534. I suspect this has something to do with it. The value of 65534 seems suspicious and weird.

I don't have enough expertise to know if the videos I'm getting are actually correct or not, but they do not work in Sony Vegas 12 or 16. Sony Vegas does in fact support 24bit audio, but when encoding a similar file using Sony Vegas, the value of wFormatTag is 1, the same as when encoding 16bit audio with ffmpeg.

There's a free trial of the software available at for what it's worth.

Attachments (3)

BigBuckBunny_30s.mp4 (1.1 MB) - added by Ruuttu 18 months ago.
riffpad.png (20.0 KB) - added by Ruuttu 18 months ago.
vegas_works_5s.avi (1.2 MB) - added by Ruuttu 18 months ago.

Change History (14)

Changed 18 months ago by Ruuttu

Changed 18 months ago by Ruuttu

comment:1 Changed 18 months ago by Ruuttu

I don't know if I marked the ffmpeg version correctly. I downloaded the "latest" ffmpeg build for Windows, which identifies itself as N-93001-g87c165c237.

comment:2 Changed 18 months ago by Ruuttu

Would it help if I submitted an AVI with 24bit audio that was encoded using (and which works in) Sony Vegas?

Last edited 18 months ago by Ruuttu (previous) (diff)

comment:3 Changed 18 months ago by cehoyos

  • Resolution set to invalid
  • Status changed from new to closed

The avi specification requires FFmpeg not to use a format Tag of „1“ if audio is 24bit pcm.

comment:4 Changed 18 months ago by Ruuttu

Can you point me to the specification, so I can submit a bug for Sony Vegas instead?

comment:5 Changed 18 months ago by cehoyos
The paragraph about wBitsPerSample clearly indicates that WAVE_FORMAT_EXTENSIBLE (65534) has to be used for 24bit pcm audio.

comment:6 Changed 18 months ago by compn

use -atag to override default and trick vegas?

comment:7 Changed 18 months ago by Ruuttu

Thanks for the tip compn. I actually tried atag, but I got a byte-for-byte identical file as a result as if the flag didn't do anything. Is this the correct usage for setting wFormatTag to 1?

-atag 1

The spec looks clear, and the AVI made by ffmpeg certainly works in other player software I've tried. I'll let the developers of Sony Vegas know about this issue as soon as I can. For now, I'll have to devise a workaround.

comment:8 Changed 18 months ago by compn

possibly -atag 0x0001 but i am not positive.

can you paste ffmpeg -i vegas-working.avi so we can see what tag its looking for, on one of the files that vegas accepts/outputs i mean.

comment:9 Changed 18 months ago by Gyan

atag won't work as ff_put_wav_header doesn't look at user-supplied tag if stream qualifies as WAVE_FORMAT_EXTENSIBLE

Changed 18 months ago by Ruuttu

comment:10 Changed 18 months ago by Ruuttu

Here's the print. I've also attached a sample file.

ffmpeg -i vegas_works_5s.avi
ffmpeg version N-93001-g87c165c237 Copyright (c) 2000-2019 the FFmpeg developers
  built with gcc 8.2.1 (GCC) 20181201
  configuration: --enable-gpl --enable-version3 --enable-sdl2 --enable-fontconfig --enable-gnutls --enable-iconv --enable-libass --enable-libbluray --enable-libfreetype --enable-libmp3lame --enable-libopencore-amrnb --enable-libopencore-amrwb --enable-libopenjpeg --enable-libopus --enable-libshine --enable-libsnappy --enable-libsoxr --enable-libtheora --enable-libtwolame --enable-libvpx --enable-libwavpack --enable-libwebp --enable-libx264 --enable-libx265 --enable-libxml2 --enable-libzimg --enable-lzma --enable-zlib --enable-gmp --enable-libvidstab --enable-libvorbis --enable-libvo-amrwbenc --enable-libmysofa --enable-libspeex --enable-libxvid --enable-libaom --enable-libmfx --enable-amf --enable-ffnvcodec --enable-cuvid --enable-d3d11va --enable-nvenc --enable-nvdec --enable-dxva2 --enable-avisynth --enable-libopenmpt
  libavutil      56. 26.100 / 56. 26.100
  libavcodec     58. 44.100 / 58. 44.100
  libavformat    58. 26.100 / 58. 26.100
  libavdevice    58.  6.101 / 58.  6.101
  libavfilter     7. 48.100 /  7. 48.100
  libswscale      5.  4.100 /  5.  4.100
  libswresample   3.  4.100 /  3.  4.100
  libpostproc    55.  4.100 / 55.  4.100
Guessed Channel Layout for Input Stream #0.1 : mono
Input #0, avi, from 'C:\Users\rudolfe\Documents\vegas_works_5s.avi':
    TCOD            : 0
    TCDO            : 50000000
  Duration: 00:00:05.00, start: 0.000000, bitrate: 2045 kb/s
    Stream #0:0: Video: mpeg4 (Advanced Simple Profile) (XVID / 0x44495658), yuv420p, 320x180 [SAR 1:1 DAR 16:9], 24 fps, 24 tbr, 24 tbn, 24 tbc
    Stream #0:1: Audio: pcm_s24le ([1][0][0][0] / 0x0001), 48000 Hz, mono, s32 (24 bit), 1152 kb/s
At least one output file must be specified

comment:11 Changed 16 months ago by Ruuttu

Just an update. I've provided Magix support with all the information necessary to reproduce the issue. They have not communicated any success or difficulty in reproducing the issue. They did however let me know that they appreciate receiving this type of feedback so that they may better serve their customers.

Note: See TracTickets for help on using tickets.