peridian
20th October 2012, 23:39
Hi,
This is probably yet another "I don't understand" thread, but I've been playing around with Avisynth for over a month now, and still have unanswered questions.
I've got a lot of DVDs I'd like to transcode to mp4 so I can stream them at home. Batch transcoding is the easy part, I wanted to see if I could use AviSynth to ensure I keep as cleaned up a version of the video as I can.
After a lot of Googling and trial and error, this is the script I have so far:
# Load required plugins.
loadplugin("F:\AviSynth\plugins\DGDecode.dll")
loadplugin("F:\AviSynth\plugins\NicAudio.dll")
loadplugin("F:\AviSynth\plugins\nnedi2.dll")
loadplugin("F:\AviSynth\plugins\mvtools2.dll")
loadplugin("F:\AviSynth\plugins\MT.dll")
loadplugin("F:\AviSynth\plugins\mt_masktools-25.dll")
loadplugin("F:\AviSynth\plugins\RemoveGrain.dll")
loadplugin("F:\AviSynth\plugins\Repair.dll")
loadplugin("F:\AviSynth\plugins\vertical cleaner\VerticalCleaner.dll")
# Import Deinterlacer
import("TempGaussMC_beta2.avsi")
# Function for re-use.
function Transcode(string dvdIndex,
\ string ac3Audio,
\ int trimFrames,
\ float audioDelay,
\ int cropLeft,
\ int cropTop,
\ int cropWidth,
\ int cropHeight,
\ bool isInterlaced,
\ int newWidth)
{
video = mpeg2Source(dvdIndex, cpu=0, info=3) # Get dv2 index file and ac3 audio output from DGIndex.
audio = nicAC3Source(ac3Audio)
video = Trim(video, trimFrames, 0) # Trim the start off the video as appropriate.
AudioDub(video, audio) # Combine audio with video.
DelayAudio(audioDelay - 0.1) # Delay the audio in order to keep in-sync.
# Adjusts by 100ms as AudioDub seems to introduce a slight delay.
ConvertToYV12(interlaced=isInterlaced) # Convert colour space.
Crop(cropLeft, cropTop, cropWidth, cropHeight) # Crop off unwanted black borders.
TempGaussMC_beta2(1, 1, 0, 0, 0, 0,
\ sharpness=0,
\ Smode=0,
\ SLmode=0,
\ Sbb=0,
\ SVthin=0.0,
\ EdiMode="NNEDI2") # Quick settings (approx: 10-12fps)
#TempGaussMC_beta2(tr2=3,
# \ sharpness=1.7,
# \ SLrad=2,
# \ Sbb=2,
# \ SVthin=0.75,
# \ Sovs=2,
# \ EdiMode="NNEDI2") # Slow settings (approx: 0.5 - 2fps)
SelectEven() # Select only half the frames from the above deinterlacing.
# Note: This causes audio sync issues.
ratio = float(width) / float(height) # Determine new video height to maintain aspect ratio.
newHeight = round(newWidth / ratio / 2) * 2
return Lanczos4Resize(newWidth, newHeight) # Upscale to new width, with appropriate height.
#return spline36resize(newWidth, newHeight)
#return nnedi2_rpow2(rfactor=2, cshift="spline36resize", fwidth=newWidth, fheight=newHeight)
#return nnedi2_rpow2(rfactor=2, cshift="Lanczos4Resize", fwidth=newWidth, fheight=newHeight)
}
#################
## Do the work ##
#################
mpegIndex = "H:\Andromeda\Andromeda.d2v"
ac3File = "H:\Andromeda\Andromeda AC3 T01 2_0ch 192Kbps DELAY -19ms.ac3"
Transcode(mpegIndex, ac3File, 206, -0.019, 6, 2, -6, -2, true, 1024)
The questions I have are:
I cannot see any difference/impact between AssumeBFF and AssumeTFF. Do these even apply to DVD vob files?
When I don't use SelectEven, the video is at 50fps and the audio is perfect, but when I do use SelectEven, the video is at 25fps and the audio seems to be ever so slightly out of sync. I would prefer the 25fps video, but how do I ensure that the audio remains in sync?
I cannot see any difference in the use of the interlaced flag on ConvertToYV12, it certainly doesn't prompt any deinterlacing by itself. Do I even need to use this?
I cannot see any difference between the Lanczos4 and spline36 resize options, and some articles seem to suggest there isn't any. Is there?
A lot of people seem to think using the nnedi2 version of the resize functions is better, but I cannot see any difference and the nnedi2 version takes far longer to process. Is there any point in using it?
A lot of people seem to think TGMC is very good. While I have used the really high quality settings to see a significant improvement in some videos, the sheer additional processing time just is not worth it imo. Is there a simple alternative that would deliver good quality deinterlacing / cleanup but without masses of extra processing time?
Would appreciate any advice or help with this, as I would like to start batch processing these DVDs sooner rather than later.
Regards,
Rob.
This is probably yet another "I don't understand" thread, but I've been playing around with Avisynth for over a month now, and still have unanswered questions.
I've got a lot of DVDs I'd like to transcode to mp4 so I can stream them at home. Batch transcoding is the easy part, I wanted to see if I could use AviSynth to ensure I keep as cleaned up a version of the video as I can.
After a lot of Googling and trial and error, this is the script I have so far:
# Load required plugins.
loadplugin("F:\AviSynth\plugins\DGDecode.dll")
loadplugin("F:\AviSynth\plugins\NicAudio.dll")
loadplugin("F:\AviSynth\plugins\nnedi2.dll")
loadplugin("F:\AviSynth\plugins\mvtools2.dll")
loadplugin("F:\AviSynth\plugins\MT.dll")
loadplugin("F:\AviSynth\plugins\mt_masktools-25.dll")
loadplugin("F:\AviSynth\plugins\RemoveGrain.dll")
loadplugin("F:\AviSynth\plugins\Repair.dll")
loadplugin("F:\AviSynth\plugins\vertical cleaner\VerticalCleaner.dll")
# Import Deinterlacer
import("TempGaussMC_beta2.avsi")
# Function for re-use.
function Transcode(string dvdIndex,
\ string ac3Audio,
\ int trimFrames,
\ float audioDelay,
\ int cropLeft,
\ int cropTop,
\ int cropWidth,
\ int cropHeight,
\ bool isInterlaced,
\ int newWidth)
{
video = mpeg2Source(dvdIndex, cpu=0, info=3) # Get dv2 index file and ac3 audio output from DGIndex.
audio = nicAC3Source(ac3Audio)
video = Trim(video, trimFrames, 0) # Trim the start off the video as appropriate.
AudioDub(video, audio) # Combine audio with video.
DelayAudio(audioDelay - 0.1) # Delay the audio in order to keep in-sync.
# Adjusts by 100ms as AudioDub seems to introduce a slight delay.
ConvertToYV12(interlaced=isInterlaced) # Convert colour space.
Crop(cropLeft, cropTop, cropWidth, cropHeight) # Crop off unwanted black borders.
TempGaussMC_beta2(1, 1, 0, 0, 0, 0,
\ sharpness=0,
\ Smode=0,
\ SLmode=0,
\ Sbb=0,
\ SVthin=0.0,
\ EdiMode="NNEDI2") # Quick settings (approx: 10-12fps)
#TempGaussMC_beta2(tr2=3,
# \ sharpness=1.7,
# \ SLrad=2,
# \ Sbb=2,
# \ SVthin=0.75,
# \ Sovs=2,
# \ EdiMode="NNEDI2") # Slow settings (approx: 0.5 - 2fps)
SelectEven() # Select only half the frames from the above deinterlacing.
# Note: This causes audio sync issues.
ratio = float(width) / float(height) # Determine new video height to maintain aspect ratio.
newHeight = round(newWidth / ratio / 2) * 2
return Lanczos4Resize(newWidth, newHeight) # Upscale to new width, with appropriate height.
#return spline36resize(newWidth, newHeight)
#return nnedi2_rpow2(rfactor=2, cshift="spline36resize", fwidth=newWidth, fheight=newHeight)
#return nnedi2_rpow2(rfactor=2, cshift="Lanczos4Resize", fwidth=newWidth, fheight=newHeight)
}
#################
## Do the work ##
#################
mpegIndex = "H:\Andromeda\Andromeda.d2v"
ac3File = "H:\Andromeda\Andromeda AC3 T01 2_0ch 192Kbps DELAY -19ms.ac3"
Transcode(mpegIndex, ac3File, 206, -0.019, 6, 2, -6, -2, true, 1024)
The questions I have are:
I cannot see any difference/impact between AssumeBFF and AssumeTFF. Do these even apply to DVD vob files?
When I don't use SelectEven, the video is at 50fps and the audio is perfect, but when I do use SelectEven, the video is at 25fps and the audio seems to be ever so slightly out of sync. I would prefer the 25fps video, but how do I ensure that the audio remains in sync?
I cannot see any difference in the use of the interlaced flag on ConvertToYV12, it certainly doesn't prompt any deinterlacing by itself. Do I even need to use this?
I cannot see any difference between the Lanczos4 and spline36 resize options, and some articles seem to suggest there isn't any. Is there?
A lot of people seem to think using the nnedi2 version of the resize functions is better, but I cannot see any difference and the nnedi2 version takes far longer to process. Is there any point in using it?
A lot of people seem to think TGMC is very good. While I have used the really high quality settings to see a significant improvement in some videos, the sheer additional processing time just is not worth it imo. Is there a simple alternative that would deliver good quality deinterlacing / cleanup but without masses of extra processing time?
Would appreciate any advice or help with this, as I would like to start batch processing these DVDs sooner rather than later.
Regards,
Rob.