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. |
23rd March 2018, 07:50 | #1 | Link |
Registered User
Join Date: Mar 2018
Posts: 9
|
how to get avisynth to read sony xdavc-L file?
how to get avisynth to read sony xdavc-L file?
currently i'm trying with: FFMpegSource("H:\video\A011C026_180312ZU.MXF") and get "video codec not found" error. i think the sony format is h264, though, that FFMpeg reads with no problems. and further, i CAN get FFmpeg to read/convert it. and if/when i get it to read the file, how to apply a LUT to it. again - one can do this in FFmpeg... |
23rd March 2018, 10:46 | #2 | Link |
Registered User
Join Date: Oct 2011
Posts: 275
|
Hello,
With a basic file using this profile in Vegas for rendering : Sony MXF HD EX 1280x720 60fps and avisynth+ x64 ( cannot guarantee for other versions ) FFVideoSource works for the video Code:
LoadPlugin("H:\Plugins\ffms2.dll") FFVideoSource("H:\test.mxf", colorspace = "YUV420P8") Code:
LoadPlugin("H:\Plugins\ffms2.dll") FFVideoSource("H:\test.mxf", colorspace = "YUV420P8", cachefile = "H:\TEMP\test.mxf.ffindex") Code:
LoadPlugin("H:\Plugins\DSS2.dll") DSS2("H:\test.mxf") Code:
LoadPlugin("H:\Plugins\LSMASHSource.dll") LWLibavVideoSource("H:\test.mxf", format = "YUV420P8") As for applying 3DLut's this isn't possible sadly with avisynth as far as i now, something i searched for long without success, would love to see avisytnh support either 3DLuts like .cube or simply be able to apply some haldclut's but i don't have much hope to see this possible one day sadly :/ Edit for video + audio : Code:
LoadPlugin("H:\Plugins\ffms2.dll") AudioDub( FFVideoSource("H:\test.mxf", colorspace = "YUV420P8"), FFAudioSource("H:\test.mxf") ) Code:
LoadPlugin("H:\Plugins\ffms2.dll") video = FFVideoSource("H:\test.mxf", colorspace = "YUV420P8") audio= FFAudioSource("H:\test.mxf") return AudioDub(video, audio) Last edited by Yanak; 23rd March 2018 at 11:06. |
23rd March 2018, 15:55 | #3 | Link |
Registered User
Join Date: Sep 2007
Posts: 5,374
|
What version of ffms2 are you using ?
vapoursynth has a timecube filter that can apply cube LUTS , but it hasn't been ported to avisynth. You can make a request https://github.com/sekrit-twc/timecube https://forum.doom9.org/showthread.php?t=173361 |
23rd March 2018, 16:10 | #4 | Link |
Registered User
Join Date: Oct 2011
Posts: 275
|
Hi,
I use the one shipped with Staxrip, should be this one, 2.23.1 : https://github.com/FFMS/ffms2/releases I saw in vapoursynth documentation that is supported some LUT's when i was searching for this long time ago but not using vapoursynth i did not pursue in this direction, thanks for the links, I'll try to do a request in the forum thread you linked and see how it goes , this will be really neat if possible with avisynth, have nothing to loose asking Thank you |
23rd March 2018, 16:21 | #5 | Link | |
Registered User
Join Date: Sep 2007
Posts: 5,374
|
Quote:
Usually MXF indicates the "prosumer" version, not the consumer variant. This means uncompressed audio and 10bit422 . I suspect the ffms2 he is using is older |
|
23rd March 2018, 16:43 | #6 | Link |
Registered User
Join Date: Oct 2011
Posts: 275
|
I suspected it
with rendered 10 bits 422 i had issues, didn't went too far in testing so maybe something is possible or issue was on my end maybe. Don't know for original files in this format, did not searched for samples. |
23rd March 2018, 17:10 | #7 | Link |
...?
Join Date: Nov 2005
Location: Florida
Posts: 1,420
|
Well, if 'FFmpegSource' as the function name is actually doing something and throwing error messages about video codecs (rather than AviSynth complaining that the function doesn't exist), that's a huge blinking red sign that the version is from the old 1.x series. Not even FFMS2.
|
24th March 2018, 05:26 | #8 | Link | |
Registered User
Join Date: Mar 2018
Posts: 9
|
ffms2 - file date 12/29/2016
Quote:
where to get the later version if there is one? and yes, i have the LoadPlugin("C:\Program Files (x86)\AviSynth\plugins\ffms2.dll") line on the .AVS script. the problem was that my command was FFMpegSource NOT FFvideoSource. had gotten that somewhere when googled for it. now the clip loads. but yes, i would really need LUT so that i don't have to do a 2nd pass with FFmpeg. i guess out of luck there... |
|
24th March 2018, 06:10 | #9 | Link |
Registered User
Join Date: Sep 2007
Posts: 5,374
|
vapoursynth; yanak already requested the port . You can even load avs scripts in vapoursynth
what type of lut ? there is an old plugin ddcc by tritical for avisynth, but it uses a different type of 3DLUT, not the commonly used cube or 3dl . It might be possible to do some conversion What is the background information ? What is the 2nd pass in ffmpeg (why can't 1pass be the final pass) ? What is the final format goal ? What are you doing in avisynth and after ? |
24th March 2018, 07:26 | #10 | Link | |
Registered User
Join Date: Mar 2018
Posts: 9
|
Quote:
but would like to resize, auto-Levels/Gain and stabilize in avisynth before. i'm not the guy to do a port from some other LUT - i trust way too involved for me. 2nd pass would be to just to apply the LUT... but i guess i CAN feed FFMpeg with the .AVS if i figure out the right command line. this is an ongoing/developing concern for such footage, but for now i just want to view dailies from manageable-size proxy files - h265 / 1080 instead of the 4k that the cam shoots. Last edited by zdoe; 24th March 2018 at 07:29. |
|
24th March 2018, 09:51 | #11 | Link |
Registered User
Join Date: Oct 2011
Posts: 275
|
Hello,
You can feed FFMpeg with the avs script and apply the LUT, something like this: The avs script (+ the filters you need/want): Code:
LoadPlugin("H:\Plugins\ffms2.dll") video = FFVideoSource("H:\test.mxf", colorspace = "YUV420P8") audio= FFAudioSource("H:\test.mxf") return AudioDub(video, audio) Code:
ffmpeg -hide_banner -i "H:\script.avs" -filter_complex lut3d="H\\:/LUTs/CineStyle\ S\ Curve.cube" -c:v libx264 -preset slow -crf 18 -c:a copy output.mkv You will notice the weird path name for the LUT location in the command above, my LUT applied to the script is located here on my machine: Code:
"H:\LUTs\CineStyle S Curve.cube" Code:
"H\\:/LUTs/CineStyle\ S\ Curve.cube" The FFmpeg encoding parameters and codec need to be adjusted to your needs ( and maybe refined for the colorspaces used ) but hopefully this helps a bit Last edited by Yanak; 24th March 2018 at 09:57. |
24th March 2018, 15:58 | #12 | Link | ||
Registered User
Join Date: Sep 2007
Posts: 5,374
|
Quote:
Also, auto-levels/ gain before the LUT application might be problematic. slog is flat . If you "auto" contrast it before, that sort of messes everything up Quote:
|
||
25th March 2018, 18:11 | #13 | Link | |
Registered User
Join Date: Mar 2018
Posts: 9
|
Quote:
currently i have FFmpeg command line as: "C:\Program Files (x86)\FFmpeg\ffmpeg.exe" -threads 1 -i "H:\03-12\MXFautoadjustDepan.AVS" -vf lut3d="SLog3SGamut3CineToLC-709.cube" -c:v libx265 -preset fast -b:v 1600k -c:a aac -b:a 128k -metadata:s:a:0 lang=en output265.mkv and .AVS: LoadPlugin("C:\Program Files (x86)\AviSynth\plugins\ffms2.dll") LoadPlugin("C:\Program Files (x86)\AviSynth\plugins\AutoAdjust.dll") LoadPlugin("C:\Program Files (x86)\AviSynth\plugins\depanestimate.dll") LoadPlugin("C:\Program Files (x86)\AviSynth\plugins\depan.dll") FFvideoSource("H:\03-12\video\A010C059_1803129F.MXF") Lanczos4Resize(1920,1080) i = ConvertToYV12(matrix="rec709") mdata = DePanEstimate(i) vectors=MSuper().MAnalyse(isb=false,blksize=8, overlap=0,search=5) globalmotion=MDepan(vectors,pixaspect=1,thSCD1=500) DePanStabilize(i, data=mdata) AutoAdjust(auto_gain=true, auto_balance=true) this works for the video, but audio tracks are empty. how to have the audio carry over? i tried: video = FFVideoSource("H:\test.mxf", colorspace = "YUV420P8") audio= FFAudioSource("H:\test.mxf") return AudioDub(video, audio) and get an error message from the resize filter. and yes, i can see where auto-contrast would be problematic for slog footage. the output looks pretty good though. once i figure out the audio part, what i need is a way to do this for all files in a directory recursively... probably doable, but variables in a batch file are kinda challenging. |
|
25th March 2018, 18:23 | #14 | Link |
Registered User
Join Date: Sep 2007
Posts: 5,374
|
To load the audio, it depends on the audio configuration . You have to load each track with FFAudioSource, and specify the track number. You can use mergechannels() to send them or you might want to down mix them to stereo since it looks like you're using 2ch aac
For example 4channel mono Code:
FFVideoSource("blah.mxf") #whatever video filters here, depan etc... vid=last aud1=FFAudioSource("blah.mxf", track=1) aud2=FFAudioSource("blah.mxf", track=2) aud3=FFAudioSource("blah.mxf", track=3) aud4=FFAudioSource("blah.mxf", track=4) aud=mergechannels(aud1,aud2,aud3,aud4) audiodub(vid,aud) Yes, it's possible to do recursive subfolders with ffmpeg batch . There are some examples posted at videohelp.com and I think here too |
26th March 2018, 08:25 | #16 | Link | |
Registered User
Join Date: Mar 2018
Posts: 9
|
Quote:
the mergechannels above seems to NOT merge, but to somehow bundle the tracks together. as for the recursive batch - does avisynth do variables? |
|
26th March 2018, 09:39 | #17 | Link | |
Registered User
Join Date: Mar 2018
Posts: 9
|
Quote:
otherwise i'll have to do FFvideo/FFaudio -Source, but that needs multiple references to the source file - which worries me because of the ultimate result - recursion. indexing time doesn't worry me that much - the batch can run overnight if i get it to work. |
|
26th March 2018, 12:05 | #19 | Link | |
Registered User
Join Date: Mar 2018
Posts: 9
|
Quote:
anyway, now i have: aud1=FFAudioSource("H:\03-12\video\A011C001_1803129K.MXF", track=1) aud2=FFAudioSource("H:\03-12\video\A011C001_1803129K.MXF", track=2) aud3=FFAudioSource("H:\03-12\video\A011C001_1803129K.MXF", track=3) audR=MixAudio(aud2, aud3, 0.75, 0.075) aud=mergechannels(aud1,audR) audiodub(vid,aud) and it works, though i'm not sure what i should do with the level-parameters. |
|
27th March 2018, 11:24 | #20 | Link |
Registered User
Join Date: Mar 2018
Posts: 9
|
ok - i'm getting close, i think, but still errors
avs: Code:
SetWorkingDir("C:\Program Files (x86)\AviSynth\plugins\") LoadPlugin("ffms2.dll") LoadPlugin("AutoAdjust.dll") LoadPlugin("depanestimate.dll") LoadPlugin("depan.dll") LoadPlugin("GetSystemEnv.dll") BlankClip() zname=GetSystemEnv("zname") subtitle(getsystemenv("zname")) FFvideoSource(zname) Lanczos4Resize(1920,1080) i = ConvertToYV12(matrix="rec709") mdata = DePanEstimate(i) vectors=MSuper().MAnalyse(isb=false,blksize=8, overlap=0,search=5) globalmotion=MDepan(vectors,pixaspect=1,thSCD1=500) DePanStabilize(i, data=mdata) AutoAdjust(auto_gain=true, auto_balance=true) vid=last aud1=FFAudioSource("H:\economist-03-12\video\A011C001_1803129K.MXF", track=1) aud2=FFAudioSource("H:\economist-03-12\video\A011C001_1803129K.MXF", track=2) aud3=FFAudioSource("H:\economist-03-12\video\A011C001_1803129K.MXF", track=3) audR=MixAudio(aud2, aud3, 0.75, 0.075) aud=mergechannels(aud1,audR) audiodub(vid,aud) Code:
for /r %%f in (\video\*) do ( set zname=h:\video\%%~nxf :: timeout 1 goto ffcommand ) :ffcommand "C:\Program Files (x86)\FFmpeg\ffmpeg.exe" -threads 1 -i "H:\03-12\callsavariable.AVS" -vf lut3d="SLog3SGamut3CineToLC-709.cube" -c:v libx265 -preset fast -b:v 1600k -c:a aac -b:a 128k -metadata:s:a:0 lang=en pause goto end :end set pause Trailing options were found on the commandline. [avisynth @ 00168460] FFVideoSource: Can't open 'h:\video\A011C001_1803129K.MXF' (H:\03-12\callsavariable.AVS, line 11) H:\03-12\callsavariable.AVS: Unknown error occurred e.g. even though the .AVS can read the variable if run on its own, when used in a batch it doesn't. "Trailing options were found on the commandline." i assume is caused by the fact that target file is not defined for ffmpeg. all hail to GetSystemEnv author @stickboy, by the way. |
Tags |
avisynth, ffmpegsource, h265, sony, xdavc |
Thread Tools | Search this Thread |
Display Modes | |
|
|