0

First of all: I'm new to this site and not that much experienced with FFmpeg, so I'm using the iFFmpeg GUI for Mac OS X. Also, my native language is not English.

So here's my problem: I got an MKV input file with several audio and subtitle streams and I want to compress it into a M4V-Container with two audio-streams and one subtitle-stream. Encoding of the video-stream and the two audio-streams is just working fine, but when I try to add a subtitle-stream it sends me an error message: “failed opening encoder stream”.

My guess is that iFFmpeg is doing something wrong with the subtitle parameters. I tried to correct it, but I couldn't figure it out yet.

That's my input file:

Stream #0:0(eng): Video: h264 (High), yuv420p, 1920x1080 [SAR 1:1 DAR 16:9], 24 fps, 24 tbr, 1k tbn, 48 tbc

Stream #0:1(deu): Audio: dts (DTS-HD MA), 48000 Hz, 5.1(side), fltp, 1536 kb/s (default)

Stream #0:2(deu): Audio: dts (DTS), 48000 Hz, 5.1(side), fltp, 1536 kb/s

Stream #0:3(eng): Audio: dts (DTS-HD MA), 48000 Hz, 5.1(side), fltp, 1536 kb/s

Stream #0:4(eng): Audio: dts (DTS), 48000 Hz, 5.1(side), fltp, 1536 kb/s

Stream #0:5(deu): Subtitle: hdmv_pgs_subtitle

Stream #0:6(deu): Subtitle: hdmv_pgs_subtitle

Stream #0:7(deu): Subtitle: hdmv_pgs_subtitle

Stream #0:8(eng): Subtitle: hdmv_pgs_subtitle

Stream #0:9(eng): Subtitle: hdmv_pgs_subtitle

Stream #0:10: Attachment: mjpeg

And that's what iFFmpeg generates me as a command (I know, quite long):

ffmpeg -i Olympus\ Has\ Fallen.mkv -map 0:0 -map 0:1 -map 0:3 -map 0:6 -c:a aac -cutoff 15000 -b:a 512k -ar 48000 -c:a:1 aac -ab:2 512k -ar:2 48000 -strict experimental -async 1 -c:v libx264 -b:v 7741k -bt 655k -bufsize 3096.4k -r 24 -s 1280x720 -aspect 16:9 -trellis 1 -coder ac -subq 7 -me_range 16 -i_qfactor 0.71 -bf 3 -b_strategy 1 -refs 3 -partitions partb8x8+partp4x4+partp8x8+parti8x8 -flags +loop -me_method hex -direct-pred 1 -rc_lookahead 40 -keyint_min 23 -g 240 -rc_eq 'blurcplx^(1-qcomp)' -qmin 3 -qmax 51 -qdiff 4 -crf 20 -level 31 -weightb 1 -8x8dct 1 -fast-pskip 1 -mixed-refs 1 -b-pyramid 1 -sc_threshold 40 -map_metadata 0 -c:s mov_text -threads 8 -y "Olympus Has Fallen.m4v"

I would be very pleased if anyone could help me 'cause I tried for so long and it's just frustrating that it isn't working.

  • m4v or mp4 will not support subtitle as stream when you use ffmpeg. The only way to do that with an mp4 container in ffmpeg would be to "burn" it. – Rajib Mar 16 '14 at 13:23
  • Are you sure? Cause Apple is also using M4V-Containers for iTunes downloads and I think some movies on iTunes got subtitles... – M.J.K Mar 16 '14 at 14:37
  • Well Wikipedia says, MP4-Container can hold "MPEG-4 Timed Text" subtitles – M.J.K Mar 16 '14 at 15:24
  • @Rajib I believe MP4 can use what ffmpeg calls mov_text for softsubs, but I've never tried it. – llogan Mar 16 '14 at 21:56
  • I was successful with Handbrake not with ffmpeg to put subtitles in mp4, but I admit it was a while back- have not tried with the newest ffmeg. – Rajib Mar 17 '14 at 2:27

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Browse other questions tagged or ask your own question.