Take the 2-minute tour ×
Super User is a question and answer site for computer enthusiasts and power users. It's 100% free, no registration required.

i'm trying to run the following line on FFmpeg that will basically "re-format" an MKV file to MP4 without doing any re-encoding and also embed SRT subtitles onto the MP4 output:

ffmpeg -i test.mkv -i test.srt -newsubtitle -acodec copy -vcodec copy test.mp4

Without the "-i test.srt -nwesubtitle" bit, it seems to work just fine; however, with it I get the following output:

Seems stream 0 codec frame rate differs from container frame rate: 47.95 (5000000/104271) -> 23.98 (24000/1001)

Stream #0.0(eng): Video: h264, yuv420p, 1280x720 [PAR 1:1 DAR 16:9], 23.98 fps, 23.98 tbr, 1k tbn, 47.95 tbc
Stream #0.1(eng): Subtitle: 0x0000
Metadata:
  title           : English
Stream #0.2(jpn): Audio: aac, 48000 Hz, stereo, s16
Metadata:
  title           : Japanese 2.0
Stream #0.3(eng): Audio: aac, 48000 Hz, stereo, s16
Metadata:
  title           : English 2.0
Stream #0.4(eng): Subtitle: 0x0000
Metadata:
  title           : English Songs & Signs
Stream #0.5: Attachment: 0x0000
Metadata:
  filename        : MyriadPro-Bold.ttf
Stream #0.6: Attachment: 0x0000
Metadata:
  filename        : MyriadPro-RegularHaruhi.ttf
Stream #0.7: Attachment: 0x0000
Metadata:
  filename        : ChaparralPro-BoldIt.ttf
Stream #0.8: Attachment: 0x0000
Metadata:
  filename        : ChaparralPro-SemiboldIt.ttf
Stream #0.9: Attachment: 0x0000
Metadata:
  filename        : epmgobld_ending.ttf
Stream #0.10: Attachment: 0x0000
Metadata:
  filename        : epminbld_opening.ttf
Stream #0.11: Attachment: 0x0000
Metadata:
  filename        : Folks-Bold.ttf
Stream #0.12: Attachment: 0x0000
Metadata:
  filename        : GosmickSansBold.ttf
Stream #0.13: Attachment: 0x0000
Metadata:
  filename        : WarnockPro-LightDisp.ttf
Stream #0.14: Attachment: 0x0000
Metadata:
  filename        : epmgobld_ending.ttf
Stream #0.15: Attachment: 0x0000
Metadata:
  filename        : GosmickSansBold.ttf
Stream #0.16: Attachment: 0x0000
Metadata:
  filename        : Marker SD 1.2.ttf
Stream #0.17: Attachment: 0x0000
Metadata:
  filename        : MyriadPro-Bold.ttf
Stream #0.18: Attachment: 0x0000
Metadata:
  filename        : MyriadPro-RegularHaruhi.ttf
Stream #0.19: Attachment: 0x0000
Metadata:
  filename        : MyriadPro-SemiCn.ttf
test.srt: Invalid data found when processing input

I tried adding "-r pal", "-r ntsc" or "-r 23.98" thinking it was framerate issue with no change.

share|improve this question
add comment

migrated from stackoverflow.com Jul 3 '11 at 19:57

This question came from our site for professional and enthusiast programmers.

2 Answers

FFmpeg was calling "test.srt: Invalid data found when processing input" because it simply could not handle the SRT file. I ran the -codecs options and sure enough the "srt" codec was not listed.

To fix this I complied ffmpeg from source, using the configure options to enable subtitles.

Apparently the FFmpeg that can be found on the Ubuntu repositories is complied with subtitles turned off.

share|improve this answer
    
Good stuff, thanks for posting your solution here. :) –  Ruairi Fullam Jul 3 '11 at 21:28
add comment

SRT subtitles aren't officially supported in MP4, and many of the devices that play MP4 won't be able to play the SRT subtitles contained within them. Wide compatibility is the main reason to use MP4 over MKV, so you might as well stick with Matroska.

To combine multiple files into a single MKV, use mkvmerge from mkvtoolsnix:

mkvmerge -o output.mkv input.mkv input2.srt

If you insist on using MP4, MP4Box is the equivalent tool (from gpac):

MP4Box -out output.mp4 -add input.mkv -add input2.srt
share|improve this answer
add comment

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.