VideoHelp Forum
+ Reply to Thread
Results 1 to 8 of 8
Thread
  1. Hi

    Could someone help me with a code for ffmpeg to convert a 2160p video 60fps down to 1080p ?

    I used the following code - ffmpeg -i input4kvid.mp4 -vf scale=1920:1080 -c:a copy output1080vid.mp4.

    Everything's fine but the output size is down from 60gb to 3 gb!
    What do I need to input to get an exact copy of audio and video without losing any quality? Can I change the output from hevc to x264 ?

    Secondly could you clarify one more thing if you are aware - does converting a 60fps video down to 23.98 fps mean it'll drop frames and affect the quality of the video ? ANy way around it ?

    Many Thanks
    Quote Quote  
  2. Originally Posted by sillymovie View Post

    Everything's fine but the output size is down from 60gb to 3 gb!
    If you want less quality loss, larger filesizes - use a lower crf . The default for libx264 is 23

    e.g. -crf 18

    What do I need to input to get an exact copy of audio and video without losing any quality?
    Code:
    -c:a copy -c:v copy
    This means no scaling. Scaling means you cannot copy


    Can I change the output from hevc to x264 ?
    -c:v libx264

    If you don't specify a codec for mp4, but default ffmpeg right now will select libx264 anyways

    Secondly could you clarify one more thing if you are aware - does converting a 60fps video down to 23.98 fps mean it'll drop frames and affect the quality of the video ?
    If the original had 60 unique frames /s of real motion, not duplicates, then dropping frames will affect the smoothness of the video because you have fewer motion samples

    Re-encoding with lossy codec will negatively affect the quality in terms of each frame quatliy



    ANy way around it ?
    No
    Quote Quote  
  3. My 2 cents, use zscale instead scale ( or perhaps libplacebo ), it may be required to perform HDR to SDR mapping, side to this you may need to perfrom frame rate conversion (libplacebo?) - i would add also small temporal blur to retain some motion fluidity ( tmix filter )
    Quote Quote  
  4. Thanks @poisondeathray and @pandy

    Would either of you care to provide me with the code ( I copied the old one from somewhere else) or look at this one if its alright for a copy with no quality loss (I know the size would increase).


    ffmpeg -i input4kvid.mp4 -vf scale=1920:1080 -c:a copy -crf 0 preset very slow output1080vid.mp4

    It somehow looks clunky! Obviously I'd change the preset and -crf to match the quality I need.
    Quote Quote  
  5. Originally Posted by sillymovie View Post

    if its alright for a copy with no quality loss (I know the size would increase).


    ffmpeg -i input4kvid.mp4 -vf scale=1920:1080 -c:a copy -crf 0 preset very slow output1080vid.mp4

    It somehow looks clunky! Obviously I'd change the preset and -crf to match the quality I need.

    Nothing about that is a "copy", except for the audio

    You lose quality when downscaling

    -crf 0 is lossless only for 8bit encoding for libx264. If the source pixel type was 10bit, and you wanted to preserve that with lossless encoding use -qp 0
    Quote Quote  
  6. Originally Posted by poisondeathray View Post
    Originally Posted by sillymovie View Post

    if its alright for a copy with no quality loss (I know the size would increase).


    ffmpeg -i input4kvid.mp4 -vf scale=1920:1080 -c:a copy -crf 0 preset very slow output1080vid.mp4

    It somehow looks clunky! Obviously I'd change the preset and -crf to match the quality I need.

    Nothing about that is a "copy", except for the audio

    You lose quality when downscaling

    -crf 0 is lossless only for 8bit encoding for libx264. If the source pixel type was 10bit, and you wanted to preserve that with lossless encoding use -qp 0
    Thanks for that. Could you possibly write down the correct code for just copy with no quality loss for x264 ? Apologies for the trouble.
    Quote Quote  
  7. Originally Posted by sillymovie View Post
    Could you possibly write down the correct code for just copy with no quality loss for x264 ?


    There is quality loss from downscaling, but no additional quality loss from lossless encoding with -qp 0 for x264 for supported pixel types

    Code:
    ffmpeg -i input4kvid.mp4 -vf scale=1920:1080 -c:v libx264 -qp 0 -c:a copy  output1080vid.mp4
    Quote Quote  
  8. @poisondeathray - Much obliged for this!
    Quote Quote  



Similar Threads

Visit our sponsor! Try DVDFab and backup Blu-rays!