VideoHelp Forum
+ Reply to Thread
Results 1 to 9 of 9
Thread
  1. I did a small research but only found this:

    https://trac.ffmpeg.org/wiki/HowToBurnSubtitlesIntoVideo

    I tried with:

    Code:
    ffmpeg -i input.mp4 -vf "ass=sub.ass" -crf 20 output.mkv
    But that only burns the video into the file.


    Is there a way i can use ffmpeg to softsub a mp4 file, making the result a .mkv file with subtitles enabled by default, but that can be turned off?
    Quote Quote  
  2. "-scodec copy" to copy soft sub stream . You might have to specify the specific stream maps with -map for each input file
    Quote Quote  
  3. Originally Posted by poisondeathray View Post
    "-scodec copy" to copy soft sub stream . You might have to specify the specific stream maps with -map for each input file
    Specific stream maps? Not sure what you mean.

    I added -scodec copy but the result was still a video with burned subs.

    Code:
    ffmpeg -i input.mp4 -vf "ass=sub.ass" -scodec copy -crf 20 output.mkv
    Quote Quote  
  4. -vf means burn in - it's a video filter

    You would need to use -i sub.ass if you want to copy the stream .

    Stream map means you have to tell ffmpeg which streams to use. The syntax is file input number: stream number. It might be -map 0:0 for the video and -map 1:0 for the sub if you put the inputs in that order. You have to look at what ffmpeg says about the stream numbers because some videos have different stream maps (video might be 2nd stream , for example instead of the 1st). For example, if the mp4 already had subs, how would it know which sub to use? You tell it which specifically one by using -map. If you only have 1 video, 1 sub, then it should be smart enough that you don't have to use -map. And you haven't mentioned audio
    Last edited by poisondeathray; 27th Feb 2016 at 17:17.
    Quote Quote  
  5. Originally Posted by poisondeathray View Post
    -vf means burn in - it's a video filter

    You would need to use -i sub.ass if you want to copy the stream .

    Stream map means you have to tell ffmpeg which streams to use. The syntax is file input number: stream number. It might be -map 0:0 for the video and -map 1:0 for the sub if you put the inputs in that order. You have to look at what ffmpeg says about the stream numbers because some videos have different stream maps (video might be 2nd stream , for example instead of the 1st). For example, if the mp4 already had subs, how would it know which sub to use? You tell it which specifically one by using -map. If you only have 1 video, 1 sub, then it should be smart enough that you don't have to use -map. And you haven't mentioned audio
    I don't have multiple audio nor multiple subs.

    Like you said i have 1 video and 1 sub.

    Im still asked for streams.

    That and/or ask me to rewrite sub.ass and then give a stream error.

    The source is just a normal video file without any kind of subtitle or dual audio. Just video and audio.
    Quote Quote  
  6. Code:
    ffmpeg -i input.mp4 -i sub.ass -c:v libx264 -crf 20 -c:a copy -scodec copy output.mkv
    If you still can't get it working post the ffmpeg log or output / error message
    Quote Quote  
  7. And -crf 20 means you're re-encoding the video. I'm assuming that's what you want. If you didn't want to re-encode the video, just use -c:v copy . Or you can use mkvmerge

    Code:
    ffmpeg -i input.mp4 -i sub.ass -c:v copy -c:a copy -scodec copy output.mkv
    Quote Quote  
  8. The code you gave me the following message:



    But i think it worked, even if subs are not selected by default.

    I also tried mkmerge and worked too, but crashes MPC-HC when try to play the video, which may be unrelated to this sub issue because these mkv files crash mpc-hc for some reason.


    Thanks for the help.
    Last edited by Unknown01; 27th Feb 2016 at 18:25.
    Quote Quote  
  9. Originally Posted by Unknown01 View Post

    I also tried mkmerge and worked too, but crashes MPC-HC when try to play the video, which may be unrelated to this sub issue because these mkv files crash mpc-hc for some reason.
    Both mkvmerge and ffmpeg muxes crash MPCHC ?

    Maybe a buggy MPCHC version ? Try another version either newer, or older. Does it crash other players ? e.g. potplayer, vlc ?

    Does the original MP4 crash MPCHC ? What does mediainfo (view=>text) say about the original MP4 ?

    What happened when you re-encoded it with -crf 20 and libx264 ? or when you hardsubbed it earlier? Did it crash then ?
    Quote Quote  



Similar Threads

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