View Full Version : BestAudioSource
Myrsloik
7th January 2020, 22:17
Imagine if FFAudioSource actually worked and was accurate (but a bit slow). That's what I'm going for here. Also no indexing required...
Usage: BestAudioSource(filename, track=-1)
or
vs.core.bas.Source(filename, track=-1)
Full argument list:
[source]s[track]i[adjustdelay]i[exactsamples]b[enable_drefs]b[use_absolute_path]b[drc_scale]f[varprefix]s
Positive track numbers refer to the FFmpeg given stream number. Negative numbers refer to the nth audio track with -1 being the first.
Github release page (https://github.com/vapoursynth/bestaudiosource/releases)
For you poor avisynth users it sets two variables: BASCHANNEL_LAYOUT and BASVALID_BITS that can also be prefixed if needed.
TODO:
Delay adjustment relative to other tracks is missing. This is the only feature missing relative FFMS2.
Emulgator
8th January 2020, 11:18
Many thanks !
First test: Maybe I understood channel mapping wrong...
Decoding a spoken 6ch (5.1) .wmv test file seems to deliver one single channel's source content mapped onto all 6 outputs.
AvsPmod waveform() shows it as such.
MPC-BE64 1.5.4.4969 plays the script back and returns "Right surround" on all 6 outputs.
MPC-HC64 1.9.0 plays the script back and returns "Right surround" on all 6 outputs.
Built-in LAV Audio Decoder Status shows 6 sychronous channels.
Same content as .aiff: same result.
Same content as .ac3: same result.
track=-1 and track=0 deliver the same.
After switching the same script, same sources over to LWLibavAudioSource:
Testing .wmv, ac3, aiff: All audio channels mapped correctly.
Myrsloik
8th January 2020, 13:29
Nicely tested. New build with fixed output uploaded. There's also a new argument called exactsamples you can set to true if you want opening files to be really slow but for some reason need a completely sample exact length.
A VS version will follow shortly after the worst bugs have been dealt with.
DJATOM
8th January 2020, 14:52
I just too lazy to install avisynth, so waiting for the fist VS build to test it out.
DJATOM
8th January 2020, 22:46
Since sources now hosted on github, I've built doodle1 and bas on my end and tried to run some mp4 file with it. VSPipe simply refuse to initialize environment in portable mode. So I tried to replace dlls/pyd files and core folder. Now VSPipe silently crashing for audio nodes and errors out
Script evaluation failed:
Python exception: 'NoneType' object has no attribute 'set_output'
Traceback (most recent call last):
File "src\cython\vapoursynth.pyx", line 2233, in vapoursynth.vpy_evaluateScript
File "src\cython\vapoursynth.pyx", line 2234, in vapoursynth.vpy_evaluateScript
File "R:\test_audio.vpy", line 6, in <module>
clip.set_output()
AttributeError: 'NoneType' object has no attribute 'set_output'
for video nodes.
lansing
9th January 2020, 01:03
The issue I have, I have a 4 hour long video and I loaded it into the script to play on mpc. When I jump to the middle while playing, mpc just kept on loading and never play. I closed the player after 30 seconds.
Myrsloik
9th January 2020, 01:26
The issue I have, I have a 4 hour long video and I loaded it into the script to play on mpc. When I jump to the middle while playing, mpc just kept on loading and never play. I closed the player after 30 seconds.
It uses linear decoding to be sample accurate so it is quite slow when you do that. (quite a few caching tricks and multiple decoders are used to hide it when seeking but initially it'll always be sloooooow)
DJATOM
9th January 2020, 13:17
I just realized that I forgot to put embeddable python into my portable folder, now it at least initialize. NoneType error and silent exit from BAS still present.
Myrsloik
9th January 2020, 13:27
I just realized that I forgot to put embeddable python into my portable folder, now it at least initialize. NoneType error and silent exit from BAS still present.
Completely uninteresting. As I said the VS audio support is only about 80% done so not ready to use at all. Don't scare away the avisynth monkeys this source actually works for.
DJATOM
9th January 2020, 13:56
Ok, sorry. I didn't knew it's that immature.
Emulgator
10th January 2020, 00:41
BestAudioSource test2: Success !
.aiff, .wmv, .ac3: 6 channel 5.1 files are returned in their order.
.MTS: 2 channel 2.0 files do work as well
Only short files tested for now. Other rare formats to come soon.
Many thanks !
Myrsloik
10th January 2020, 14:05
BestAudioSource test2: Success !
.aiff, .wmv, .ac3: 6 channel 5.1 files are returned in their order.
.MTS: 2 channel 2.0 files do work as well
Only short files tested for now. Other rare formats to come soon.
Many thanks !
I think the most interesting things to try are (in order):
1. Badly combined transport streams with timecode discontinuities. (as in, is the initial estimate of the number of frames actually accurate enough or completely off?)
2. Streams with audio format changes (audio format changes are handled by simply dropping the bits with where the format doesn't match the output)
Myrsloik
25th January 2020, 16:44
Updated version. Fixes the channel mask variable that was previously almost always wrong in Avisynth. Also adds VS support (for a soon to be released test build).
_Al_
10th April 2020, 04:14
nevermind
EDIT: Sorry, I thought it is ready for Vapoursynth and on the top of that I did not notice I am in Avisynth forum.
Reel.Deel
11th May 2020, 08:41
Hi Myrsloik,
Question, are the "adjustdelay" and "varprefix" parameters the same as FFMS2? I see "varprefix" is only for AviSynth.
From FFMS2 docs:
int adjustdelay = -1
Controls how audio delay is handled, i.e. what happens if the first audio sample in the file doesn't have a timestamp of zero. The following arguments are valid:
-3: No adjustment is made; the first decodable audio sample becomes the first sample in the output.
-2: Samples are created (with silence) or discarded so that sample 0 in the decoded audio starts at time zero.
-1: Samples are created (with silence) or discarded so that sample 0 in the decoded audio starts at the same time as frame 0 of the first video track. This is the default, and probably what most people want.
Any integer >= 0: Same as -1, but adjust relative to the video track with the given track number instead. If the provided track number isn't a video track, an error is raised.
-2 obviously does the same thing as -1 if the first video frame of the first video track starts at time zero. In some containers this will always be the case, in others (most notably 188-byte MPEG TS) it will almost never happen.
string varprefix = ""
A string that is added as a prefix to all exported Avisynth variables. This makes it possible to differentiate between variables from different clips.
Myrsloik
11th May 2020, 09:02
Hi Myrsloik,
Question, are the "adjustdelay" and "varprefix" parameters the same as FFMS2? I see "varprefix" is only for AviSynth.
From FFMS2 docs:
Yes, they're the same. With the important difference that adjustdelay isn't actually implemented yet.
Obviously varprefix is only needed when you dump it all into a global namespace...
Reel.Deel
13th May 2020, 05:41
Thanks for the reply Myrsloik. I guess now we wait patiently till the next update :)
Myrsloik
13th June 2020, 13:08
New version posted. If you're nice forum monkeys and test my VapourSynth audio builds I may be convinced to add 24bit bit audio output for Avisynth as well as some other minor improvements.
StainlessS
13th June 2020, 15:36
I may be convinced to add 24bit bit audio output for Avisynth as well as some other minor improvements.
Arh but, will it be XP compatible ?
Myrsloik
13th June 2020, 17:20
Arh but, will it be XP compatible ?
Hahahahaha.... no.
ChaosKing
15th June 2020, 10:46
Can I save the output as a wav file with vspipe?
I tried
c = core.core.bas.Source(r"d:\test.mp3")
c.set_output(0)
.\VSPipe.exe --wav .\bla.vpy - > asd.wav
But the output is not readable.
EDIT ok the problem was powershell, it works in CMD
And it works with mkv (video) files too!
Myrsloik
15th June 2020, 11:00
Can I save the output as a wav file with vspipe?
I tried
c = core.core.bas.Source(r"d:\test.mp3")
c.set_output(0)
.\VSPipe.exe --wav .\bla.vpy - > asd.wav
But the output is not readable.
EDIT ok the problem was powershell, it works in CMD
And it works with mkv (video) files too!
Protip: don't use pipe output (-) and specify a filename directly instead for faster operation
ChaosKing
15th June 2020, 11:16
Ah, good to know thx.
My main goal was to pipe it directly to qaac which now works
VSPipe.exe --wav bla.vpy - | qaac.exe -a 160 - -o xyz.m4a
Myrsloik
24th June 2020, 14:32
Test6 posted.
Fixes clips with more than 2^31 samples in VS and adds 24 bit output to avisynth.
real.finder
13th October 2020, 10:58
where is the source code? or it's a closed source plugin?
DJATOM
13th October 2020, 12:29
https://github.com/vapoursynth/bestaudiosource
real.finder
14th October 2020, 01:44
https://github.com/vapoursynth/bestaudiosource
thanks, and since it only for audio why the dll is so big?
also aside from no index, it should did better than ffaudiosource or not?
Myrsloik
14th October 2020, 09:34
thanks, and since it only for audio why the dll is so big?
also aside from no index, it should did better than ffaudiosource or not?
It's big so YOU WILL RESPECT IT. No small weak ass 100kb dlls here. This is INDUSTRIAL SIZE AND STRENGTH with COMPLETE CORRECTNESS AND SUPERIORITY.
real.finder
14th October 2020, 10:10
It's big so YOU WILL RESPECT IT. No small weak ass 100kb dlls here. This is INDUSTRIAL SIZE AND STRENGTH with COMPLETE CORRECTNESS AND SUPERIORITY.
lol, isn't because it used full ffmpeg with even video encoders? or at least that the case in ffms2 and LSMASHSource from what I remember from some doom9 posts back then
ChaosKing
14th October 2020, 10:16
BestAudioSource radiates so much dominance that it is the only dll on my system now! No more Ntdll.dll, no System32.dll only BestAudioSource.dll. Windows boots in 0.3 sec now :D
kedautinh12
14th October 2020, 12:53
Can you support avs+ 32 bit??
Myrsloik
14th October 2020, 13:00
Can you support avs+ 32 bit??
It's open source so anyone can compile it. I SHALL HOWEVER NOT SUPPORT THESE SLIGHTLY SMALLER BINARIES.
filler56789
14th October 2020, 17:36
To whom this may interest...
upx 3.96 can shrink the B.A.S..dll to "only" 6,046,720 bytes :)
Anyway, I will wait until it receives the production model certification :sly:
real.finder
16th October 2020, 14:05
To whom this may interest...
upx 3.96 can shrink the B.A.S..dll to "only" 6,046,720 bytes :)
Anyway, I will wait until it receives the production model certification :sly:
that way better, but is this with BestAudioSource using full ffmpeg or with only audio decoders ffmpeg?
filler56789
16th October 2020, 14:46
that way better, but is this with BestAudioSource using full ffmpeg or with only audio decoders ffmpeg?
Well, with full ffmpeg, I presume. I don't compile Avisynth /Vapoursynth DLLs, I can only use them and test them :)
kedautinh12
19th October 2020, 07:27
It's open source so anyone can compile it.
Sr, i don't have knowledge about compile
Forcewielder
16th November 2020, 19:05
I'm getting a BestAudioSource.dll crash when piping a avs script via ffmpeg.
Same script works fine with FFMS2 on different files. Although FFMS2 has issues with audio on some files so that is why I wanted to start using BestAudioSource. Also BestAudioSource seems to work fine with other files as well. So might be something with this problematic file.
Faulting application name: ffmpeg.exe, version: 0.0.0.0, time stamp: 0x00000000
Faulting module name: BestAudioSource.dll, version: 0.0.0.0, time stamp: 0x5f268cbf
Exception code: 0xc0000409
Fault offset: 0x0000000000a30014
Faulting process id: 0x1960
Faulting application start time: 0x01d6bc40c325dec3
Faulting application path: C:\Tools\ffmpeg.exe
Faulting module path: C:\Tools\BestAudioSource.dll
Report Id: 3ba5cb97-1f96-47dc-a6a7-0193d0a5a162
Faulting package full name:
Faulting package-relative application ID:
I attached a log of "!analyze -v" of the dmp.
It seems to point to BestAudioSource!VapourSynthPluginInit2+907594
(0xc0000409 - The system detected an overrun of a stack-based buffer in this application. This overrun could potentially allow a malicious user to gain control of this application.)
Myrsloik
17th August 2021, 19:56
Updated with several new options, including drc_scale.
Reel.Deel
17th August 2021, 20:54
Updated with several new options, including drc_scale.
Thank you for the update :). Regarding the new options, what's documented in ffmpeg is correct, right? Only difference I see is that drc_scale is 0 by default in BestAudioSource and 1 in ffmpeg.
enable_drefs
Enable loading of external tracks, disabled by default.
use_absolute_path
Allows loading of external tracks via absolute paths, disabled by default.
drc_scale
Dynamic Range Scale Factor. The factor to apply to dynamic range values from the AC-3 stream. This factor is applied exponentially.
The default value is 0. There are 3 notable scale factor ranges:
drc_scale == 0
DRC disabled. Produces full range audio.
0 < drc_scale <= 1
DRC enabled. Applies a fraction of the stream DRC value. Audio reproduction is between full range and full compression.
drc_scale > 1
DRC enabled. Applies drc_scale asymmetrically. Loud sounds are fully compressed. Soft sounds are enhanced.
Edit: is adjustdelay still not implemented?
Myrsloik
17th August 2021, 21:53
Thank you for the update :). Regarding the new options, what's documented in ffmpeg is correct, right? Only difference I see is that drc_scale is 0 by default in BestAudioSource and 1 in ffmpeg.
enable_drefs
Enable loading of external tracks, disabled by default.
use_absolute_path
Allows loading of external tracks via absolute paths, disabled by default.
drc_scale
Dynamic Range Scale Factor. The factor to apply to dynamic range values from the AC-3 stream. This factor is applied exponentially.
The default value is 0. There are 3 notable scale factor ranges:
drc_scale == 0
DRC disabled. Produces full range audio.
0 < drc_scale <= 1
DRC enabled. Applies a fraction of the stream DRC value. Audio reproduction is between full range and full compression.
drc_scale > 1
DRC enabled. Applies drc_scale asymmetrically. Loud sounds are fully compressed. Soft sounds are enhanced.
Edit: is adjustdelay still not implemented?
It's drc off by default since that's what's supposedly the "original" audio. The standard is kinda muddled and there's loads of confusion as to what the default is. By default I'd say keeping the full dynamic range is the most appropriate.
Yes, delay adjustment is boring but maybe I'll get to that at some point now that all core things are done and tested.
kedautinh12
26th August 2021, 02:36
Here have x86 ver
https://drive.google.com/file/d/1F3FC98vKDKVxBIkBTAlWZ7TF1eyY19I-/view?usp=sharing
Forcewielder
15th September 2021, 19:15
I'm getting a BestAudioSource.dll crash when piping a avs script via ffmpeg.
Same script works fine with FFMS2 on different files. Although FFMS2 has issues with audio on some files so that is why I wanted to start using BestAudioSource. Also BestAudioSource seems to work fine with other files as well. So might be something with this problematic file.
Faulting application name: ffmpeg.exe, version: 0.0.0.0, time stamp: 0x00000000
Faulting module name: BestAudioSource.dll, version: 0.0.0.0, time stamp: 0x5f268cbf
Exception code: 0xc0000409
Fault offset: 0x0000000000a30014
Faulting process id: 0x1960
Faulting application start time: 0x01d6bc40c325dec3
Faulting application path: C:\Tools\ffmpeg.exe
Faulting module path: C:\Tools\BestAudioSource.dll
Report Id: 3ba5cb97-1f96-47dc-a6a7-0193d0a5a162
Faulting package full name:
Faulting package-relative application ID:
I attached a log of "!analyze -v" of the dmp.
It seems to point to BestAudioSource!VapourSynthPluginInit2+907594
(0xc0000409 - The system detected an overrun of a stack-based buffer in this application. This overrun could potentially allow a malicious user to gain control of this application.)
exactsamples set to true seems to fix whatever issue I was having. Although now I need exactsamples set to true for any ffmpeg job.
Myrsloik
15th September 2021, 19:31
exactsamples set to true seems to fix whatever issue I was having. Although now I need exactsamples set to true for any ffmpeg job.
Very interesting. Does it happen with the latest r1 build? If so, can you send a sample file to me?
I suspect it has something to do with a bad guessed length but it should never cause a crash.
Forcewielder
15th September 2021, 20:27
Very interesting. Does it happen with the latest r1 build? If so, can you send a sample file to me?
I suspect it has something to do with a bad guessed length but it should never cause a crash.
I spoke too soon. It doesn't crash with exactsamples set to true, but I also cant seek with the full file past a certain point (just gray frames).
I have attached the avs script and the ffmpeg command I used. It seems to be okay by itself, but when I use Audiodub with any of the video filters that is where the problems begin. (I use DSS2mod mainly but I was able to do reproduce with LSMASHVideoSource which is what is in the script)
https://www.mediafire.com/file/6mxc539tolydyuy/football-sample1.mp4/file
Myrsloik
19th September 2021, 10:56
I spoke too soon. It doesn't crash with exactsamples set to true, but I also cant seek with the full file past a certain point (just gray frames).
I have attached the avs script and the ffmpeg command I used. It seems to be okay by itself, but when I use Audiodub with any of the video filters that is where the problems begin. (I use DSS2mod mainly but I was able to do reproduce with LSMASHVideoSource which is what is in the script)
https://www.mediafire.com/file/6mxc539tolydyuy/football-sample1.mp4/file
Uh what? why are you talking about gray frames when it's an audio source?
Forcewielder
19th September 2021, 20:31
Sorry two different issues and I didn't explain it well.
First issue is the one with examples attached. This is the ffmpeg crash.
Second issue when I used exactsamples set to true to try and fix the crashing. ffmpeg doesn't crash but instead I get gray frames. (You cant see this with the sample file. Only with the full file. I'll see if I can get another sample for this issue)
None of these issue occur if I don't try to dub it with Video.(Using Audiodub())
Sidenote: I was able to use the FFMS3000 test1 plugin you put out and go back to ffms2 for the same sample. Previous builds had a crackling noise. So thanks for that. I still want to use BestAudioSource because ffms2 still fails to find the audio track on some files.
FranceBB
25th October 2021, 13:51
I'm sorry Myrsloik, you said that you didn't care anymore about FFAudioSource, so now I'm gonna haunt you with BestAudioSource eheheheheheheh
So, here we go: DolbyE audio not decoded in BestAudioSource
Expected behavior of the wanted feature
Once Indexing an mxf file with DolbyE 5.1 tracks is concluded, BestAudioSource() should be able to recognize them and index them correctly providing a nice decode.
The decoding is already supported in FFMpeg.
Actual behavior of BestAudioSource()
Audio is indexed and decoded as noise which might damage hardware.
How to reproduce
Step 1: Download the sample file from here: https://we.tl/t-R8dRX8gIzT
Step 2: Index it with BestAudioSource()
Step 3: Hear the noise on the first track and on the second track via VirtualDub or whatever
Avisynth Script:
video=FFVideoSource("\\mibctvan000\Ingest\MEDIA\temp\DolbyE.mxf")
audio=BestAudioSource("\\mibctvan000\Ingest\MEDIA\temp\DolbyE.mxf")
AudioDub(video, audio)
Audio Layout of the Sample:
The sample has the following audio layout:
Track 1: DolbyE 5.1 + 2.0 Stereo Downmix Italian
Track 2: DolbyE 5.1 + 2.0 Stereo Downmix English
Track 3: PCM S24LE 2.0 Stereo Downmix Italian (you can index and listen to this one just fine)
Track 4: PCM S24LE 2.0 Stereo Downmix English (you can index and listen to this one just fine)
Behavior with other indexers:
The very same happens with FFAudioSource() and LWLibavAudioSource()
Mediainfo
General
Complete name : \\mibctvan000\Ingest\MEDIA\temp\DolbyE.mxf
Format : MXF
Commercial name : XDCAM HD422
Format version : 1.3
Format profile : OP-1a
Format settings : Open / Incomplete
File size : 872 MiB
Duration : 1 min 2 s
Overall bit rate : 116 Mb/s
Encoded date : 2021-10-25 12:27:15.452
Writing application : Omneon Inc. Omneon Media Subsystem 8.2.0.0.1
Writing library : Omneon Media Api (windows)
Video
ID : 2
Format : MPEG Video
Commercial name : XDCAM HD422
Format version : Version 2
Format profile : 4:2:2@High
Format settings : CustomMatrix / BVOP
Format settings, BVOP : Yes
Format settings, Matrix : Custom
Format settings, GOP : M=3, N=12
Format settings, picture structure : Frame
Format settings, wrapping mode : Frame
Codec ID : 0D01030102046101-0401020201040300
Duration : 1 min 2 s
Bit rate mode : Constant
Bit rate : 50.0 Mb/s
Width : 1 920 pixels
Clean aperture width : 1 571 pixels / 1 571 pixels
Height : 1 080 pixels
Display aspect ratio : 16:9
Frame rate : 25.000 FPS
Standard : Component
Color space : YUV
Chroma subsampling : 4:2:2
Bit depth : 8 bits
Scan type : Interlaced
Scan order : Top Field First
Compression mode : Lossy
Bits/(Pixel*Frame) : 0.965
Time code of first frame : 00:00:00:00
Time code source : Group of pictures header
GOP, Open/Closed : Closed
Stream size : 375 MiB (43%)
Color range : Limited
Color primaries : BT.709
Transfer characteristics : BT.709
Matrix coefficients : BT.709
Audio #1
ID : 3-1
Format : Dolby E
Format settings : Little
Format settings, wrapping mode : Frame (BWF)
Muxing mode : SMPTE ST 337
Codec ID : 0D01030102060100-0402020203021C00
Duration : 1 min 2 s
Bit rate mode : Constant
Bit rate : 1 291 kb/s
Channel(s) : 6 channels
Channel layout : L C Ls X R LFE Rs X
Sampling rate : 48.0 kHz
Frame rate : 25.000 FPS (1920 SPF)
Bit depth : 20 bits
Delay relative to video : -9 h 59 min
Stream size : 9.67 MiB (1%)
Title : Program_1
Locked : Yes
Audio #2
ID : 3-2
Format : Dolby E
Format settings : Little
Format settings, wrapping mode : Frame (BWF)
Muxing mode : SMPTE ST 337
Codec ID : 0D01030102060100-0402020203021C00
Duration : 1 min 2 s
Bit rate mode : Constant
Bit rate : 505 kb/s
Channel(s) : 2 channels
Channel layout : X X X L X X X R
Sampling rate : 48.0 kHz
Frame rate : 25.000 FPS (1920 SPF)
Bit depth : 20 bits
Delay relative to video : -9 h 59 min
Stream size : 3.78 MiB (0%)
Title : Program_2
Locked : Yes
Audio #3
ID : 5-1
Format : Dolby E
Format settings : Little
Format settings, wrapping mode : Frame (BWF)
Muxing mode : SMPTE ST 337
Codec ID : 0D01030102060100-0402020203021C00
Duration : 1 min 2 s
Bit rate mode : Constant
Bit rate : 1 291 kb/s
Channel(s) : 6 channels
Channel layout : L C Ls X R LFE Rs X
Sampling rate : 48.0 kHz
Frame rate : 25.000 FPS (1920 SPF)
Bit depth : 20 bits
Delay relative to video : -9 h 59 min
Stream size : 9.67 MiB (1%)
Title : Program_1
Locked : Yes
Audio #4
ID : 5-2
Format : Dolby E
Format settings : Little
Format settings, wrapping mode : Frame (BWF)
Muxing mode : SMPTE ST 337
Codec ID : 0D01030102060100-0402020203021C00
Duration : 1 min 2 s
Bit rate mode : Constant
Bit rate : 505 kb/s
Channel(s) : 2 channels
Channel layout : X X X L X X X R
Sampling rate : 48.0 kHz
Frame rate : 25.000 FPS (1920 SPF)
Bit depth : 20 bits
Delay relative to video : -9 h 59 min
Stream size : 3.78 MiB (0%)
Title : Program_2
Locked : Yes
Audio #5
ID : 6
Format : PCM
Format settings : Little
Format settings, wrapping mode : Frame (BWF)
Codec ID : 0D01030102060100
Duration : 1 min 2 s
Bit rate mode : Constant
Bit rate : 2 304 kb/s
Channel(s) : 2 channels
Sampling rate : 48.0 kHz
Frame rate : 25.000 FPS (1920 SPF)
Bit depth : 24 bits
Stream size : 17.3 MiB (2%)
Locked : Yes
Audio #6
ID : 7
Format : PCM
Format settings : Little
Format settings, wrapping mode : Frame (BWF)
Codec ID : 0D01030102060100
Duration : 1 min 2 s
Bit rate mode : Constant
Bit rate : 2 304 kb/s
Channel(s) : 2 channels
Sampling rate : 48.0 kHz
Frame rate : 25.000 FPS (1920 SPF)
Bit depth : 24 bits
Stream size : 17.3 MiB (2%)
Locked : Yes
Text
ID : 8-777
Format : Teletext Subtitle
Muxing mode : Ancillary data / OP-47 / SDP
Duration : 1 min 2 s
Other #1
ID : 1-Material
Type : Time code
Format : MXF TC
Frame rate : 25.000 FPS
Time code of first frame : 10:00:00:00
Time code settings : Material Package
Time code, striped : Yes
Other #2
ID : 1-Source
Type : Time code
Format : MXF TC
Frame rate : 25.000 FPS
Time code of first frame : 10:00:00:00
Time code settings : Source Package
Time code, striped : Yes
Other #3
ID : System scheme 1-1-0
Muxing mode : System scheme 1
How to decode DolbyE 5.1 with FFMpeg with a drag and drop BAT
@echo off
setlocal EnableDelayedExpansion
cd /d %~dp0
for %%a in (%*) do (
call :inizia %%a
shift
)
exit
:inizia
ffmpeg.exe -i %1 -map 0:1 -acodec copy -f u8 -y stream1.u8
ffmpeg.exe -i %1 -map 0:2 -acodec copy -f u8 -y stream2.u8
ffmpeg.exe -i stream1.u8 -acodec pcm_s24le -ar 48000 -ac 1 -map_channel 0.0.0:0.0.0 -y out1.wav
ffmpeg.exe -i stream1.u8 -acodec pcm_s24le -ar 48000 -ac 1 -map_channel 0.0.1:0.0.0 -y out2.wav
ffmpeg.exe -i stream1.u8 -acodec pcm_s24le -ar 48000 -ac 1 -map_channel 0.0.2:0.0.0 -y out3.wav
ffmpeg.exe -i stream1.u8 -acodec pcm_s24le -ar 48000 -ac 1 -map_channel 0.0.3:0.0.0 -y out4.wav
ffmpeg.exe -i stream1.u8 -acodec pcm_s24le -ar 48000 -ac 1 -map_channel 0.0.4:0.0.0 -y out5.wav
ffmpeg.exe -i stream1.u8 -acodec pcm_s24le -ar 48000 -ac 1 -map_channel 0.0.5:0.0.0 -y out6.wav
ffmpeg.exe -i stream1.u8 -acodec pcm_s24le -ar 48000 -ac 1 -map_channel 0.0.6:0.0.0 -y out7.wav
ffmpeg.exe -i stream1.u8 -acodec pcm_s24le -ar 48000 -ac 1 -map_channel 0.0.7:0.0.8 -y out8.wav
ffmpeg.exe -i stream2.u8 -acodec pcm_s24le -ar 48000 -ac 1 -map_channel 0.0.0:0.0.0 -y out9.wav
ffmpeg.exe -i stream2.u8 -acodec pcm_s24le -ar 48000 -ac 1 -map_channel 0.0.1:0.0.0 -y out10.wav
ffmpeg.exe -i stream2.u8 -acodec pcm_s24le -ar 48000 -ac 1 -map_channel 0.0.2:0.0.0 -y out11.wav
ffmpeg.exe -i stream2.u8 -acodec pcm_s24le -ar 48000 -ac 1 -map_channel 0.0.3:0.0.0 -y out12.wav
ffmpeg.exe -i stream2.u8 -acodec pcm_s24le -ar 48000 -ac 1 -map_channel 0.0.4:0.0.0 -y out13.wav
ffmpeg.exe -i stream2.u8 -acodec pcm_s24le -ar 48000 -ac 1 -map_channel 0.0.5:0.0.0 -y out14.wav
ffmpeg.exe -i stream2.u8 -acodec pcm_s24le -ar 48000 -ac 1 -map_channel 0.0.6:0.0.0 -y out15.wav
ffmpeg.exe -i stream2.u8 -acodec pcm_s24le -ar 48000 -ac 1 -map_channel 0.0.7:0.0.8 -y out16.wav
pause
:eof
Balling
25th October 2021, 18:52
You should not really use wav with Dopby E, use w64 and do a normal multichannel wav/w64. Also, AFAIK, -ar 48000 may be a bad idea. There is no such thing as 48000 in Dolby E, at least looking into code.
FranceBB
25th October 2021, 21:09
You should not really use wav with Dopby E, use w64 and do a normal multichannel wav/w64. Also, AFAIK, -ar 48000 may be a bad idea. There is no such thing as 48000 in Dolby E, at least looking into code.
Noted. But still the tracks in the sample decode just fine that way so I think it would be a good idea to add this logic into BestAudioSource()
tebasuna51
25th October 2021, 23:57
Seems the ffmpeg support of mxf container is still incomplete.
See a ffmpeg report of your mxf file:
C:\tmp\DolbyE.mxf streams:
0: mpeg2video (4:2:2), yuv422p(tv, bt709, top first), 1920x1080 [SAR 1:1 DAR 16 :9], 50000 kb/s, 25 fps, 25 tbr, 25 tbn
1: pcm_s24le, 48000 Hz, 7.1, s32 (24 bit), 9216 kb/s
2: pcm_s24le, 48000 Hz, 7.1, s32 (24 bit), 9216 kb/s
3: pcm_s24le, 48000 Hz, stereo, s32 (24 bit), 2304 kb/s
4: pcm_s24le, 48000 Hz, stereo, s32 (24 bit), 2304 kb/s
The audio tracks aren't recognized like Dolby E but like pcm and are decoded like noise.
With the workaround of extract the tracks like pcm unsigned 8 bits (u8 format):
ffmpeg.exe -i DolbyE.mxf -map 0:1 -acodec copy -f u8 stream1.u8
the extracted stream1.u8 is now recognized like Dolby E:
C:\tmp\stream1.u8 streams:
0: dolby_e, 44800 Hz, 7.1, fltp
And now can be decoded/recoded without problem with ffmpeg
FFMPEG -i stream1.u8 -acodec pcm_s24le out71.w64
With Avisynth only FFAudioSource work fine with stream1.u8
#LWLibavAudioSource("C:\tmp\stream1.u8")
#BestAudioSource("C:\tmp\stream1.u8")
FFAudioSource("C:\tmp\stream1.u8")
AudioDubEx(BlankClip(length=Int(1000*AudioLengthF(last)/Audiorate(last)), width=32, height=32, fps=25), last)
LWLibavAudioSource and BestAudioSource don't work for me.
vBulletin® v3.8.11, Copyright ©2000-2026, vBulletin Solutions Inc.