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 ?