Hard-subbing without vlc player (ffmpeg)

preview_player
Показать описание
1:02 Quickstart
Considerations:
-those extra streams, information files (c:t) are actually just font files in this case. if you have those fonts installed on your computer already, they are not needed in any capacity. SO you could extract and install them 1 by 1 if you so choose.
-ffmpeg includes the highest quality audio and video stream by default, and discards the others unless we specify to include them via the general -map 0 or by specifying each via -map 0:0 (where the second 0 corresponds to whatever stream it actually is, so -map 0:2 or whatever). So if you were doing a hardsub, but wanted to keep the the multiple audio dubs for example you should take note.
This can get fairly dicey as we can specify operations per stream such as: Say I have 2 audio streams in channel 0:3 and 0:4 and I want to include them:

-c:s:0 copy means copy the first audio stream (cause of the 0), corresponding to the first audio map specified, which is 0:3. Then -c:s:1, just means the second audio map specified which is 0:4 will be copied. 0 means 1 in many cases, just keep that in mind. And just to re-iterate the above: the order you listed the -map streams is the order they are mapped in.

btw its control+c to stop a command prompt command.
@5:30, I neglected to mention that usually output containers apply certain presets on our codecs if we don't otherwise specify copy or a specific setting. So if we didn't specify -c:a copy or that we want it as .flac, it would actually apply a preset and re-encode the flac as a lossey audio codec probably vorbis given I chose the .mkv as my output container. Something to be aware of.
Oh and Toss
-preset veryfast
or
-preset slow

So you might be saying: well I have all my sub streams outside of my video what do I do?

Alternatively you can try -filter_complex
But I haven't tried that yet and am doing my own guessing, so no promises if it works.

You might be saying: nothings working! Well make sure there are no spaces in your filenames and if there are, put them in " ". i.e: "I named my file with spaces harhar".mkv
Make sure your syntax is right, check what the error message says and try to read/follow it, use a simplified command with simplified filenames to debug, try it on different input videos incase the metadata of ur movie is corrupted, update to the newest ffmpeg version if its saying you don't have the necessary library.
You might be saying: this is too hard! Well then go forth my friend, into the loving embrace of vlc player tutorial videos. dot dot dot. dot. Anyways this is enough for the purpose of the video (hardsubbing a video), but there are other things you will want to know when it comes to modifying streams. I'll cover those in the full ffmpeg tutorial I'm working on.
Рекомендации по теме
Комментарии
Автор

Error while processing the decoded data for stream #0:0

Getting this error

rahulm
Автор

Hello! Tranks for your video.

I try the line:

ffmpeg -i "input.mp4" -c:a copy -c:s copy -vf subtitles="sub.ssa" "output.mp4"

but not works. ffmpeg answers:

Unable to parse option value "sub.ssa" as image size
Error reinitializing filters!
Error while processing the decoded data for stream #0:0

fabianagomes
Автор

Hello what is the code then if you just want the hardcode sub without the softcode sub.

anthraxbeethrax
Автор

I wish more ffmpeg tutorials came out like this. ffmpeg is a pretty powerful software suite that usually overwhelms a lot of new users due to commands and syntaxes, but once you learn them, your life becomes easy.

ichiroutakashima
Автор

Have you ever experienced hardsub that was not accurate with this method?
vlc always has timing errors...

Memati