I'm transcoding various video files to h264/ac3/mp4 using ffmpeg+x264. I have some upfront steps to do before invoking ffmpeg, such as determine fps, audio bitrate and the like, so I'm calling MediaInfo to gather that information from the source files. I started thinking about the crf levels that I can specify at encoding time. I'm thinking, if I have a higher bitrate video, the quality is probably pretty good already, and wouldn't need more quality control with a lower crf value. The opposite with lower bitrate video. So does the following make sense?:
if video bitrate < 4000, set crf to 15,
if video bitrate between 4000 and 8000, set crf 16,
if video bitrate between 8000 and 12000, set crf 17,
if video bitrate between 12000 and 16000, set crf 18,
and so on...
(I haven't checked the bitrates on my videos, so the above numbers were pulled out of the air)
Thanks for any advice!
+ Reply to Thread
Results 1 to 11 of 11
Doesn't really make sense, because CRF will allocate bitrate according to the complexity of the video.
Note "complexity" doesn't necessarly correlate with quality. For example, a grainy or noisy movie like "300" will require buckets load more bitrate to encode than a "clean" movie
If you used the same CRF value, you theoretically get the same "average quality" for all the videos, and their bitrates will reflect that, some higher , some lower
Let's say we have two videos which we would like to recode using CRF. Video #1 is nothing but explosions for 30 minutes, and video #2 is 30 minutes of some guy sitting stationary in an empty room. Both were originally encoded at the same bit rate using multi pass encoding and take up exactly the same amount of disk space.
When we recode these files using CRF, the encoder will keep adding or subtracting bit rate as it sees fit to maintain a certain quality. The final result would be two files which are massively different in size, even though MediaInfo told you that the original files were encoded using similar settings.
If the size of the recoded files is important, then you should use 2 pass encoding.
Last edited by mh2360; 1st May 2011 at 21:34.
I think I understand what the OP is saying: with a poor quality source you want to lose as little additional quality as possible when re-encoding. On the other hand, with a higher quality source losing a little more quality from re-encoding may still leave you with a decent result. There's some logic to that but you'd have to play around a lot to see what suited you.
I don't think it's worth worrying about. Just find a quality level (CRF value) you're happy with and use that all the time. Or adjust the CRF value depending on how important the video is to you and how important the picture quality is to the video. For example, in a TV sitcom the picture quality is less important than in an epic movie.
Last edited by jagabo; 1st May 2011 at 22:20.
I think jagabo interpreted my post the way I had intended. If indeed the source is poor, I don't want to degrade the quality further by setting a crf value of say, 50 (an example bordering on hyperbole). But I can see from the other posts that bitrate isn't the sole factor to consider when determining a video's "quality", and actually bitrate may be only a minor consideration, at best. The video sources I'm dealing with relate to my favorite band that broke up in 1980 because "we could not continue as we were", the videos ranging from handheld video either from behind the scenes, or from the audience, on equipment from 30-40+ years ago, to "unreleased" pro-shot concert footage. So indeed, "quality" is truly subjective.
What I think I'll end up doing is prior to encoding, request a crf value on a file by file basis. That way, if a video was shot on a 8mm camera from 40+ years ago, I can try to reduce further degradation by giving it a lower crf value. I really should learn avisynth, and tailor a script as needed...
Best is to keep a copy of your original. As technology or your skills improve you can always filter/encode again to make a new copy for day to day viewing.
orangeboy, are you just converting these to push up to your tivo? Are you space limited? Not sure if most of these are SD video or if you have a mix of SD and HD, but I would recommend just using a crf of 19. The percentage savings can be fairly significant if you can use something like crf 20-21 vs 19, but if you are talking about MPEG2 SD video, the bitrate savings is already huge (4000-8000 kbps to 1000-2000 kbps). Not sure if extra work to go from ~1700 kbps to ~1200 kbps is really worth the effort.
That's a bummer. I hate it when I have drive crashes on my tivos (only had two, but they are never fun).
Thankfully it's not one of the TiVo drives. I built a fileserver with a couple TBs. This five month old drive was a replacement for one that failed within 30 days. Yeesh...
Interesting. I had a similar experience when I set up my machine for video editing. I was running 4 1TB drives in raid5 and lost one within the first 30 days. After that, I configured them to run as separate drives using Sync Toys to echo them. They have run for 2+ years now without incident.