Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Use FFmpeg to join MP4 files while preserving subtitles stream [closed]

I tried:

ffmpeg -f concat -i files.lst -c copy output.mp4

But the output file doesn't have the subtitles stream. How do I fix this?

Log:

ffmpeg version 2.3.4 Copyright (c) 2000-2014 the FFmpeg developers
  built on Dec  4 2014 09:23:21 with gcc 4.8.2 (GCC) 20140120 (Red Hat 4.8.2-16)
  configuration: --prefix=/usr --bindir=/usr/bin --datadir=/usr/share/ffmpeg --incdir=/usr/include/ffmpeg --libdir=/usr/lib64 --mandir=/usr/share/man --arch=x86_64 --optflags='-O2 -g -pipe -Wall -Wp,-D_FORTIFY_SOURCE=2 -fexceptions -fstack-protector-strong --param=ssp-buffer-size=4 -grecord-gcc-switches -m64 -mtune=generic' --enable-bzlib --disable-crystalhd --enable-gnutls --enable-libass --enable-libcdio --enable-libdc1394 --disable-indev=jack --enable-libfreetype --enable-libgsm --enable-libmp3lame --enable-openal --enable-libopenjpeg --enable-libopus --enable-libpulse --enable-libschroedinger --enable-libsoxr --enable-libspeex --enable-libtheora --enable-libvorbis --enable-libv4l2 --enable-libx264 --enable-libxvid --enable-x11grab --enable-avfilter --enable-avresample --enable-postproc --enable-pthreads --disable-static --enable-shared --enable-gpl --disable-debug --disable-stripping --shlibdir=/usr/lib64 --enable-runtime-cpudetect
  libavutil      52. 92.100 / 52. 92.100
  libavcodec     55. 69.100 / 55. 69.100
  libavformat    55. 48.100 / 55. 48.100
  libavdevice    55. 13.102 / 55. 13.102
  libavfilter     4. 11.100 /  4. 11.100
  libavresample   1.  3.  0 /  1.  3.  0
  libswscale      2.  6.100 /  2.  6.100
  libswresample   0. 19.100 /  0. 19.100
  libpostproc    52.  3.100 / 52.  3.100
[mov,mp4,m4a,3gp,3g2,mj2 @ 0x121e7e0] Invalid SampleDelta -1136 in STTS, at 252 st:1
[concat @ 0x121d8e0] Estimating duration from bitrate, this may be inaccurate
Input #0, concat, from 'files.lst':
  Duration: 00:00:00.02, start: 0.000000, bitrate: 144 kb/s
    Stream #0:0: Video: h264 (Main) (avc1 / 0x31637661), yuv420p(tv, smpte170m), 720x480 [SAR 8:9 DAR 4:3], 2528 kb/s, 29.97 fps, 29.97 tbr, 90k tbn, 180k tbc
    Stream #0:1: Audio: aac (mp4a / 0x6134706D), 48000 Hz, stereo, fltp, 160 kb/s
    Stream #0:2: Subtitle: mov_text (tx3g / 0x67337874), 0 kb/s
Output #0, mp4, to 'output.mp4':
  Metadata:
    encoder         : Lavf55.48.100
    Stream #0:0: Video: h264 ([33][0][0][0] / 0x0021), yuv420p, 720x480 [SAR 8:9 DAR 4:3], q=2-31, 2528 kb/s, 29.97 fps, 90k tbn, 90k tbc
    Stream #0:1: Audio: aac ([64][0][0][0] / 0x0040), 48000 Hz, stereo, 160 kb/s
Stream mapping:
  Stream #0:0 -> #0:0 (copy)
  Stream #0:1 -> #0:1 (copy)
Press [q] to stop, [?] for help
[mov,mp4,m4a,3gp,3g2,mj2 @ 0x1205da0] Invalid SampleDelta -1136 in STTS, at 164 st:1
[mov,mp4,m4a,3gp,3g2,mj2 @ 0x1227f80] Invalid SampleDelta -1136 in STTS, at 47 st:1
[mov,mp4,m4a,3gp,3g2,mj2 @ 0x130d5e0] Invalid SampleDelta -1136 in STTS, at 715 st:1
[mov,mp4,m4a,3gp,3g2,mj2 @ 0x1202b80] Invalid SampleDelta -1136 in STTS, at 121 st:1
[mov,mp4,m4a,3gp,3g2,mj2 @ 0x1202b80] Invalid SampleDelta -1136 in STTS, at 67 st:1
[mov,mp4,m4a,3gp,3g2,mj2 @ 0x121e7e0] Invalid SampleDelta -1136 in STTS, at 586 st:1
[mov,mp4,m4a,3gp,3g2,mj2 @ 0x121e7e0] Invalid SampleDelta -1136 in STTS, at 697 st:1
[mov,mp4,m4a,3gp,3g2,mj2 @ 0x1205da0] Invalid SampleDelta -1136 in STTS, at 327 st:1
[mov,mp4,m4a,3gp,3g2,mj2 @ 0x1202ba0] Invalid SampleDelta -1136 in STTS, at 559 st:1
frame= 7713 fps=0.0 q=-1.0 Lsize=   83874kB time=00:04:17.62 bitrate=2667.0kbits/s
video:78535kB audio:5036kB subtitle:0kB other streams:0kB global headers:0kB muxing overhead: 0.362465%
like image 805
user1985553 Avatar asked Dec 27 '14 21:12

user1985553


1 Answers

You also have to use -scodec copy, because -c does NOT include subtitles:

ffmpeg -f concat -i files.lst -c copy -scodec copy output.mp4
like image 58
kiwixz Avatar answered Sep 28 '22 01:09

kiwixz