Peter_one 2016-08-04 05:29 采纳率: 40%
浏览 4067
已结题

FFmpeg 视频压缩问题 麻烦大虾们进来看下

 08-04 13:15:43.566 19531-20681/com.bike.main D/QCloud: 压缩中/data/data/com.bike.main/app_bin/ffmpeg -threads 4 -y -i /storage/emulated/0/DCIM/Camera/VID_20160804_102832.mp4 -strict -2 -vf crop=360:480:0:0 -preset ultrafast -tune zerolatency -s 360x480 -b:a 128k -r 30 -vcodec libx264 -acodec copy /storage/emulated/0/DCIM/Camera/VID_20160804_102832.mp4 
08-04 13:15:43.612 19531-20714/com.bike.main D/QCloud: 压缩中WARNING: linker: /data/data/com.bike.main/app_bin/ffmpeg has text relocations. This is wasting memory and prevents security hardening. Please fix.
08-04 13:15:43.628 19531-20714/com.bike.main D/QCloud: 压缩中ffmpeg version n2.4.2 Copyright (c) 2000-2014 the FFmpeg developers
08-04 13:15:43.628 19531-20714/com.bike.main D/QCloud: 压缩中  built on Oct  7 2014 15:05:17 with gcc 4.8 (GCC)
08-04 13:15:43.629 19531-20714/com.bike.main D/QCloud: 压缩中  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 --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' --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=
08-04 13:15:43.629 19531-20714/com.bike.main D/QCloud: 压缩中  libavutil      54.  7.100 / 54.  7.100
08-04 13:15:43.629 19531-20714/com.bike.main D/QCloud: 压缩中  libavcodec     56.  1.100 / 56.  1.100
08-04 13:15:43.630 19531-20714/com.bike.main D/QCloud: 压缩中  libavformat    56.  4.101 / 56.  4.101
08-04 13:15:43.630 19531-20714/com.bike.main D/QCloud: 压缩中  libavdevice    56.  0.100 / 56.  0.100
08-04 13:15:43.630 19531-20714/com.bike.main D/QCloud: 压缩中  libavfilter     5.  1.100 /  5.  1.100
08-04 13:15:43.630 19531-20714/com.bike.main D/QCloud: 压缩中  libswscale      3.  0.100 /  3.  0.100
08-04 13:15:43.631 19531-20714/com.bike.main D/QCloud: 压缩中  libswresample   1.  1.100 /  1.  1.100
08-04 13:15:43.631 19531-20714/com.bike.main D/QCloud: 压缩中  libpostproc    53.  0.100 / 53.  0.100
08-04 13:15:43.968 19531-20714/com.bike.main D/QCloud: 压缩中Input #0, mov,mp4,m4a,3gp,3g2,mj2, from '/storage/emulated/0/DCIM/Camera/VID_20160804_102832.mp4':
08-04 13:15:43.969 19531-20714/com.bike.main D/QCloud: 压缩中  Metadata:
08-04 13:15:43.969 19531-20714/com.bike.main D/QCloud: 压缩中    major_brand     : mp42
08-04 13:15:43.969 19531-20714/com.bike.main D/QCloud: 压缩中    minor_version   : 0
08-04 13:15:43.970 19531-20714/com.bike.main D/QCloud: 压缩中    compatible_brands: isommp42
08-04 13:15:43.970 19531-20714/com.bike.main D/QCloud: 压缩中    creation_time   : 2016-08-04 02:28:43
08-04 13:15:43.970 19531-20714/com.bike.main D/QCloud: 压缩中    location        : +30.1914+120.1892/
08-04 13:15:43.971 19531-20714/com.bike.main D/QCloud: 压缩中    location-eng    : +30.1914+120.1892/
08-04 13:15:43.972 19531-20714/com.bike.main D/QCloud: 压缩中  Duration: 00:00:10.18, start: 0.000000, bitrate: 41899 kb/s
08-04 13:15:43.973 19531-20714/com.bike.main D/QCloud: 压缩中    Stream #0:0(eng): Video: h264 (Baseline) (avc1 / 0x31637661), yuv420p, 3840x2160, 41699 kb/s, SAR 65536:65536 DAR 16:9, 29.24 fps, 30 tbr, 90k tbn, 180k tbc (default)
08-04 13:15:43.973 19531-20714/com.bike.main D/QCloud: 压缩中    Metadata:
08-04 13:15:43.973 19531-20714/com.bike.main D/QCloud: 压缩中      rotate          : 90
08-04 13:15:43.974 19531-20714/com.bike.main D/QCloud: 压缩中      creation_time   : 2016-08-04 02:28:43
08-04 13:15:43.974 19531-20714/com.bike.main D/QCloud: 压缩中      handler_name    : VideoHandle
08-04 13:15:43.974 19531-20714/com.bike.main D/QCloud: 压缩中    Side data:
08-04 13:15:43.975 19531-20714/com.bike.main D/QCloud: 压缩中      displaymatrix: rotation of -90.00 degrees
08-04 13:15:43.975 19531-20714/com.bike.main D/QCloud: 压缩中    Stream #0:1(eng): Audio: aac (mp4a / 0x6134706D), 48000 Hz, stereo, fltp, 96 kb/s (default)
08-04 13:15:43.975 19531-20714/com.bike.main D/QCloud: 压缩中    Metadata:
08-04 13:15:43.976 19531-20714/com.bike.main D/QCloud: 压缩中      creation_time   : 2016-08-04 02:28:43
08-04 13:15:43.976 19531-20714/com.bike.main D/QCloud: 压缩中      handler_name    : SoundHandle
08-04 13:15:43.990 19531-20714/com.bike.main D/QCloud: 压缩中[libx264 @ 0xb5ec4400] using SAR=1/1
08-04 13:15:44.003 19531-20714/com.bike.main D/QCloud: 压缩中[libx264 @ 0xb5ec4400] using cpu capabilities: none!
08-04 13:15:44.067 19531-20714/com.bike.main D/QCloud: 压缩中[libx264 @ 0xb5ec4400] profile Constrained Baseline, level 3.0
08-04 13:15:44.067 19531-20714/com.bike.main D/QCloud: 压缩中[libx264 @ 0xb5ec4400] 264 - core 142 - H.264/MPEG-4 AVC codec - Copyleft 2003-2014 - http://www.videolan.org/x264.html - options: cabac=0 ref=1 deblock=0:0:0 analyse=0:0 me=dia subme=0 psy=1 psy_rd=1.00:0.00 mixed_ref=0 me_range=16 chroma_me=1 trellis=0 8x8dct=0 cqm=0 deadzone=21,11 fast_pskip=1 chroma_qp_offset=0 threads=4 lookahead_threads=4 sliced_threads=1 slices=4 nr=0 decimate=1 interlaced=0 bluray_compat=0 constrained_intra=0 bframes=0 weightp=0 keyint=250 keyint_min=25 scenecut=0 intra_refresh=0 rc=crf mbtree=0 crf=23.0 qcomp=0.60 qpmin=0 qpmax=69 qpstep=4 ip_ratio=1.40 aq=0
08-04 13:15:44.075 19531-20714/com.bike.main D/QCloud: 压缩中Output #0, mp4, to '/storage/emulated/0/DCIM/Camera/VID_20160804_102832.mp4':
08-04 13:15:44.075 19531-20714/com.bike.main D/QCloud: 压缩中  Metadata:
08-04 13:15:44.076 19531-20714/com.bike.main D/QCloud: 压缩中    major_brand     : mp42
08-04 13:15:44.076 19531-20714/com.bike.main D/QCloud: 压缩中    minor_version   : 0
08-04 13:15:44.076 19531-20714/com.bike.main D/QCloud: 压缩中    compatible_brands: isommp42
08-04 13:15:44.077 19531-20714/com.bike.main D/QCloud: 压缩中    location-eng    : +30.1914+120.1892/
08-04 13:15:44.077 19531-20714/com.bike.main D/QCloud: 压缩中    location        : +30.1914+120.1892/
08-04 13:15:44.077 19531-20714/com.bike.main D/QCloud: 压缩中    encoder         : Lavf56.4.101
08-04 13:15:44.079 19531-20714/com.bike.main D/QCloud: 压缩中    Stream #0:0(eng): Video: h264 (libx264) ([33][0][0][0] / 0x0021), yuv420p, 360x480 [SAR 1:1 DAR 3:4], q=-1--1, 30 fps, 15360 tbn, 30 tbc (default)
08-04 13:15:44.079 19531-20714/com.bike.main D/QCloud: 压缩中    Metadata:
08-04 13:15:44.079 19531-20714/com.bike.main D/QCloud: 压缩中      rotate          : 90
08-04 13:15:44.079 19531-20714/com.bike.main D/QCloud: 压缩中      creation_time   : 2016-08-04 02:28:43
08-04 13:15:44.080 19531-20714/com.bike.main D/QCloud: 压缩中      handler_name    : VideoHandle
08-04 13:15:44.080 19531-20714/com.bike.main D/QCloud: 压缩中      encoder         : Lavc56.1.100 libx264
08-04 13:15:44.081 19531-20714/com.bike.main D/QCloud: 压缩中    Stream #0:1(eng): Audio: aac ([64][0][0][0] / 0x0040), 48000 Hz, stereo, 128 kb/s (default)
08-04 13:15:44.081 19531-20714/com.bike.main D/QCloud: 压缩中    Metadata:
08-04 13:15:44.081 19531-20714/com.bike.main D/QCloud: 压缩中      creation_time   : 2016-08-04 02:28:43
08-04 13:15:44.082 19531-20714/com.bike.main D/QCloud: 压缩中      handler_name    : SoundHandle
08-04 13:15:44.082 19531-20714/com.bike.main D/QCloud: 压缩中Stream mapping:
08-04 13:15:44.082 19531-20714/com.bike.main D/QCloud: 压缩中  Stream #0:0 -> #0:0 (h264 (native) -> h264 (libx264))
08-04 13:15:44.083 19531-20714/com.bike.main D/QCloud: 压缩中  Stream #0:1 -> #0:1 (copy)
08-04 13:15:44.083 19531-20714/com.bike.main D/QCloud: 压缩中Press [q] to stop, [?] for help
08-04 13:15:44.413 19531-20714/com.bike.main D/QCloud: 压缩中[mov,mp4,m4a,3gp,3g2,mj2 @ 0xb5efa000] stream 1, offset 0x66172: partial file
08-04 13:15:44.414 19531-20714/com.bike.main D/QCloud: 压缩中/storage/emulated/0/DCIM/Camera/VID_20160804_102832.mp4: Invalid data found when processing input
08-04 13:15:44.431 19531-20714/com.bike.main D/QCloud: 压缩中frame=    1 fps=0.0 q=20.0 Lsize=      25kB time=00:00:01.00 bitrate= 201.3kbits/s    
08-04 13:15:44.431 19531-20714/com.bike.main D/QCloud: 压缩中video:11kB audio:12kB subtitle:0kB other streams:0kB global headers:0kB muxing overhead: 6.192641%
08-04 13:15:44.447 19531-20714/com.bike.main D/QCloud: 压缩中[libx264 @ 0xb5ec4400] frame I:1     Avg QP:20.00  size: 10420
08-04 13:15:44.448 19531-20714/com.bike.main D/QCloud: 压缩中[libx264 @ 0xb5ec4400] mb I  I16..4: 100.0%  0.0%  0.0%
08-04 13:15:44.448 19531-20714/com.bike.main D/QCloud: 压缩中[libx264 @ 0xb5ec4400] coded y,uvDC,uvAC intra: 55.9% 40.3% 19.7%
08-04 13:15:44.448 19531-20714/com.bike.main D/QCloud: 压缩中[libx264 @ 0xb5ec4400] i16 v,h,dc,p: 34% 22% 32% 12%
08-04 13:15:44.448 19531-20714/com.bike.main D/QCloud: 压缩中[libx264 @ 0xb5ec4400] i8c dc,h,v,p: 67% 13% 17%  4%
08-04 13:15:44.449 19531-20714/com.bike.main D/QCloud: 压缩中[libx264 @ 0xb5ec4400] kb/s:2500.80
08-04 13:15:44.453 19531-20715/com.bike.main I/123: OUTPUT::null
08-04 13:15:44.454 19531-20714/com.bike.main I/123: ERROR::null
08-04 13:15:44.458 19531-20681/com.bike.main D/QCloud: 压缩成功
  • 麻烦大神们帮忙看看问题出在哪里啊 压缩好的视频**不能播放**而且**大小没变化**
  • 写回答

