To extract hdmv pgs subtitles from an mkv file and convert them to srt format using ffmpeg, follow these steps:
Install ffmpeg: If you don't have ffmpeg installed on your system, you can download it from the official website.
Locate the subtitle track: Use the following command to list all the subtitle tracks in your mkv file:
ffmpeg -i input.mkv
The output will show you all the subtitle tracks available in the file. Note down the number of the track you want to extract.
Extract the subtitle track: Use the following command to extract the subtitle track from the mkv file:
ffmpeg -i input.mkv -map 0:s:0 subs.sup
Replace "0:s:0" with the track number you want to extract. The output file is in hdmv pgs format with a .sup file extension.
Convert to srt format: Use the following command to convert the hdmv pgs file to srt format:
ffmpeg -i subs.sup subs.srt
This will create a new file named subs.srt in the same directory as the subs.sup file.
Remove the .sup file: You can now remove the .sup file using:
rm subs.sup
That's it! You have now extracted and converted hdmv pgs subtitles to srt format using ffmpeg.
Please start posting anonymously - your entry will be published after you log in or create a new account. This space is reserved only for answers. If you would like to engage in a discussion, please instead post a comment under the question or an answer that you would like to discuss
Asked: 2023-05-04 00:44:14 +0000
Seen: 14 times
Last updated: May 04 '23
What is the process for converting a complete directory using ffmpeg?
Command line option for ffmgeg creating an output MP4 with 720p and 60fps for Youtube?
How to save ffmpeg output to a file using redirection?
Is it possible for ffmpeg to display a progress bar?
ffmpeg: How can I get the bit rate of a MP3 File?
How can I extract a given range from a Video with ffmpeg?
How can FFmpeg open an RTSP stream with the same URL?
How to use ffmpeg to provide a video stream in Node?
What is the process for combining several mono files into a single multichannel file using FFmpeg?