Check out today’s Tech News headlines at extract the subtitle from any movie. Must be an.mp4 or.m4v file for this method to work. Step 2 Extract Subtitles from DVD It is high time to embed the subtitles by tapping the No subtitle function found beneath the Target menu. Here you can edit the Embed subtitle (s) and extract SRT subtitle format you want. To make the edit click the Export subtitle (s) label to extract the subtitles as per your requirement.
2021腾讯云限时秒杀,爆款1核2G云服务器298元/3年!(领取2860元代金券),
地址:https://cloud.tencent.com/act/cps/redirect?redirect=1062
2021阿里云最低价产品入口+领取代金券(老用户3折起),
入口地址:https://www.aliyun.com/minisite/goods
I have checked the FFMpeg documentation and many forums and figured out the correct command-line to extract subtitles from an .MP4 video should look like so:
Extract Dvd Subtitles From Ffmpeg
However, I get the following error, which lends me to question whether this is feasible at all:
Error while opening encoder for output stream #0:0 - maybe incorrect parameters such as bit_rate, rate, width or height
Using ffmpeg -codecs
, I can confirm that ffmpeg should be able to encode subrip subtitles.
Using ffmpeg -i video.mp4
, I can see that there is two subtitle tracks embedded in the video :
EDIT
I have tested with the simplified command-line shown in the comments but I still get the same error. Here is a link to the detailed verbose output from running the command. I have also tried to completely disable metadata and chapters in the resulting output but that still produces the same error.
ffmpegextractsubtitlesrt|
this questionedited Dec 19 '13 at 13:43 asked Dec 19 '13 at 8:41 Maxime Labelle 2,286 1 14 39 3 Simple
ffmpeg -i in.mp4 out.srt
works for me correctly. (ffmpeg 2.0.1) – pogorskiy Dec 19 '13 at 9:17 Try ffmpeg ... -loglevel debug ...
to get more info about error – pogorskiy Dec 19 '13 at 9:20 I have tries both suggestions, but I cannot identify an obvious mistake. Perhaps this is caused by ffmpeg trying to output chapter markers in the resulting srt file? I have including the detailed debug output. – Maxime Labelle Dec 19 '13 at 13:35 1 Can't see anything obvious either, but maybe try a more recent version from ffmpeg.org/download.html and use ffmpeg -i video.mp4 -map 0:s:0 output.srt
to only use the first subtitle stream for your output. (By the way, ffmpeg CLI questions are off topic for SO, so I've voted to move it to Super User.) – slhck Dec 19 '13 at 13:50 Sorry about the off-topic nature of my post. I'll make sure to ask those kinds of questions in SU. I'll try a more recent build of ffmpeg. Cheers. – Maxime Labelle Dec 19 '13 at 13:55 | show more comment 3 Answers
3
I enventually figured out why I did not succeed:
The specified command-line would have been perfectly fine if the subtitles from the source video were encoded in a text-based representation. However, as can be seen in the output to the ffmpeg -i
command-line, the subtitles are encoded in the 'dvd_subtitle' format.
The dvd_subtitle format stores bitmaps for each subtitle in the video. Therefore, there is no way ffmpeg would be able to translate the bitmaps into text.
For this task, one has to resort to an OCR-based software which assists a user with the task of identifying each subtitle as text from its bitmap représentation.
Recommend:c++ - How to extract elementary video from mp4 using ffmpeg programmatically
deo to mp4 using h264/AVC codec. The main scheme is something like that: -open input -demux -decode -encode -mux The actual code is below: #include <iostream>#include <math.h>extern 'C' {#ifndef __STDC_CONSTANT_MACROS#undef main /* Pr
(There is a secondary text-based subtitle in the source video, but I don't know where it came from and is not seen by most popular players. For all intents and purposes, this 'mov_text' subtitle seems to be a stub placeholder, probably an artifact of the conversion from the original DVD)
|
this answer answered Jan 2 '14 at 16:52 Maxime Labelle 2,286 1 14 39 I think that text track is the chapter markers, not sure though. – mcdado Jul 8 '14 at 10:04 |
Just FYI, (Can't comment due to rep yet), but extracting SRT from an MP4 will result in a file formatted as MOV_Text not the regular SRT. It will still get added and work but its like changing mp4 to m4v. While it usually works, things don't work the same in the code. Mov_text is horrible for manually adjusting font/size etc etc. Best bet is to download and test an SRT from the web!
This will work, but will result in mov_text coded srt file:
|
this answer answered Oct 15 '15 at 5:59 FreeSoftwareServers 330 2 11 |
Try using map option... if there are too many streams in input files....
Syntax would be:
ffmpeg -i video.mp4 -map 0:4 out.srt
Since there are two subtitle streams in your video, first on 0:3 which is dvdsubtitle so cannot be converted to srt so we will convert second subtitle on 0:4 stream which is mov_text and is soft copy of subtitle so can be easily converted....
|
this answer answered Feb 4 at 7:35 Manthaar Janyaro 1 |
Recommend:extract - Error while extracting subtitle from mkv or m2ts to srt with FFmpeg
ideo). I tried a lot of variant i found with google. But every time i get this error: Error while opening encoder for output stream #0:0 - maybe incorrect parameters such as bit_rate, rate, width or height I think, this error means that ffm
Recommend:extract - Error while extracting subtitle from mkv or m2ts to srt with FFmpeg
ideo). I tried a lot of variant i found with google. But every time i get this error: Error while opening encoder for output stream #0:0 - maybe incorrect parameters such as bit_rate, rate, width or height I think, this error means that ffm
#2208closedenhancement (fixed)
Reported by: | Owned by: | ||
---|---|---|---|
Priority: | wish | Component: | avformat |
Version: | git-master | Keywords: | |
Cc: | Blocked By: | ||
Blocking: | Reproduced by developer: | yes | |
Analyzed by developer: | no |
Description
Remove Subtitles From Mkv Ffmpeg
Attachments (4)
- track_05 - Subtitle.sup (140 bytes) - added by moropus8 years ago.
- track_06 - Subtitle.sup (379.3 KB) - added by moropus8 years ago.
- track_07 - Subtitle.sup (400.1 KB) - added by moropus8 years ago.
- track_08 - Subtitle.sup (326.3 KB) - added by moropus8 years ago.
Download all attachments as: .zip
Change History (11)
comment:1 Changed 8 years ago by cehoyos
- Component changed from FFmpeg to avformat
- Keywordspgssub added
- Priority changed from normal to wish
- Type changed from defect to enhancement
- Version changed from unspecified to git-master
comment:2 Changed 8 years ago by moropus
Changed 8 years ago by moropus
- Attachmenttrack_05 - Subtitle.sup added
Changed 8 years ago by moropus
- Attachmenttrack_06 - Subtitle.sup added
Changed 8 years ago by moropus
- Attachmenttrack_07 - Subtitle.sup added
Changed 8 years ago by moropus
- Attachmenttrack_08 - Subtitle.sup added
comment:4 Changed 8 years ago by cehoyos
- Reproduced by developer set
- Status changed from new to open
comment:6 Changed 8 years ago by cehoyos
Ffmpeg Extract Srt
- Keywordssup added
comment:7 Changed 3 years ago by richardpl
- Resolution set to fixed
- Status changed from open to closed