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-4 AVC / H.264
Register FAQ Calendar Today's Posts Search

Reply
 
Thread Tools Search this Thread Display Modes
Old 16th January 2014, 17:13   #1  |  Link
somy
Registered User
 
Join Date: Dec 2009
Posts: 177
X264 encoder settings for SD content captured from camcorder

Hi,

I have some uncompressed AVI files captured from my old camcorder, and videos are interlaced (50i) in DVD quality.
To reduce the storage size, I'd like to convert them to MP4 with the help of X264 (with GUI).
I'd like to ask whether if it is the correct way to go and if so,
what would be the optimal settings for X264 encoder if I want the max. quality and reasonable file size?

Thank you in advance!

Last edited by somy; 16th January 2014 at 22:20.
somy is offline   Reply With Quote
Old 16th January 2014, 17:20   #2  |  Link
Stereodude
Registered User
 
Join Date: Dec 2002
Location: Region 0
Posts: 1,436
Whether it's the correct way to go or not depends on what you want to do with these files down the road. That usage may also drive the "optimal" settings.

Do you plan to just watch them as is occasionally? You want to save them for later editing / processing work?

FWIW, max. quality and reasonable file size are generally on opposite ends of the spectrum so you're going to have to compromise somewhere.

Last edited by Stereodude; 16th January 2014 at 17:22.
Stereodude is offline   Reply With Quote
Old 16th January 2014, 19:29   #3  |  Link
somy
Registered User
 
Join Date: Dec 2009
Posts: 177
Quote:
Originally Posted by Stereodude View Post
Whether it's the correct way to go or not depends on what you want to do with these files down the road. That usage may also drive the "optimal" settings.

Do you plan to just watch them as is occasionally? You want to save them for later editing / processing work?

FWIW, max. quality and reasonable file size are generally on opposite ends of the spectrum so you're going to have to compromise somewhere.
Thank you for your reply and sorry I didn't write it clearly.
I plan to keep the videos in my PC and just watch them occasionally, I don't plan to edit them further.
I tried to encode the video to mpeg2 with the bitrate 9000kbs, and I'm happy with the result. I'd like to know what would be the proper bitrate if I use X264 encoder instead? I'd like to keep the quality at least similar to 9000kbs mpeg2.
Thank you!
somy is offline   Reply With Quote
Old 16th January 2014, 19:43   #4  |  Link
Stereodude
Registered User
 
Join Date: Dec 2002
Location: Region 0
Posts: 1,436
You probably should use the veryslow preset and find the CRF value that looks acceptable to you by encoding a sample, watch the results, and adjusting the CRF setting upward (lower numbers) until you are happy with the results. You could start at something like 20. Once you are happy with the video quality from that CRF value encode all the video files you have with that CRF.

So your command line would look something like this:

x264 --crf 20 --preset veryslow --tune film --level 3.1 --keyint 25 --open-gop --tff --colorprim "bt470bg" --transfer "bt470bg" --colormatrix "bt470bg" --sar 12:11 -o out.264 input.avi

This assumes your content is PAL 704x576, 4:3, and top field first.
Stereodude is offline   Reply With Quote
Old 16th January 2014, 22:20   #5  |  Link
somy
Registered User
 
Join Date: Dec 2009
Posts: 177
Quote:
Originally Posted by LoRd_MuldeR View Post
@somy:
Please edit your thread title to make it comply with forum rule #12. Thanks!
Modified, sorry!
somy is offline   Reply With Quote
Old 16th January 2014, 22:26   #6  |  Link
somy
Registered User
 
Join Date: Dec 2009
Posts: 177
Quote:
Originally Posted by Stereodude View Post
You probably should use the veryslow preset and find the CRF value that looks acceptable to you by encoding a sample, watch the results, and adjusting the CRF setting upward (lower numbers) until you are happy with the results. You could start at something like 20. Once you are happy with the video quality from that CRF value encode all the video files you have with that CRF.

So your command line would look something like this:

x264 --crf 20 --preset veryslow --tune film --level 3.1 --keyint 25 --open-gop --tff --colorprim "bt470bg" --transfer "bt470bg" --colormatrix "bt470bg" --sar 12:11 -o out.264 input.avi

This assumes your content is PAL 704x576, 4:3, and top field first.
Thanks! I tried CRF 20 in HandBrake which looks fine to me, and the size is half of the original mpeg2 file.
I have one doubt though, my original videos are interlaced with 25 FPS. If I use decomb option in HandBrake, shall I set the output FPS to 25 or 50?
somy is offline   Reply With Quote
Old 16th January 2014, 23:16   #7  |  Link
Atak_Snajpera
RipBot264 author
 
Atak_Snajpera's Avatar
 
Join Date: May 2006
Location: Poland
Posts: 7,815
50 fps
Atak_Snajpera is offline   Reply With Quote
Old 16th January 2014, 23:42   #8  |  Link
Stereodude
Registered User
 
Join Date: Dec 2002
Location: Region 0
Posts: 1,436
Quote:
Originally Posted by somy View Post
Thanks! I tried CRF 20 in HandBrake which looks fine to me, and the size is half of the original mpeg2 file.
I have one doubt though, my original videos are interlaced with 25 FPS. If I use decomb option in HandBrake, shall I set the output FPS to 25 or 50?
Deinterlace or decomb? Your footage is interlaced, and it's highly unlikely a decomb (IVTC) operation is the proper thing to do to it. If a CRF of 20 is fine, keep trying higher numbers until it's not fine, then go back down 1.
Stereodude is offline   Reply With Quote
Old 16th January 2014, 23:59   #9  |  Link
nm
Registered User
 
Join Date: Mar 2005
Location: Finland
Posts: 2,641
HandBrake's decomb filter is a deinterlacer with various parameters and algorithm options.
nm is offline   Reply With Quote
Old 17th January 2014, 04:12   #10  |  Link
Asmodian
Registered User
 
Join Date: Feb 2002
Location: San Jose, California
Posts: 4,407
Quote:
Originally Posted by somy View Post
Thanks! I tried CRF 20 in HandBrake which looks fine to me, and the size is half of the original mpeg2 file.
I just want to make sure but you are starting with the uncompressed AVIs in HandBrake and not the MPEG2s, right?
Asmodian is offline   Reply With Quote
Old 17th January 2014, 09:12   #11  |  Link
somy
Registered User
 
Join Date: Dec 2009
Posts: 177
Quote:
Originally Posted by Asmodian View Post
I just want to make sure but you are starting with the uncompressed AVIs in HandBrake and not the MPEG2s, right?
Thanks for the hint! That was the plan until yesterday I found out that I deleted the original AVIs long time ago......
I guess your point is the transcoding from compressed MPEG2 to H264 will suffer quality loss, and in this regard maybe it is better to keep the MPEG2 files?
somy is offline   Reply With Quote
Old 17th January 2014, 09:13   #12  |  Link
somy
Registered User
 
Join Date: Dec 2009
Posts: 177
Quote:
Originally Posted by nm View Post
HandBrake's decomb filter is a deinterlacer with various parameters and algorithm options.
That's how I read it in Handbrake's WIKI. Decomb applys YADIF (slower deinterlacing) when it detect the frame which needs deinterlacing. However the manual it doesn't say whether I should double the frame rate or not.
somy is offline   Reply With Quote
Reply


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 06:40.


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