News:

--

Main Menu

Problem with Subtitles

Started by johnr283, March 21, 2023, 04:58:49 PM

Previous topic - Next topic

johnr283

I have an mkv file with subtitles. I want save part of the file to mp4 and keep the subtitles. When I use the subtitle filter it wants me to open a file, which I don't have. Does this mean the subtitles hardcoded in to the original mkv? I'm able to turn them off while playing the file with MPC-HC. I thought that you couldn't turn off hard coded subtitles. I'm confused.

eumagga0x2a

Your source video uses soft subtitles (i.e. it includes a subtitle track), else you wouldn't be able to turn them off. Avidemux supports only video and audio tracks, no other types, so you will have to use a different application for the task.

The SSA/ASS/SRT video filter in Avidemux expects subtitles as a separate text file in Substation Alpha or in SubRip format (which will be internally converted to Substation Alpha format) for the sole purpose of hardcoding them into the video (which will be re-encoded) using the libass library.

johnr283

Quote from: eumagga0x2a on March 21, 2023, 07:45:18 PMYour source video uses soft subtitles (i.e. it includes a subtitle track), else you wouldn't be able to turn them off. Avidemux supports only video and audio tracks, no other types, so you will have to use a different application for the task.

The SSA/ASS/SRT video filter in Avidemux expects subtitles as a separate text file in Substation Alpha or in SubRip format (which will be internally converted to Substation Alpha format) for the sole purpose of hardcoding them into the video (which will be re-encoded) using the libass library.

So what program can I use to convert the subtitle track so I can then use it in Avidemux?

eumagga0x2a

Quote from: johnr283 on March 21, 2023, 08:36:26 PMSo what program can I use to convert the subtitle track so I can then use it in Avidemux?

Do you want to hardcode ("burn" into the picture) subtitles into video, which implies that the video has to be re-encoded, worsening the quality? Or do you want to get a video in a different container (MP4 instead of Matroska), keeping subtitles as a track, which allows to use copy mode for video and to disable subtitles during playback?

If it is the latter, you cannot use Avidemux for this task at all (use ffmpeg on the command line instead).

If it is the former, it depends on the type of subtitles in the subtitle track. For SSA tracks you could use e.g. if the subtitles are stored in MKV as track no. 5

mkvextract /Path/to/Source.mkv tracks 5:/OutputPath/to/mySubtitles.ssa
and subsequently use the SSA/ASS/SRT video filter in Avidemux to hardcode these subtitles into video.

If you have difficulties to use the command-line utility mkvextract directly, there is a GUI for that (gMKVExtractGUI, never tried that, you are on your own).

sark

MPC-HC includes Media Info. Should at least tell you what subtitles you have.

File/Properties Media Info tab.

Luonan

Hello,
I found that topic searching for a feature in Avidemux and I am searching for a way to disable the substitles in some case.
Quote from: eumagga0x2a on March 21, 2023, 09:41:43 PM
Quote from: johnr283 on March 21, 2023, 08:36:26 PMSo what program can I use to convert the subtitle track so I can then use it in Avidemux?

Do you want to hardcode ("burn" into the picture) subtitles into video, which implies that the video has to be re-encoded, worsening the quality? Or do you want to get a video in a different container (MP4 instead of Matroska), keeping subtitles as a track, which allows to use copy mode for video and to disable subtitles during playback?
I'm not a developer, so I'm asking naive questions. Wouldn't it be possible to link the display of the subtitle filter to certain conditions, such as the sound channel used? Is it possible to apply a filter (e.g. subtitles) at playback time and allow the user to automatically activate this filter by choosing the language (English subtitles when I choose the French channel, and no subtitles when I choose the English channel, for example)?
Thanks in advance

sark

Quote from: Luonan on August 05, 2023, 08:43:29 AMIs it possible to apply a filter (e.g. subtitles) at playback time and allow the user to automatically activate this filter by choosing the language (English subtitles when I choose the French channel, and no subtitles when I choose the English channel, for example)?

The short answer to your question is no, not in Avidemux.

If you read eumagga0x2a's first reply, you will see Avidemux only supports hard coded subtitles, and this is limited to importing external subtitle tracks. Only soft coded subtitles can be turned on, or off.

I have no idea if you can link tracks to audio channels, but you will need to use an alternative application, or scripting tool (like ffmpeg) to get anywhere close to achieving this.

As a side note: It would be useful if Avidemux could extract a subtitle track (for hard coding), as is currently possible with audio tracks.