Welcome to Doom9's Forum, THE in-place to be for everyone interested in DVD conversion.

Before you start posting please read the forum rules. By posting to this forum you agree to abide by the rules.

 

Go Back   Doom9's Forum > Capturing and Editing Video > Avisynth Development
Register FAQ Calendar Today's Posts Search

Reply
 
Thread Tools Search this Thread Display Modes
Old 26th August 2021, 02:36   #41  |  Link
kedautinh12
Registered User
 
Join Date: Jan 2018
Posts: 2,156
Here have x86 ver
https://drive.google.com/file/d/1F3F...ew?usp=sharing
kedautinh12 is offline   Reply With Quote
Old 15th September 2021, 19:15   #42  |  Link
Forcewielder
Registered User
 
Join Date: Jan 2020
Posts: 4
Quote:
Originally Posted by Forcewielder View Post
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.
Forcewielder is offline   Reply With Quote
Old 15th September 2021, 19:31   #43  |  Link
Myrsloik
Professional Code Monkey
 
Myrsloik's Avatar
 
Join Date: Jun 2003
Location: Kinnarps Chair
Posts: 2,555
Quote:
Originally Posted by Forcewielder View Post
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.
__________________
VapourSynth - proving that scripting languages and video processing isn't dead yet
Myrsloik is offline   Reply With Quote
Old 15th September 2021, 20:27   #44  |  Link
Forcewielder
Registered User
 
Join Date: Jan 2020
Posts: 4
Quote:
Originally Posted by Myrsloik View Post
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/6mxc5...mple1.mp4/file
Attached Files
File Type: txt football.avs.txt (269 Bytes, 26 views)
File Type: txt football.ffmpeg.txt (77 Bytes, 23 views)
Forcewielder is offline   Reply With Quote
Old 19th September 2021, 10:56   #45  |  Link
Myrsloik
Professional Code Monkey
 
Myrsloik's Avatar
 
Join Date: Jun 2003
Location: Kinnarps Chair
Posts: 2,555
Quote:
Originally Posted by Forcewielder View Post
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/6mxc5...mple1.mp4/file
Uh what? why are you talking about gray frames when it's an audio source?
__________________
VapourSynth - proving that scripting languages and video processing isn't dead yet
Myrsloik is offline   Reply With Quote
Old 19th September 2021, 20:31   #46  |  Link
Forcewielder
Registered User
 
Join Date: Jan 2020
Posts: 4
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.
Forcewielder is offline   Reply With Quote
Old 25th October 2021, 13:51   #47  |  Link
FranceBB
Broadcast Encoder
 
FranceBB's Avatar
 
Join Date: Nov 2013
Location: Royal Borough of Kensington & Chelsea, UK
Posts: 2,905
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:

Code:
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

Code:
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

Code:
@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

Last edited by FranceBB; 25th October 2021 at 16:44.
FranceBB is offline   Reply With Quote
Old 25th October 2021, 18:52   #48  |  Link
Balling
Registered User
 
Join Date: Feb 2020
Posts: 541
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.
Balling is offline   Reply With Quote
Old 25th October 2021, 21:09   #49  |  Link
FranceBB
Broadcast Encoder
 
FranceBB's Avatar
 
Join Date: Nov 2013
Location: Royal Borough of Kensington & Chelsea, UK
Posts: 2,905
Quote:
Originally Posted by Balling View Post
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()
FranceBB is offline   Reply With Quote
Old 25th October 2021, 23:57   #50  |  Link
tebasuna51
Moderator
 
tebasuna51's Avatar
 
Join Date: Feb 2005
Location: Spain
Posts: 6,915
Seems the ffmpeg support of mxf container is still incomplete.

See a ffmpeg report of your mxf file:
Quote:
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):
Quote:
ffmpeg.exe -i DolbyE.mxf -map 0:1 -acodec copy -f u8 stream1.u8
the extracted stream1.u8 is now recognized like Dolby E:
Quote:
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

Quote:
#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.
__________________
BeHappy, AviSynth audio transcoder.

Last edited by tebasuna51; 26th October 2021 at 13:06.
tebasuna51 is offline   Reply With Quote
Old 26th October 2021, 14:08   #51  |  Link
FranceBB
Broadcast Encoder
 
FranceBB's Avatar
 
Join Date: Nov 2013
Location: Royal Borough of Kensington & Chelsea, UK
Posts: 2,905
Right. The "issue" is that I use (or rather "we use" here at Sky) indexers in an automated fashion, so there must be a way to detect that it's actually DolbyE in an automated fashion without extracting the .u8 every time and I think it should be included in the indexer, I mean, indexers should be able to detect this and handle the case accordingly without the user having to see the mediainfo every time or know that it's getting DolbyE prior to indexing it.
FranceBB is offline   Reply With Quote
Old 26th October 2021, 14:19   #52  |  Link
Myrsloik
Professional Code Monkey
 
Myrsloik's Avatar
 
Join Date: Jun 2003
Location: Kinnarps Chair
Posts: 2,555
Quote:
Originally Posted by FranceBB View Post
Right. The "issue" is that I use (or rather "we use" here at Sky) indexers in an automated fashion, so there must be a way to detect that it's actually DolbyE in an automated fashion without extracting the .u8 every time and I think it should be included in the indexer, I mean, indexers should be able to detect this and handle the case accordingly without the user having to see the mediainfo every time or know that it's getting DolbyE prior to indexing it.
BestAudioSource doesn't index. And with that roundabout procedure it certainly sounds like half your post should become a FFmpeg bug report. If FFmpeg commandline fails you fix things upstream.
__________________
VapourSynth - proving that scripting languages and video processing isn't dead yet
Myrsloik is offline   Reply With Quote
Old 27th October 2021, 11:22   #53  |  Link
tebasuna51
Moderator
 
tebasuna51's Avatar
 
Join Date: Feb 2005
Location: Spain
Posts: 6,915
Maybe any further comment about this feature request can continue here: https://forum.doom9.org/showthread.p...00#post1955900
__________________
BeHappy, AviSynth audio transcoder.
tebasuna51 is offline   Reply With Quote
Reply


Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump


All times are GMT +1. The time now is 03:28.


Powered by vBulletin® Version 3.8.11
Copyright ©2000 - 2024, vBulletin Solutions Inc.