如何使用Ffmpeg命令在视频中添加字幕

时间:2014-05-07 09:00:25

标签: android ffmpeg

我执行下面的命令并获得 Stream#0:0:Subtitle:unknown_codec  (codec unknown_codec)未找到输出流#0:0 FFmpeg命令:

final String demoVideoPath =   "/sdcard/b.mp4";
final String subTitlePath="/sdcard/srtf.srt";
String ffmpegCommand[] = { "ffmpeg", "-i", demoVideoPath, "-i", subTitlePath,
                        "-map","1", "-c", "copy","-strict", "experimental","-c:v","mpeg","-crf","23","-preset","veryfast",
                          "/sdcard/output.avi" };

logcat的

 Shellout[srt @ 0xc03930] Estimating duration from bitrate, this may be inaccurate
 ShelloutInput #1, srt, from '/sdcard/srtf.srt':
Shellout  Duration: N/A, bitrate: N/A
 Shellout    Stream #1:0: Subtitle: srt
 ShelloutPlease use -b:a or -b:v, -b is ambiguous
 ShelloutOutput #0, avi, to '/sdcard/output.avi':
Shellout  Metadata:
 Shellout    major_brand     : isom
Shellout    minor_version   : 512
 Shellout    compatible_brands: isomiso2mp41

Shellout    creation_time   : 2013-12-20 11:33:07
Shellout    encoder         : Lavf51.12.1
 Shellout    Stream #0:0: Subtitle: unknown_codec
 ShelloutStream mapping:
Shellout  Stream #1:0 -> #0:0 (srt -> ?)
ShelloutEncoder (codec unknown_codec) not found for output stream #0:0

如何处理unknown_codec错误。

0 个答案:

没有答案