FFMPEG .mov到.mp4转换失败

时间:2016-05-24 14:15:29

标签: android ios video ffmpeg

我正在使用FFMPEG将.mov和.mp4转换为.mp4,以便在iOS和Android设备上播放它们。来自Android的Mp4正在正常转换并在iPhone和Android设备上播放。但iPhone的.mov结果很奇怪。它正在iPhone和Android 4上播放。但是当我尝试使用Photo app(Android 5,6)打开此视频时,它会输出不受支持的视频消息。

FFMPEG命令:

ffmpeg -i app/data/storage/68/fa/39/68fa392b-df25-4622-93ab-cf9bf1253f63 \
       -y -b:a 128k -ac 2 -acodec libfdk_aac -b:v 300k -vcodec libx264 \
       -filter:v scale=w=320:h=trunc(ow/a/2)*2 -vprofile baseline \
       -movflags faststart -f mp4 \
       app/data/storage/68/fa/39/68fa392b-df25-4622-93ab-cf9bf1253f63.mp4

带输出文件的ffprobe:

ffprobe version N-80026-g936751b Copyright (c) 2007-2016 the FFmpeg developers
  built with gcc 4.8 (Ubuntu 4.8.4-2ubuntu1~14.04.3)
  configuration: --extra-libs=-ldl --prefix=/opt/ffmpeg --mandir=/usr/share/man --enable-avresample --disable-debug --enable-nonfree --enable-gpl --enable-version3 --enable-libopencore-amrnb --enable-libopencore-amrwb --disable-decoder=amrnb --disable-decoder=amrwb --enable-libpulse --enable-libfreetype --enable-gnutls --enable-libx264 --enable-libx265 --enable-libfdk-aac --enable-libvorbis --enable-libmp3lame --enable-libopus --enable-libvpx --enable-libspeex --enable-libass --enable-avisynth --enable-libsoxr --enable-libxvid --enable-libvidstab
  libavutil      55. 24.100 / 55. 24.100
  libavcodec     57. 42.100 / 57. 42.100
  libavformat    57. 36.100 / 57. 36.100
  libavdevice    57.  0.101 / 57.  0.101
  libavfilter     6. 45.100 /  6. 45.100
  libavresample   3.  0.  0 /  3.  0.  0
  libswscale      4.  1.100 /  4.  1.100
  libswresample   2.  0.101 /  2.  0.101
  libpostproc    54.  0.100 / 54.  0.100
Input #0, mov,mp4,m4a,3gp,3g2,mj2, from '68fa392b-df25-4622-93ab-cf9bf1253f63.mp4':
  Metadata:
    major_brand     : isom
    minor_version   : 512
    compatible_brands: isomiso2avc1mp41
    encoder         : Lavf57.36.100
  Duration: 00:00:00.65, start: 0.000000, bitrate: 297 kb/s
    Stream #0:0(und): Video: h264 (Constrained Baseline) (avc1 / 0x31637661), yuv420p, 320x568, 178 kb/s, 30 fps, 30 tbr, 15360 tbn (default)
    Metadata:
      handler_name    : VideoHandler
    Stream #0:1(und): Audio: aac (LC) (mp4a / 0x6134706D), 44100 Hz, stereo, fltp, 129 kb/s (default)
    Metadata:
      handler_name    : SoundHandler

1 个答案:

答案 0 :(得分:0)

问题解决了,它是用冒号的文件名。