I digitized a VHS tape to a lossless AVI file and want to convert it to H264 using Handbrake. I tried to use virtualdub to figure out whether to determine if my lossless AVI file was BFF or TFF using virtualdub and a avs script using AssumeTFF().Bob() and AssumeBFF().Bob() but honestly I don't see much difference between the two. I guess my old eyes aren't so good. What would be the correct Handbrake detelecine and x264 advanced options for this clip and how would I figure this out myself?
+ Reply to Thread
Results 1 to 27 of 27
-
-
The clip is tff, the script method you mentioned works fine, moving one frame forward at a time in vdub
will be smooth if the field order is correct, but have a back and forth movement if it's wrong.
In HB, filters tab, set "interlace detection" to off, and "deinterlace" to yadif/bob.
On the Video tab set frame rate to 59.94/constant -
AVISynth is not needed for determining the field order.
Just open your file in VDub, set the Deinterlace filter to Yadif and Double Frame Rate, TFF.
Step through some movement and in the right pane, observe smooth, always forward motion or jumpy forward-back motion. If jumpy, swap to BFF to confirm.
The vast majority (all, in my case) of tape "captures" are TFF eg VHS. DV "transfers" are normally BFF. -
There is not need of a useless deinterlace operation (Bob, Yadif, whatever) to understand field order.
In fact TFF/BFF means top/bottom field first, not frame.
Just use a simple AviSynth script with AssumeTFF().separateFields() or AssumeBFF().separateFields() and step field by field to check proper motion.
And while there, you can also check the field architecture (interlaced, telecine, progressive, etc.). -
Or once we are in Avisynth, FWIW:
Code:LWLibavVideoSource("your_source") converttoYV16(interlaced=true) clip=last frame=clip.subtitle(" frame",size=24).showframenumber(scroll=true,x=55,y=100,size=24).showtime(x=100,y=128,size=18) top = clip.AssumeTFF().separatefields().subtitle(" Assuming TFF",size=24).showframenumber(scroll=true,x=55,y=100,size=24).showtime(x=100,y=128,size=18) bottom = clip.AssumeBFF().separatefields().subtitle(" Assuming BFF",size=24).showframenumber(scroll=true,x=55,y=100,size=24).showtime(x=100,y=128,size=18) SBS=stackhorizontal(top,bottom) # select the view from above: return SBS # frame or top or bottom or SBS
-
Originally Posted by Lollo
Why can't you just accept other's points of view, Lollo? -
If someone asks "How should I hammer in a nail with a screwdriver?", should we answer his question or should we show better alternatives?
-
I accept everything, and did not mean you in particular referred to frame. Just telling to OP the proper procedure.
Nice! Mine had not the frame number nor the time:
Code:video_org=AviSource("<fileName") # separate fields tff video_org_sep_tff=video_org.AssumeTFF().separateFields() # separate fields bff video_org_sep_bff=video_org.AssumeBFF().separateFields() # separate fields tff even video_org_sep_tff_even=video_org_sep_tff.SelectEven() # separate fields tff odd video_org_sep_tff_odd=video_org_sep_tff.SelectOdd() # to check if progressive or interlaced return(video_org_sep_tff) #return(video_org_sep_bff) # to check if TFF or BFF for interlaced segments #stackhorizontal(\ #subtitle(video_org_sep_tff,"video_org_sep_tff",size=28,align=2),\ #subtitle(video_org_sep_bff,"video_org_sep_bff",size=28,align=2)\ #) # display fields separately #stackvertical(\ #subtitle(video_org_sep_tff_even,"video_org_sep_tff_even",size=28,align=2),\ #subtitle(video_org_sep_tff_odd,"video_org_sep_tff_odd",size=28,align=2)\ #) # display frames and display fields separately (equivalent to VirtualDub plugin ViewFields) #stackhorizontal(\ #subtitle(video_org,"video_org",size=28,align=2),\ #stackvertical(\ #subtitle(video_org_sep_tff_even,"video_org_sep_tff_even",size=28,align=2),\ #subtitle(video_org_sep_tff_odd,"video_org_sep_tff_odd",size=28,align=2)\ #)\ #)
-
-
Originally Posted by Sharc
Originally Posted by Sharc
Originally Posted by Lollo -
This is false and misleading for any reader. Deinterlacing for checking the field architecture may lead to false conclusions, as i showed you many times (just read the old threads, I don’t want to comment any further).
You insist to use a screwdriver for a nail, fine, but leave us the rigth to give to others the proper procedures without adding your useless comments. -
Nowhere was mentioned Avisynth, until you brought it up in your first sentence in post#3. Why? Hammer in place of screwdriver, possibly?
Nobody critizised your reply in post #3. Why reacting offended when others just proposed a simple Avisynth alternative, a tool which you brought into the discussion? Why did you chime in after davexnet has properly explained the OP's Handbrake question in post#2?
I don't understand, but we can stop here, skipping your past misinterpretations of field sequences. End of rant.
Last edited by Sharc; 1st Mar 2025 at 08:13.
-
Originally Posted by Sharc
Why did you chime in after davexnet has properly explained the OP's Handbrake question in post#2?
Rant indeed. -
Thanks.
I was originally planning to keep the output as interlaced and I have seen elsewhere this could be done with handbrake by not deinterlacing and specifying advanced options for x264 (i.e. interlace=tff) however I changed my mind and have started to encode using handbrake with the following options:
Decomb with preset EEDI2 Bob
All other options off.
Constant framerate 59.94
CQ 18
Encoder preset: Slow
Encoder tune: Film
My end goal is to give a DVD to my folks who at this point in their lives aren't up for anything more technology challenging than putting a disk into their Blu-Ray player.
I have pretty new rig with an I7-13700F and the 1.5 hour clip is still going about 6.5 hours.
Let me know if something else would make more sense. -
-
If you just want to burn an encoded file onto a disc which the (blu-ray) player can hopefully play, make sure that the player supports
- the medium (type of disc)
- the file format (video codec, audio codec, and container), for example H.264 (x264) for video (interlaced or double rate deinterlaced progressive, aac for audio, .mp4 or .mkv container.
Check the player specs or try it.
If you want to build a compliant Blu-ray disc you need a Blu-ray authoring tool.
If you really want a true DVD you would need a DVD authoring app like AVStoDVD or DVDStyler which will also create the DVD files structure.
Or easier use a DVD recorder and live with the quality compromise due to the on-the-fly mpeg2 encode.
Example for DVDStyler attached.Last edited by Sharc; 2nd Mar 2025 at 02:37.
-
Thanks. I forgot about AVStoDVD. I have used it in the past. I was thinking that MPEG2 output wouldn't provide good enough quality for a DVD size. I do have some shorter videos to convert and high bitrate MPEG2 encoding should work fine. For longer videos, I'll probably make some H264 output disk as well using Handbrake. I did noticed that AVStoDVD assumed that my source was progressive rather than interlaced and the aspect ratio was wrong as well. I think that the AVI container causes that. I also wanted to also crop the video head switching noise at the bottom of the frame. Therefore I had to edit the encoder command parameters at runtime as described below in the AviSynth script I used:
DirectShowSource("C:\video.avi")
#
# VHS tape captures are assumed to be top field first
AssumeTFF()
#
# Letterbox is used to remove the VHS head switching
# noise at the bottom of the video frame.
Letterbox(0,6)
#
# If using AVStoDVD then on the main screen
# hit F8 to show advanced project settings.
# Select "Edit Encoder Command Parameters at runtime".
# Assuming that the HCENC video encoder is used,
# at runtime change the HCENC options to have the below:
# *INTERLACED
# *TTF
# *ASPECT 4:3
#
# If present, remove *PROGRESSIVE, *BFF, and other *ASPECT from the HCENC options.
# -
-
Okay. Now back to trying to get Handbrake to have the correct display aspect ratio.
Handbrake reports my AVI file which is interlaced 720x480 as having an aspect ratio of 3:2. It should be 4:3 for final display (NTSC SD).
I set the output container as MP4.
I set all Handbrake options to off.
I set the frame rate to same as source.
I added the following to the encoder options advanced option box:
interlace=ttfar=10/11
Mediainfo is reports the output file as progressive with a 3:2 aspect ratio. It seems like I am not entering the advanced options correctly.
Handbrake is showing what I entered in its log output. -
Can't help you with Handbrake.
Use this ffmpeg commandline instead:
Code:ffmpeg -y -i "Clip3.avi" -c:a aac -c:v libx264 -preset slow -crf 17 -flags +ilme+ildct -pix_fmt yuv420p -vf "scale=interl=1,crop=704:472:6:0,pad=704:480:-1:-1:color=black,setsar=10/11,setfield=tff,format=pix_fmts=yuv420p" "out.mp4"
Last edited by Sharc; 2nd Mar 2025 at 13:43. Reason: file attached
-
Thanks.
I had started to go with a ffmpeg command line as well. The below is what I came up with before I read your post.
ffmpeg -y -i Clip3.avi -aspect 4:3 -vf "drawbox=x=0:y=ih-6:w=iw:h=6:color=black:t=fill" -c:a ac3 -b:a 192k -ac 2 -ar 48k -c:v libx264 -preset slow -crf 22 -x264opts interlaced=1 output.mkv
I will take a look at the filter commands you used to figure how they worked.Last edited by johnnyquid; 2nd Mar 2025 at 18:11. Reason: forgot the -aspect 4:3
-
Sharc taught us this last year. Handbrake cropping and resizing to square pixels:
[Attachment 85880 - Click to enlarge]
Originally Posted by Johnny
My Deinterlace settings for Yadif (I typed in "TFF"):
[Attachment 85882 - Click to enlarge]
AVISynth/QTGMC/VDub2 ripped through it at 180fps (Prefetch 24 set).
Lollo, put your dummy back in.Last edited by Alwyn; 2nd Mar 2025 at 21:41. Reason: Added Deinterlace settings image
-
Here the Handbrake settings for non-square (anamorph) encoding with PAR 10:11, DAR 4:3.
I gave up on it because it treats the chroma badly for interlaced 4:2:0 encoding. The chroma advances at framerate only instead of fieldrate. Same for the DVDStyler encode of post#16 btw. Maybe something goes wrong when doing the 4:2:2 to 4:2:0 conversion in ffmpeg mpeg2, and/or because HB seems to always flag interlaced video as progressive. I didn't analyze it further.
The ffmpeg commandline of post#21 handles the chroma correctly. (Similar can be done in Avisynth of course).Last edited by Sharc; 4th Mar 2025 at 06:51.
-
Here a simple Avisynth script to visualize the chroma motion.
Step through fields 9....20 and see the motion advancement of the left arm of the pianist.
Code:LWLibavVideoSource("your_source") assumeTFF() #set the field order correctly separatefields() tweak(sat=2.0) #increase the contrast stackvertical(UtoY().subtitle("U"),VtoY().Subtitle("V"))
Last edited by Sharc; 3rd Mar 2025 at 02:58. Reason: P.S. added
-
-
Similar Threads
-
Handbrake on low priority setting still high CPU usage
By tom z in forum Video ConversionReplies: 7Last Post: 9th Sep 2023, 22:34 -
Trying to deinterlace but the field order changes randomly?
By xAlienxx in forum DVD RippingReplies: 25Last Post: 2nd Jan 2023, 02:19 -
Field order inversion using ffmpeg
By cjdavis83 in forum Video ConversionReplies: 6Last Post: 28th Dec 2021, 18:00 -
Field-blended video with messed up field order
By bruno321 in forum RestorationReplies: 1Last Post: 23rd Feb 2021, 10:34 -
Interlacing and field order problem
By Boklavdi in forum Video ConversionReplies: 33Last Post: 26th Apr 2020, 13:05