lisamelton / video_transcoding

Tools to transcode, inspect and convert videos.
MIT License
2.39k stars 160 forks source link

UTF parsing of subtitle (SRT) files #192

Closed osuritz closed 6 years ago

osuritz commented 6 years ago

Here's the command line I used to encode a movie: transcode-video --mp4 --crop 0:0:52:52 --add-audio fra --audio-width other=double --add-srt Movie.eng.srt --add-srt Movie.fre.srt ~/Movies/Movie.mkv

However when watching the file in QuickTime (and MPlayer), the French subtitles (in particular the accents) are showing garbled characters. However, if I open the MP4 in Subler, remove the French subtitle track, then re-add it manually and save, then the subtitles are render properly in QuickTime and MPlayer.

There must be a way to detect UTF8 format from files and set whatever sort of flag needs to be set in the container? I'm happy to link to subtitle file if necessary.

lisamelton commented 6 years ago

@osuritz Sorry I took so long to respond. I was out walking the dog. :)

I think if you add --bind-srt-encoding utf8 after --add-srt Movie.fre.srt then it should recognize all the characters because the default encoding in HandBrakeCLI is latin1.

lisamelton commented 6 years ago

@osuritz Did my suggestion work for you?

osuritz commented 6 years ago

Yup that worked. Thanks! :)

On Sat, Feb 3, 2018 at 8:23 PM, Don Melton notifications@github.com wrote:

@osuritz https://github.com/osuritz Did my suggestion work for you?

— You are receiving this because you were mentioned. Reply to this email directly, view it on GitHub https://github.com/donmelton/video_transcoding/issues/192#issuecomment-362879833, or mute the thread https://github.com/notifications/unsubscribe-auth/AA4qSCgR3dLfhczgHYYSd6Q_k7bFPs28ks5tRTDKgaJpZM4R2EUP .

lisamelton commented 6 years ago

@osuritz No problem. I'm glad it worked. I'll close this then.