1
I have a app which takes in user's video and does some processing. the processing pipeline consists of multiple steps. The code which i have written so far assumes h264 codec for input video. But user's input cant be assumed to be in a particular format/codec so i am thinking of adding one more step at the start of pipeline ie to transcode any given input video to h264. But i am trying to minimise the dataloss in the video because of this step. Also it is possible that user's uploaded video will not be a lossless one infact mostly likely it will be a lossy h264 video.
I can use crf=0 while transcoding the input video
ffmpeg -i input.mp4 -c:v h264 -crf 0 output.mp4
but this results in huge file sizes which impacts the next steps in the pipeline.
Now lets say i use crf=18 for above mentioned transcoding step
ffmpeg -i input.mp4 -c:v h264 -crf 18 output.mp4
and also lets assume the input video also had crf=18 so in this case will this transcoding step result in data loss ?
In short: yes. It will make a lossy video even lossy-er. – MonkeyZeus – 2016-03-03T14:04:21.227
What's the processing you do, how much fidelity is required, what's the purpose of the end result? – Gyan – 2016-03-03T14:36:09.447
@Mulvya the tool is supposed to post process a video ie adding text or image overlays on top of videos. its intended to be used by casual users (end videos might end up being shared by users on their social networks etc). – gaurav – 2016-03-03T15:01:55.010
Then lower CRF value to between 12 and 15 and use that. For casual use, it's fine. – Gyan – 2016-03-03T15:05:40.927