2条回答 默认 最新

  • 鱼弦 全栈领域优质创作者 2016-08-04 05:35
    关注

    ffmpeg.exe -s 176*144 -i test.yuv -vcodec mpeg4 -qscale 0.1~255 test.mp4

    FFMPEG用这个编译安装吧(apt-get的话还有一堆东西要搞,如果是Mac可以直接用Brew该有的都用了,而且都是最新的),完了就可以用x264和faac转了 https://github.com/stvs/ffmpeg-static

    然后再用这个FFMEG Wrapper Gem 包装一下 https://github.com/streamio/streamio-ffmpeg

    ffmpeg -i input.mov -s 768x480 -aspect 1.6 /tmp/output.mp4

    以上是Streamio-ffmpeg这个Gem生成出来的命令,也可以直接试一下。 注意分辨率和 -aspect 比例就好了。

    这是我前段时间转mp4的一些实验 :D

    你先安装ffmpeg和相应的类库(libx264和libfaac,压缩后视频编码是H.264,音频是AAC),现在压缩都是采用H.264 high profile,所以可以这样:

    shell脚本:一般如果要压缩质量比较好,都要2个pass

    high.sh

    $1是源文件,$2是码率,网络传输建议码率是1024k~2048k,$3是分辨率,720p是-1:720,-1表示根据高720保持比例缩放,$4是视频比例,看源视频了,比如4:3, 3:2, 16:9等,$5是输出文件名

    1st pass:

    ffmpeg -i $1 -vcodec libx264 -vprofile high -preset slow -b:v $2 -maxrate $2 -bufsize 4000k -vf scale=$3 -aspect $4 -threads 0 -pass 1 -an -f mp4 /dev/null

    2nd pass:

    ffmpeg -i $1 -vcodec libx264 -vprofile high -preset slow -b:v $2 -maxrate $2 -bufsize 4000k -vf scale=$3 -aspect $4 -threads 0 -pass 2 -acodec libfaac -b:a $5 -f mp4 $6

    具体使用方法实例:
    sh high.sh input.avi 2000k -1:720 16:9 output.mp4

    评论

报告相同问题?

悬赏问题

  • ¥15 ads仿真结果在圆图上是怎么读数的
  • ¥20 Cotex M3的调试和程序执行方式是什么样的?
  • ¥20 java项目连接sqlserver时报ssl相关错误
  • ¥15 一道python难题3
  • ¥15 用matlab 设计一个不动点迭代法求解非线性方程组的代码
  • ¥15 牛顿斯科特系数表表示
  • ¥15 arduino 步进电机
  • ¥20 程序进入HardFault_Handler
  • ¥15 oracle集群安装出bug
  • ¥15 关于#python#的问题:自动化测试