[FFmpeg-user] subtitle for mp4

Henk D. Schoneveld belcampo at zonnet.nl
Mon Apr 20 20:35:48 CEST 2015


On 20 Apr 2015, at 19:09, James Lee <jameslee303 at gmail.com> wrote:

> Hi,
> 
> Does ffmpeg can only embed mov_text subtitle format for mp4?
> Srt or ass doesn't work.
> ffmpeg -i vid.mp4 -f ass -i vid.ass -c:v copy -c:a copy -c:s ass subtitle.mp4
> ffmpeg -i vid.mp4 -f srt -i vid.srt -c:v copy -c:a copy -c:s srt subtitle.mp4
> Both commands throw an error:
> Could not write header for output file #0 (incorrect codec parameters ?): Invalid argument
> 
> However, this work.
> ffmpeg -i vid.mp4 -f ass -i vid.ass -c:v copy -c:a copy -c:s mov_text subtitle.mp4
If your source is an .srt file -c:s mov_text will automatic convert it for you.
Stream mapping:
  Stream #0:0 -> #0:0 (copy)
  Stream #0:1 -> #0:1 (copy)
  Stream #1:0 -> #0:2 (subrip (srt) -> mov_text (native))
ffmpeg -i vid.mp4 -i vid.srt -c:v copy -c:a copy -c:s mov_text compatible.mp4
> 
> I use ffmpeg version N-71455-gfbdaebb.
> Thanks,
> 
> JL
> _______________________________________________
> ffmpeg-user mailing list
> ffmpeg-user at ffmpeg.org
> http://ffmpeg.org/mailman/listinfo/ffmpeg-user



More information about the ffmpeg-user mailing list