使用android

时间:2016-05-06 08:12:59

标签: android video ffmpeg concatenation mp4

我想用FFmpeg连接MP4视频,问题是当我想合并用Iphone和Android拍摄的视频时会引发问题:

  

输出流0:1中的非单调DTS;上一篇:150528,当前:139268;更改为150529.这可能会导致输出文件中的时间戳不正确。

这是我的代码

merge.txt

file 'iphone.mp4'
file 'android.mp4'

FFmpeg命令

ffmpeg -f concat -i marge.txt -c copy -y merge.mp4

如果我无法合并此视频,我怎样才能使用相同的参数(帧速率,比特率......)制作它们并将它们合并?

我使用FFmpeg版本2.4.2,因为我找不到比FF.2更高的android FFmpeg库。

这是完整的控制台输出:ffmpeg -i android.mp4 -i iphone.mp4

ffmpeg version n2.4.2 Copyright (c) 2000-2014 the FFmpeg developers
       built on Oct  7 2014 15:08:46 with gcc 4.8 (GCC)
               configuration: --target-os=linux --cross-prefix=/home/sb/Source-Code/ffmpeg-android/toolchain-android/bin/arm-linux-androideabi- --arch=arm --cpu=cortex-a8 --enable-runtime-cpudetect --sysroot=/home/sb/Source-Code/ffmpeg-android/toolchain-android/sysroot --enable-pic --enable-libx264 --enable-libass --enable-libfreetype --enable-libfribidi --enable-fontconfig --enable-pthreads --disable-debug --disable-ffserver --enable-version3 --enable-hardcoded-tables --disable-ffplay --disable-ffprobe --enable-gpl --enable-yasm --disable-doc --disable-shared --enable-static --pkg-config=/home/sb/Source-Code/ffmpeg-android/ffmpeg-pkg-config --prefix=/home/sb/Source-Code/ffmpeg-android/build/armeabi-v7a-neon --extra-cflags='-I/home/sb/Source-Code/ffmpeg-android/toolchain-android/include -U_FORTIFY_SOURCE -D_FORTIFY_SOURCE=2 -fno-strict-overflow -fstack-protector-all -mfpu=neon' --extra-ldflags='-L/home/sb/Source-Code/ffmpeg-android/toolchain-android/lib -Wl,-z,relro -Wl,-z,now -pie' --extra-libs='-lpng -lexpat -lm' --extra-cxxflags=
               libavutil      54.  7.100 / 54.  7.100
               libavcodec     56.  1.100 / 56.  1.100
               libavformat    56.  4.101 / 56.  4.101
               libavdevice    56.  0.100 / 56.  0.100
               libavfilter     5.  1.100 /  5.  1.100
               libswscale      3.  0.100 /  3.  0.100
               libswresample   1.  1.100 /  1.  1.100
               libpostproc    53.  0.100 / 53.  0.100
             Input #0, mov,mp4,m4a,3gp,3g2,mj2, from 'android.mp4':
               Metadata:
                 major_brand     : isom
         minor_version   : 512
                 compatible_brands: isomiso2avc1mp41
         encoder         : Lavf57.21.101
               Duration: 00:00:01.29, start: 0.023220, bitrate: 308 kb/s
         Stream #0:0(eng): Video: h264 (High) (avc1 / 0x31637661), yuv420p, 720x1280 [SAR 1:1 DAR 9:16], 113 kb/s, 24 fps, 24 tbr, 12288 tbn, 48 tbc (default)
         Metadata:
                   handler_name    : VideoHandler
         Stream #0:1(eng): Audio: aac (mp4a / 0x6134706D), 44100 Hz, stereo, fltp, 186 kb/s (default)
         Metadata:
                   handler_name    : SoundHandler
     Input #1, mov,mp4,m4a,3gp,3g2,mj2, from 'iphone.mp4':
               Metadata:
                 major_brand     : mp42
         minor_version   : 1
                 compatible_brands: mp41mp42isom
         creation_time   : 2016-05-10 09:46:30
               Duration: 00:00:02.63, start: 0.000000, bitrate: 4768 kb/s
         Stream #1:0(und): Audio: aac (mp4a / 0x6134706D), 44100 Hz, stereo, fltp, 101 kb/s (default)
         Metadata:
                   creation_time   : 2016-05-10 09:46:30
                   handler_name    : Core Media Audio
         Stream #1:1(und): Video: h264 (Main) (avc1 / 0x31637661), yuv420p(tv, bt709), 720x1280, 4657 kb/s, 30 fps, 30 tbr, 600 tbn, 1200 tbc (default)
         Metadata:
                   creation_time   : 2016-05-10 09:46:30
                   handler_name    : Core Media Video
     At least one output file must be specified

0 个答案:

没有答案