Madcow
25th September 2017, 23:36
For archiving purposes I ripped Lawrence Of Arabia (restored version) using MakeMKV. The file has 43 GB including multiple audio streams.
My goal is the best compression, keeping the best perceived quality. I don't care how much time the encoding takes, as I'll bedoing it on a spare server at work. I read into ffmpeg and did also some own research encoding multiple sample files, comparing screenshots, etc. Right now, CRF 21 is very close to lossless in my samples. Some other things I noted:
Tune:grain is preferred because tune:film washes out the grain a little, but very noticably at the top and bottom, even at crf:18.
Preset:very slow, just to get even better quality and compression. Time is not a factor.
I use a filter to crop out the black bars. (I learned that this doesn't noticeably change the size, but I prefer to not have them in the video.) The video has 1920*876 pixels.
My currently favoured setting is this:
ffmpeg -i .\Lawrence-of-Arabia.mkv -crf 21 -preset very slow -tune grain -filter:v "crop=1920:876:0:102" .\Lawrence-of-Arabia-out.mkv
My questions are those:
The first and last row of pixels in the video is slightly lighter than the rest of the video. This is quite distracting. I had two solutions in mind: making them 50% darker with ffmpeg, if that is possible, or just crop them out. Anyhow, the movie was recorded on 2.20 aspect ratio, that would make 1920*872,7px or 1920*873px. With that, my crop would look like this: "crop=1920:873:0:103". What do you suggest I do?
I read that 2-pass or multi-pass doesn't contribute to quality or compression with CRF. Can't remember where. Is that true?
Final question: Looking through the forum I seem to get the impression that crf, preset and tune is really enough. What do you think of my ffmpeg settings? Is there anything else I can or should add to reach my goal / improve quality and compression?
If that is helpful, this is the info of the ripped mkv file.
index=0
codec_name=h264
codec_long_name=H.264 / AVC / MPEG-4 AVC / MPEG-4 part 10
profile=High
codec_type=video
codec_time_base=1001/48000
codec_tag_string=[0][0][0][0]
codec_tag=0x0000
width=1920
height=1080
coded_width=1920
coded_height=1080
has_b_frames=1
sample_aspect_ratio=1:1
display_aspect_ratio=16:9
pix_fmt=yuv420p
level=41
color_range=N/A
color_space=unknown
color_transfer=unknown
color_primaries=unknown
chroma_location=left
field_order=progressive
timecode=N/A
refs=1
is_avc=true
nal_length_size=4
id=N/A
r_frame_rate=24000/1001
avg_frame_rate=24000/1001
time_base=1/1000
start_pts=0
start_time=0.000000
duration_ts=N/A
duration=N/A
bit_rate=N/A
max_bit_rate=N/A
bits_per_raw_sample=8
nb_frames=N/A
nb_read_frames=N/A
nb_read_packets=N/A
DISPOSITION:default=0
DISPOSITION:dub=0
DISPOSITION:original=0
DISPOSITION:comment=0
DISPOSITION:lyrics=0
DISPOSITION:karaoke=0
DISPOSITION:forced=0
DISPOSITION:hearing_impaired=0
DISPOSITION:visual_impaired=0
DISPOSITION:clean_effects=0
DISPOSITION:attached_pic=0
DISPOSITION:timed_thumbnails=0
TAG:language=eng
TAG:BPS-eng=22214866
TAG:DURATION-eng=03:47:00.607000000
TAG:NUMBER_OF_FRAMES-eng=326568
TAG:NUMBER_OF_BYTES-eng=37822495514
TAG:SOURCE_ID-eng=001011
TAG:_STATISTICS_WRITING_APP-eng=MakeMKV v1.10.7 win(x64-release)
TAG:_STATISTICS_WRITING_DATE_UTC-eng=2017-09-23 15:52:18
TAG:_STATISTICS_TAGS-eng=BPS DURATION NUMBER_OF_FRAMES NUMBER_OF_BYTES SOURCE_ID
My goal is the best compression, keeping the best perceived quality. I don't care how much time the encoding takes, as I'll bedoing it on a spare server at work. I read into ffmpeg and did also some own research encoding multiple sample files, comparing screenshots, etc. Right now, CRF 21 is very close to lossless in my samples. Some other things I noted:
Tune:grain is preferred because tune:film washes out the grain a little, but very noticably at the top and bottom, even at crf:18.
Preset:very slow, just to get even better quality and compression. Time is not a factor.
I use a filter to crop out the black bars. (I learned that this doesn't noticeably change the size, but I prefer to not have them in the video.) The video has 1920*876 pixels.
My currently favoured setting is this:
ffmpeg -i .\Lawrence-of-Arabia.mkv -crf 21 -preset very slow -tune grain -filter:v "crop=1920:876:0:102" .\Lawrence-of-Arabia-out.mkv
My questions are those:
The first and last row of pixels in the video is slightly lighter than the rest of the video. This is quite distracting. I had two solutions in mind: making them 50% darker with ffmpeg, if that is possible, or just crop them out. Anyhow, the movie was recorded on 2.20 aspect ratio, that would make 1920*872,7px or 1920*873px. With that, my crop would look like this: "crop=1920:873:0:103". What do you suggest I do?
I read that 2-pass or multi-pass doesn't contribute to quality or compression with CRF. Can't remember where. Is that true?
Final question: Looking through the forum I seem to get the impression that crf, preset and tune is really enough. What do you think of my ffmpeg settings? Is there anything else I can or should add to reach my goal / improve quality and compression?
If that is helpful, this is the info of the ripped mkv file.
index=0
codec_name=h264
codec_long_name=H.264 / AVC / MPEG-4 AVC / MPEG-4 part 10
profile=High
codec_type=video
codec_time_base=1001/48000
codec_tag_string=[0][0][0][0]
codec_tag=0x0000
width=1920
height=1080
coded_width=1920
coded_height=1080
has_b_frames=1
sample_aspect_ratio=1:1
display_aspect_ratio=16:9
pix_fmt=yuv420p
level=41
color_range=N/A
color_space=unknown
color_transfer=unknown
color_primaries=unknown
chroma_location=left
field_order=progressive
timecode=N/A
refs=1
is_avc=true
nal_length_size=4
id=N/A
r_frame_rate=24000/1001
avg_frame_rate=24000/1001
time_base=1/1000
start_pts=0
start_time=0.000000
duration_ts=N/A
duration=N/A
bit_rate=N/A
max_bit_rate=N/A
bits_per_raw_sample=8
nb_frames=N/A
nb_read_frames=N/A
nb_read_packets=N/A
DISPOSITION:default=0
DISPOSITION:dub=0
DISPOSITION:original=0
DISPOSITION:comment=0
DISPOSITION:lyrics=0
DISPOSITION:karaoke=0
DISPOSITION:forced=0
DISPOSITION:hearing_impaired=0
DISPOSITION:visual_impaired=0
DISPOSITION:clean_effects=0
DISPOSITION:attached_pic=0
DISPOSITION:timed_thumbnails=0
TAG:language=eng
TAG:BPS-eng=22214866
TAG:DURATION-eng=03:47:00.607000000
TAG:NUMBER_OF_FRAMES-eng=326568
TAG:NUMBER_OF_BYTES-eng=37822495514
TAG:SOURCE_ID-eng=001011
TAG:_STATISTICS_WRITING_APP-eng=MakeMKV v1.10.7 win(x64-release)
TAG:_STATISTICS_WRITING_DATE_UTC-eng=2017-09-23 15:52:18
TAG:_STATISTICS_TAGS-eng=BPS DURATION NUMBER_OF_FRAMES NUMBER_OF_BYTES SOURCE_ID