Opened 5 years ago

Closed 5 years ago

Last modified 5 years ago

#7696 closed defect (invalid)

XVID AVI with pcm_s24le audio gets weird format tag

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

Description

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 https://www.vegascreativesoftware.com/us/vegas-pro/ for what it's worth.

Attachments (3)

BigBuckBunny_30s.mp4 (1.1 MB ) - added by Rudolf Enberg 5 years ago.
riffpad.png (20.0 KB ) - added by Rudolf Enberg 5 years ago.
vegas_works_5s.avi (1.2 MB ) - added by Rudolf Enberg 5 years ago.

Change History (14)

by Rudolf Enberg, 5 years ago

Attachment: BigBuckBunny_30s.mp4 added

by Rudolf Enberg, 5 years ago

Attachment: riffpad.png added

comment:1 by Rudolf Enberg, 5 years ago

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 by Rudolf Enberg, 5 years ago

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

Last edited 5 years ago by Rudolf Enberg (previous) (diff)

comment:3 by Carl Eugen Hoyos, 5 years ago

Resolution: invalid
Status: newclosed

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

comment:4 by Rudolf Enberg, 5 years ago

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

comment:5 by Carl Eugen Hoyos, 5 years ago

https://msdn.microsoft.com/en-us/library/windows/desktop/dd390970%28v=vs.85%29.aspx
The paragraph about wBitsPerSample clearly indicates that WAVE_FORMAT_EXTENSIBLE (65534) has to be used for 24bit pcm audio.

comment:6 by compn, 5 years ago

use -atag to override default and trick vegas?

comment:7 by Rudolf Enberg, 5 years ago

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 by compn, 5 years ago

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 by Gyan, 5 years ago

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

by Rudolf Enberg, 5 years ago

Attachment: vegas_works_5s.avi added

comment:10 by Rudolf Enberg, 5 years ago

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':
  Metadata:
    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 by Rudolf Enberg, 5 years ago

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.