I have been trying to hardsub a video via cmd for a long time now. Still i could not find a proper way of doing it. I tried HandbrakeCLI, ffmpeg and mencoder but still could not find a way to do it. I got so closer to hardsubbing with HandbrakeCLI but there were some codeset problems and it wasn't really a hardsub at the end. I really need to find a way to hardsub .avi/.mp4 files via CMD. If you know any ways to do it please help me out! Thanks.
Try this:
mencoder -sub sub.srt -utf8 -font 'Arial Unicode MS' in.mp4 -o out.mp4 -of lavf -oac copy -fafmttag 0x706D -ovc x264 -x264encopts profile=baseline:bitrate=300k
After this I have to pass it through ffmpeg:
ffmpeg -i out.mp4 -acodec copy -vcodec copy final.mp4
as there is some issue with mp4 generated by mencoder, it does not play on some android phones.