[FFmpeg-user] how to add a srt subtitle file into a mp4

zhangzh zhangzh at net-east.com
Mon Mar 5 08:23:30 CET 2012


hello 

I'm a new user of ffmpeg . I just want to add a srt subtitle file into a mp4 , but I failed .

So how to do it ?





D:\tv>ffmpeg -i hehe.mp4 -attach  hehe.srt -metadata:s:0 mimetype=application/x-truetype-font  -vcodec copy -acodec copy hehe2.mp4
ffmpeg version N-37208-g01fcbdf Copyright (c) 2000-2012 the FFmpeg developers
  built on Jan 27 2012 18:34:52 with gcc 4.6.2
  configuration: --enable-gpl --enable-version3 --disable-w32threads --enable-runtime-cpudetect --enable-avisynth --enable-bzlib --enable-frei0r --enable-libopencor
-libopencore-amrwb --enable-libfreetype --enable-libgsm --enable-libmp3lame --enable-libopenjpeg --enable-librtmp --enable-libschroedinger --enable-libspeex --enabl
able-libvo-aacenc --enable-libvo-amrwbenc --enable-libvorbis --enable-libvpx --enable-libx264 --enable-libxavs --enable-libxvid --enable-zlib
  libavutil      51. 34.101 / 51. 34.101
  libavcodec     53. 60.100 / 53. 60.100
  libavformat    53. 31.100 / 53. 31.100
  libavdevice    53.  4.100 / 53.  4.100
  libavfilter     2. 60.100 /  2. 60.100
  libswscale      2.  1.100 /  2.  1.100
  libswresample   0.  6.100 /  0.  6.100
  libpostproc    52.  0.100 / 52.  0.100
Input #0, mov,mp4,m4a,3gp,3g2,mj2, from 'hehe.mp4':
  Metadata:
    major_brand     : isom
    minor_version   : 512
    compatible_brands: isomiso2mp41
    creation_time   : 1970-01-01 00:00:00
    title           : 
    artist          : 
    encoder         : Lavf52.93.0
    copyright       : duricom
  Duration: 00:17:16.86, start: 0.000000, bitrate: 367 kb/s
    Stream #0:0(und): Video: mpeg4 (Simple Profile) (mp4v / 0x7634706D), yuv420p, 320x240 [SAR 1:1 DAR 4:3], 307 kb/s, 30 fps, 30 tbr, 30 tbn, 30 tbc
    Metadata:
      creation_time   : 1970-01-01 00:00:00
      handler_name    : VideoHandler
    Stream #0:1(und): Audio: aac (mp4a / 0x6134706D), 32000 Hz, stereo, s16, 56 kb/s
    Metadata:
      creation_time   : 1970-01-01 00:00:00
      handler_name    :
ret 0, stream_spec 0
[mp4 @ 022BB020] track 2: could not find tag, codec not currently supported in container
Output #0, mp4, to 'hehe2.mp4':
  Metadata:
    major_brand     : isom
    minor_version   : 512
    compatible_brands: isomiso2mp41
    creation_time   : 1970-01-01 00:00:00
    title           : 
    artist          : 
    copyright       : duricom
    encoder         : Lavf53.31.100
    Stream #0:0(und): Video: mpeg4 ( [0][0][0] / 0x0020), yuv420p, 320x240 [SAR 1:1 DAR 4:3], q=2-31, 307 kb/s, 30 fps, 30 tbn, 30 tbc
    Metadata:
      creation_time   : 1970-01-01 00:00:00
      handler_name    : VideoHandler
      mimetype        : application/x-truetype-font
    Stream #0:1(und): Audio: aac (@[0][0][0] / 0x0040), 32000 Hz, stereo, 56 kb/s
    Metadata:
      creation_time   : 1970-01-01 00:00:00
      handler_name    :
    Stream #0:2: Attachment: none
    Metadata:
      filename        : hehe.srt
Stream mapping:
  Stream #0:0 -> #0:0 (copy)
  Stream #0:1 -> #0:1 (copy)
  File hehe.srt -> Stream #0:2
Could not write header for output file #0 (incorrect codec parameters ?)




zhangzh


More information about the ffmpeg-user mailing list