Convert subtitles from hdmv_pgs_subtitle to mov_text (MP4)

Questions involving a Windows version of FFmpeg.
Post Reply
rgr
Posts: 1
Joined: Mon Aug 14, 2017 8:19 am

Convert subtitles from hdmv_pgs_subtitle to mov_text (MP4)

Post by rgr »

Hello

Is there any way to convert subtitles from "hdmv_pgs_subtitle" to "mov_text" (needed in MP4).

I try:
ffmpeg.exe i "%%F" c copy -scodec mov_text "test.mp4"

but I get:
Error while opening encoder for output stream #0:2 - maybe incorrect parameters
such as bit_rate, rate, width or height



Stream properties:
Duration: 00:01:48.14, start: 4199.920000, bitrate: 12394 kb/s
Program 1
Stream #0:0[0x1011], 169, 1/90000: Video: h264 (High), 1 reference frame (HDMV / 0x564D4448), yuv420p(top first, left), 1920x1080 (1920x1088) [SAR 1:1 DAR 16:9], 0/1, 25 fps, 25 tbr, 90k tbn, 50 tbc
Stream #0:1[0x1100], 102, 1/90000: Audio: ac3 (AC-3 / 0x332D4341), 48000 Hz, stereo, fltp, 256 kb/s
Stream #0:2[0x1200], 35, 1/90000: Subtitle: hdmv_pgs_subtitle ([144][0][0][0] / 0x0090), 1920x1080

llogan
Posts: 332
Joined: Fri Mar 14, 2014 3:29 am

Re: Convert subtitles from hdmv_pgs_subtitle to mov_text (MP4)

Post by llogan »

I'm guessing hdmv_pgs_subtitle is image based. You'll need to perform OCR to convert it to text. FFmpeg has an ocr filter, but I know nothing of it and didn't look into what it does.

Reino
Posts: 94
Joined: Thu Aug 22, 2013 5:14 pm
Contact:

Re: Convert subtitles from hdmv_pgs_subtitle to mov_text (MP4)

Post by Reino »

I've managed to compile FFmpeg with Tesseract (the OCR-filter), but I have no idea how to use it. Querying Google didn't return anything useful either.

Post Reply