Ask Your Question
1

How can hdmv pgs subtitles be extracted from an mkv file and converted to srt format using ffmpeg?

asked 2023-05-04 00:44:14 +0000

bukephalos gravatar image

edit retag flag offensive close merge delete

1 Answer

Sort by ยป oldest newest most voted
0

answered 2023-05-04 01:07:01 +0000

plato gravatar image

To extract hdmv pgs subtitles from an mkv file and convert them to srt format using ffmpeg, follow these steps:

  1. Install ffmpeg: If you don't have ffmpeg installed on your system, you can download it from the official website.

  2. 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.

  3. 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.

  4. 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.

  5. 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.

edit flag offensive delete link more

Your Answer

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

Add Answer


Question Tools

Stats

Asked: 2023-05-04 00:44:14 +0000

Seen: 14 times

Last updated: May 04 '23