VideoHelp Forum

Try DVDFab and download streaming video, copy, convert or make Blu-rays,DVDs! Download free trial !
+ Reply to Thread
Results 1 to 9 of 9
Thread
  1. Hello guys, I have mkv file with subtitles merged on it, I need to convert to MP4 with subtitles hardcoded or burned into the mp4, I did this command "ffmpeg -i file.mkv -vf subtitles=file.mkv file.mp4" and works great but takes about 25 minutes for each file, then i try to add "-preset ultrafast -crf 0" but converts files from 250Mb to 8.8Gb.. any way to do this fast and losseless quality??
    Quote Quote  
  2. I'm a Super Moderator johns0's Avatar
    Join Date
    Jun 2002
    Location
    canada
    Search Comp PM
    Get a faster computer and add a 2 to crf so it reads as -crf 20.
    I think,therefore i am a hamster.
    Quote Quote  
  3. the veryfast preset is about twice as fast as the medium preset (the default). If you have a graphics card with hardware encoding you can get even faster encoding, with about the same quality as the veryfast preset.
    Quote Quote  
  4. preset veryfast is faster than ultrafast? i try ultrafast and crf 0
    Quote Quote  
  5. I'm a Super Moderator johns0's Avatar
    Join Date
    Jun 2002
    Location
    canada
    Search Comp PM
    Dont use crf 0,use crf 20 or you will still get a big file.What kind of computer do you have?
    I think,therefore i am a hamster.
    Quote Quote  
  6. i7, 16ram, ssd, not video card yet...

    i do this command

    ffmpeg -i file.mkv -vf subtitles=file.srt -preset veryfast -crf 24 file.mp4 and works GREAT! file size less than 50% of the original size, quality not loss, now facing the subtitle size is very small, is there a way to change the size ?
    Quote Quote  
  7. Originally Posted by tomasrage View Post
    preset veryfast is faster than ultrafast? i try ultrafast and crf 0
    No, it's faster than medium. In your first command line (ffmpeg -i file.mkv -vf subtitles=file.mkv file.mp4) you didn't specify a preset so the default, medium, was used.

    Originally Posted by tomasrage View Post
    ffmpeg -i file.mkv -vf subtitles=file.srt -preset veryfast -crf 24 file.mp4 and works GREAT! file size less than 50% of the original size, quality not loss...
    The quality is less than the original. You just haven't looked closely enough.

    Originally Posted by tomasrage View Post
    now facing the subtitle size is very small, is there a way to change the size ?
    Add the Fontsize spec:
    Code:
    -vf "subtitles=file.srt:force_style='Fontsize=24'"
    Last edited by jagabo; 8th Jan 2020 at 06:59.
    Quote Quote  
  8. Quote from video.baba :
    What's important to you? Speed, quality? or size? (pick two!)
    You can't have all three qualities, unless you're God or Chuck Norris.
    The setting suggested above, -crf 20, is a good compromise as the quality loss will be barely noticeable and the file size will stay manageable. Depending on the purpose of the MP4 file(s), if using a fast preset, you may want to select a lower CRF value (= higher quality) to compensate.

    To preview the size / style of subtitles, create a simple Avisynth script and open it with either VirtualDub2 or AVSPMod. To get almost total control over the aspect of the subtitles, use ASS format instead of SRT.
    https://forum.videohelp.com/threads/394091-SRT-change-vertical-margin-but-keep-1-line-...cally-centered
    Quote Quote  
  9. Thank you guys for all your replies, I'm doing with this command finally, I have a list of mp4 and srt and run this on terminal, just need to had the same File Name for both files(mp4 and srt).

    for f in *.mp4; do ffmpeg -i $f -vf subtitles=""${f/.mp4}".srt":force_style=FontSize=24 -preset veryfast -crf 24 /hardcoded/$f ; mv $f ""${f/.mp4}".srt" /tmp/ ; done

    This works great for my needs, thanks again!!
    Quote Quote  



Similar Threads