在ffmpeg android中打开编码器流时出错

时间:2018-10-08 17:07:02

标签: android ffmpeg

我正在尝试使用以下命令将视频覆盖在图像上。

String[]sepCmd=new String[]{"-loop","1","-i",uri,"-i",overlayUri,"-filter_complex","[1:v]colorkey=0x000000:0.5:0.5[ckout];[0:v][ckout]overlay[out]","-map","[out]","-acodec","libfaac","-c:a", "copy",outputPath};

运行上面的命令时,出现如下所示的错误

 Input #0, png_pipe, from '/storage/emulated/0/snowflake.png':
  Duration: N/A, bitrate: N/A
    Stream #0:0: Video: png, gray(pc), 304x345 [SAR 11811:11811 DAR 304:345], 25 fps, 25 tbr, 25 tbn, 25 tbc
Input #1, mov,mp4,m4a,3gp,3g2,mj2, from '/storage/emulated/0/FilterVideos/vintage1.mp4':
  Metadata:
    major_brand     : isom
    minor_version   : 512
    compatible_brands: isomiso2avc1mp41
    encoder         : Lavf58.12.100
  Duration: 00:00:05.08, start: 0.000000, bitrate: 447 kb/s
    Stream #1:0(und): Video: h264 (avc1 / 0x31637661), yuv420p, 640x360 [SAR 1:1 DAR 16:9], 306 kb/s, 25 fps, 25 tbr, 12800 tbn, 50 tbc (default)
    Metadata:
      handler_name    : VideoHandler
    Stream #1:1(und): Audio: aac (mp4a / 0x6134706D), 44100 Hz, stereo, fltp, 129 kb/s (default)
    Metadata:
      handler_name    : SoundHandler
Stream mapping:
  Stream #0:0 (png) -> overlay:main
  Stream #1:0 (h264) -> colorkey
  overlay -> Stream #0:0 (libx264)
Press [q] to stop, [?] for help
[swscaler @ 0xee29d000] deprecated pixel format used, make sure you did set range correctly
[swscaler @ 0xee2a8000] No accelerated colorspace conversion found from yuv420p to argb.
[libx264 @ 0xf125ba00] height not divisible by 2 (304x345)
Error initializing output stream 0:0 -- Error while opening encoder for output stream #0:0 - maybe incorrect parameters such as bit_rate, rate, width or height
Conversion failed!

0 个答案:

没有答案