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 > Video Encoding > MPEG-2 Encoding

Reply
 
Thread Tools Search this Thread Display Modes
Old 29th December 2017, 23:39   #1  |  Link
FranceBB
FranceBB
 
FranceBB's Avatar
 
Join Date: Nov 2013
Location: Germany
Posts: 219
Automatically crop to 1920x1080i XDCAM with ffmpeg

Hi,
on my personal computer I generally use Avisynth to do all sort of post-processing and serve a 1920x1080i PAL 25fps video to ffmpeg to encode it as XDCAM 50 Mbit/s.
Unfortunately, at work we use Vantage to transcode, but it fails with some files.
I'm not allowed to install Avisynth, except in a standalone box.
(I can't always transfer files to that computer via Hard Drive, encode them with Avisynth and then transfer them back).
I'm however allowed to put ffmpeg.exe on every computer, 'cause it's portable.
Anyway, I'd like to use ffmpeg "automatically".
Let me get this straight.
I'd like ffmpeg to resize and crop files to 1920x1080i PAL 25fps, using Lanczos as resizer and make 8 mono audio tracks.
So far, I tried with this, but it doesn't crop automatically and it doesn't create 8 mono audio tracks.
I'd also like it to do frame rate conversion with blending.

Code:
ffmpeg.exe -i "test.mp4" -pix_fmt yuv422p -vcodec mpeg2video -vf "scale=1920:1080:force_original_aspect_ratio=increase,crop=1920:1080" -vf yadif=1:tff,scale=w=1920:h=1080:sws_flags=spline+accurate_rnd+full_chroma_int+full_chroma_inp:sws_dither=0:in_range=tv:out_range=tv,unsharp=luma_msize_x=3:luma_msize_y=3:luma_amount=0.8,interlace -s 1920:1080 -aspect 16:9 -vf setfield=tff -flags +ildct+ilme -r 25 -b:v 50000k -minrate 50000k -maxrate 50000k -bufsize 36408333 -acodec pcm_s16le -ar 48000 -g 12 -bf 2 -profile:v 0 -level:v 2 -color_range 1 -color_primaries 1 -color_trc 1 -colorspace 1 -f mxf "output.mxf"
My target is XDCAM, so 4:2:2 yv16, 8bit, MPEG-2, closed GOP M=3, N=12, 50 Mbit/s, range limited, BT709, interlaced, TFF, 25fps PAL, with 8 mono PCM audio channels.

Last edited by FranceBB; 30th December 2017 at 01:20.
FranceBB is offline   Reply With Quote
Old 29th December 2017, 23:56   #2  |  Link
ChaosKing
Registered User
 
Join Date: Dec 2005
Location: Germany
Posts: 194
Virtualdub for example works with Avisynth as "portable" if you copy the avisynth dll in the same folder as the vdub exe (or in PATH). I think this should work with other tools too.

Or try this https://forum.doom9.org/showthread.php?t=172124
__________________
Search and denoise

Last edited by ChaosKing; 29th December 2017 at 23:59.
ChaosKing is offline   Reply With Quote
Old 30th December 2017, 00:42   #3  |  Link
FranceBB
FranceBB
 
FranceBB's Avatar
 
Join Date: Nov 2013
Location: Germany
Posts: 219
Looks like Avisynth Universal Installer needs administrator rights



I tried to put Avisynth.dll and devil.dll in the VirtualDub folder.
Then, I tried to run a very simple script:

LoadPlugin("C:\Users\bucciantinif\Desktop\VirtualDub\plugins\DirectShowSource.dll")
DirectShowSource("test.mp4")

Doesn't work.



It would be good to have Avisynth portable, but I guess it's not that easy. Link


EDIT: I managed to make it work.

Ok, so now I basically have Avisynth. Cool.

Is there a way to specify the Avisynth autoload directory without adding a reg file?

For the moment, problem solved like this:

Code:
LoadPlugin("C:\Encoding\plugins\ffms2.dll")
video=FFVideoSource("test.mp4")
audio=FFAudioSource("test.mp4")
AudioDub(video, audio)


ResampleAudio(48000)
Normalize(0.89)
Limiter(min_luma=16, max_luma=235, min_chroma=16, max_chroma=240)

ConvertFPS(50)
Spline64Resize(1920, 1080)
assumeTFF()
separatefields()
selectevery(4,0,3)
weave()
Converttoyv16(interlaced=true)

Last edited by FranceBB; 30th December 2017 at 01:11.
FranceBB is offline   Reply With Quote
Old 30th December 2017, 09:32   #4  |  Link
ChaosKing
Registered User
 
Join Date: Dec 2005
Location: Germany
Posts: 194
Yes, there is AddAutoloadDir(). More info here http://avisynth.nl/index.php/AviSynth%2B
__________________
Search and denoise
ChaosKing is offline   Reply With Quote
Reply

Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

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 12:29.


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