digitalFAQ.com Forum

digitalFAQ.com Forum (https://www.digitalfaq.com/forum/)
-   Project Planning, Workflows (https://www.digitalfaq.com/forum/video-workflows/)
-   -   Raw VHS AVI filter and MP4 encoding workflow? (https://www.digitalfaq.com/forum/video-workflows/6158-raw-vhs-avi.html)

sanCapture 10-11-2014 01:04 PM

Raw VHS AVI filter and MP4 encoding workflow?
 
1 Attachment(s)
I have about 10 hours of raw huffyuv vhs video I captured about 6 months ago with a TBC. Since then I have spent a great deal of time researching and refining some avs scripts and mp4 encoding setting. The quality of the VHS tapes are pretty good so they don't need much restoration.

Below are the basics of my avs and encode batch script. I was wondering if anyone might have any quick suggestions or see any glaring bad things to do when converting VHS video to mp4. The weather has finally cooled down enough here where I can let my computer run a few days rendering the videos.

I think my main concern might be with using the non default i422 color space with x264. After comparing a few different images and flipping back and forth between them though, i422 looks minutely better. The mp4 sssim values for each frame also seem to be a bit jagged (see graph) and there is a lot of P/B frame switches. I suspect that's because I'm encoding the 60fps de-interlaced video and it's to be expected or just normal x264 encoding.

video1.avs
Code:

h=4 s=1 br=-14 c=1.1                            # Video Dependent args
avisource("C:\_Vhs\<file>", pixel_type="YUY2")  # input raw huffyuv video file
AssumeTFF()                                      # Required for all captured videos
ConvertToYV12(interlaced = true)                # De-lace with YV12 slightly better
QTGMC(Preset="Slow")                            # Final render Deinterlace
Tweak(hue=h,sat=s,bright=br,cont=c,coring=false) # Video Dependent, args above
crop(6,2,-10,-10)                                # All VHS Videos
ConvertToYUY2(interlaced = false)                # Slightly better mp4 results with i422
spline36resize(640,480)                          # Best resizer that keeps sharpness

encode.bat
Code:

set in=C:\_Vhs\scripts\video1
set out=D:\rendered\video1

set x264=C:\VHSProj\x264-r2431-ac76440.exe
set avs2pipe=C:\VHSProj\avs2pipe26_vs.exe
set neroAacEnc=C:\VHSProj\neroAacEnc.exe
set mp4box=C:\VHSProj\mp4box.exe

set args=--level 3.1 --bitrate 9600 --vbv-bufsize 12500 --vbv-maxrate 12500
set args=%args% --keyint 120 --output-csp i422
set audArgs=-ignorelength -lc -br 256000

"%x264%" %args% --output "%out%.264" "%in%.avs"
"%avs2pipe%" audio "%in%.avs" | "%neroAacEnc%" %audArgs% -if - -of "%out%.aac"
"%mp4box%" -add "%out%.264" -add "%out%.aac" "%out%.mp4"

x264 debug
Code:

...
f=240 QP=13.96 NAL=3 Slice:I Poc:0  I:1200 P:0    SKIP:0    size=67129 bytes SSIM Y:0.99318
f=241 QP=17.07 NAL=2 Slice:P Poc:6  I:512  P:688  SKIP:0    size=35490 bytes SSIM Y:0.98831
f=242 QP=19.94 NAL=2 Slice:B Poc:4  I:5    P:928  SKIP:235  size=6850 bytes SSIM Y:0.98376
f=243 QP=20.81 NAL=0 Slice:B Poc:2  I:0    P:831  SKIP:337  size=4578 bytes SSIM Y:0.98421
...

http://www.digitalfaq.com/forum/atta...1&d=1413050478

sanlyn 10-11-2014 04:04 PM

Quote:

Originally Posted by sanCapture (Post 34700)
Below are the basics of my avs and encode batch script. I was wondering if anyone might have any quick suggestions or see any glaring bad things to do when converting VHS video to mp4.

Can't really comment in much detail because no one here knows what your videos look like. Can't help with x264 command line.

Quote:

Originally Posted by sanCapture (Post 34700)
I think my main concern might be with using the non default i422 color space

Depends on the final disposition you plan for your encodes. I assume the colorspace and deinterlacing are for PC-only or web display, although you likely can't use i422 for the web. The better computer media players are good at deinterlacing, but maybe you're not using one of those for PC playback. Are you sure these VHS sources are interlaced and not telecined? VHS recordings of movies and animation usually use some form of pulldown (telecine). Obviously you don't intend to go to DVD or BluRay/AVCHD for these videos -- the frame size, colorspace, deinterlacing, and frame rate would all be out of spec for those formats.

You might consider these points:

QTGMC(Preset="Slow") and QTGMC() mean the same thing. "Slow" is the default. Are you sure you need the strong filtering in slow mode? Faster modes filter less, run faster, lose less detail but still do a decent job of cleaning.

Why are you cropping? Bad borders? Head-switching noise? Anyway, thre's always a quality cost to resizing, especially when it's not necessary, and especially if it alters the original aspect ratio proportions of the image. We have no video sample, so no one knows the original captured frame size. Resizing involves greater rounding errors when resizing by small fractional increments like 0.2x instead of 2x, 3x, etc. Resizing can be avoided by replacing cropped portions with AddBorders() to maintain the original image size + proportions.

sanCapture 10-12-2014 11:04 PM

Thanks for the replay. Sorry, yeah I should have explained my final disposition. My plan is to get rid of the raw (400gb) videos after converting them and then have the encoded mp4's as my master copies (40gb). I will likely only ever watch the mp4s directly on a computer. If I was going to put it on web or DVD I would re-encode it from the high bit-rate mp4s to whatever output standard is needed.

The videos vary from family moves to TV recordings. I'm trying to keep it simple and only adjust the color, levels, and time ranges between all the clips.

All the captured VHS is interlaced. I spent a lot of time debating weather to Deinterlace now or not and came to the conclusion I want to do it now. I think its better to Deinterlace with the raw video before its encoded that way there is a lot more detail the deinterlacer can wok with and I can give it plenty of time (8fps). I compared 12 different Deinterlace but I never thought that a faster qtgmc setting might give better results. I will have to do a few spot checks and compare now, thanks for the tip.

The cropping is to remove the black boarder and bottom head noise. I figured since I want to resize to the correct aspect anyway (720x480 -> 640x480) it would not make much a difference with the slight cropping.


All times are GMT -5. The time now is 08:59 AM

Site design, images and content © 2002-2024 The Digital FAQ, www.digitalFAQ.com
Forum Software by vBulletin · Copyright © 2024 Jelsoft Enterprises Ltd.