How to hardcode subtitles into an AVI without loss of quality
Solution 1
No. The hardsubs modify the video content and so recompressing it is necessary.
Solution 2
I think as it is typically used, hard subtitles mean they are embedded into the image data, which by definition requires re-compression. Soft subtitles are added as separate files, e.g. .srt. However, there is a middle way in embedded subtitles. Embedded subtitles are added into the video container as a separate track, which means they will be included in the file but not require re-compression.
For Divx-format the best tool is Windows based application AVIAddXSubs. It can embed Idx/Sub/Srt subtitles.
For MP4 and some other alternatives, Handbrake can embed soft subtitles. Read more at their wiki
Solution 3
You can use mplayer to play the video with subtitles, and then output everything to a raw yuv file (-vo yuv4mpeg). If you play a movie, this outputted file will be really huge, hundreds of gigabytes, so make sure that it will not cause issues.
After the file has been outputted, it can be compressed by using ffmpeg and then H264 codec.
tony_sid
Born and raised in California. Computers are my main hobby.
Updated on September 17, 2022Comments
-
tony_sid almost 2 years
I am using a program to hardcode subs into an AVI file. The problem is that is recompresses the video using a codec. I don't see why this is necessary and causes a noticeable loss of quality. Is there a program that will put the subs in without having to recompress the video so that there is no loss in video quality?
-
tony_sid over 13 yearsWhat codec should be used to minimize loss of video quality?
-
Ignacio Vazquez-Abrams over 13 yearsThat is a question that entire doctorate theses have been written about.
-
Ignacio Vazquez-Abrams over 13 yearsBased on the asker's other questions, I'm fairly sure they already have a MKV with embedded softsubs.
-
RipperDoc over 13 yearsYes, you may be right but I was assuming the asker wanted an AVI file. AVI can include subs without recompression using AVIAddXSubs and a DivX/Xvid compatible player. If the MKV had a h264 video stream, the same could be accomplished with Handbrake and the MP4 container (example for iPad or Apple TV).
-
ttarchala almost 13 yearsSoft subtitles may be embedded in containers such as MKV, but not all devices may be able to play them (I'm thinking about you, Playstation 3!)
-
Gert van den Berg over 7 yearsThe recompression will cause loss of quality though...