tcking / GiraffeCompressor

video compressor on android
70 stars 27 forks source link

Not Generating compressed video file #2

Closed deepakrokz closed 6 years ago

deepakrokz commented 6 years ago

Hi @tcking, I tried this library it's working fine, but when I am trying to apply the watermark to compressed video as mentioned in demonstration code, compression is completing with 0 sizes. can you please check will be very helpful

Thank you so much for sharing such useful library.

tcking commented 6 years ago

watermark only supported when the impl is ffmpeg,is the impl is ffmepg? or any error messages?

deepakrokz commented 6 years ago

Sorry, I am not getting you. I have completely followed your example as you have specified. How can I set impl there is no specified method for this?

deepakrokz commented 6 years ago

Sorry for the trouble when I specified impl as FFMPEG, then getting this error log

Can you please check this?

compression Error---java.lang.RuntimeException: ffmpeg version n3.0.1 Copyright (c) 2000-2016 the FFmpeg developers built with gcc 4.8 (GCC) configuration: --target-os=linux --cross-prefix=/home/vagrant/SourceCode/ffmpeg-android/toolchain-android/bin/arm-linux-androideabi- --arch=arm --cpu=cortex-a8 --enable-runtime-cpudetect --sysroot=/home/vagrant/SourceCode/ffmpeg-android/toolchain-android/sysroot --enable-pic --enable-libx264 --enable-libass --enable-libfreetype --enable-libfribidi --enable-libmp3lame --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/vagrant/SourceCode/ffmpeg-android/ffmpeg-pkg-config --prefix=/home/vagrant/SourceCode/ffmpeg-android/build/armeabi-v7a --extra-cflags='-I/home/vagrant/SourceCode/ffmpeg-android/toolchain-android/include -U_FORTIFY_SOURCE -D_FORTIFY_SOURCE=2 -fno-strict-overflow -fstack-protector-all' --extra-ldflags='-L/home/vagrant/SourceCode/ffmpeg-android/toolchain-android/lib -Wl,-z,relro -Wl,-z,now -pie' --extra-libs='-lpng -lexpat -lm' --extra-cxxflags= libavutil 55. 17.103 / 55. 17.103 libavcodec 57. 24.102 / 57. 24.102 libavformat 57. 25.100 / 57. 25.100 libavdevice 57. 0.101 / 57. 0.101 libavfilter 6. 31.100 / 6. 31.100 libswscale 4. 0.100 / 4. 0.100 libswresample 2. 0.101 / 2. 0.101 libpostproc 54. 0.100 / 54. 0.100 Input #0, mov,mp4,m4a,3gp,3g2,mj2, from '/storage/emulated/0/MaterialCamera/VID_20171025_182553.mp4': Metadata: major_brand : mp42 minor_version : 0 compatible_brands: isommp42 creation_time : 2017-10-25 12:55:59 com.android.version: 6.0.1 Duration: 00:00:05.04, start: 0.000000, bitrate: 1073 kb/s Stream #0:0(eng): Video: h264 (Baseline) (avc1 / 0x31637661), yuv420p, 960x720, 1056 kb/s, 24.75 fps, 24.83 tbr, 90k tbn, 180k tbc (default) Metadata: rotate : 270 creation_time : 2017-10-25 12:55:59 handler_name : VideoHandle Side data: displaymatrix: rotation of 90.00 degrees Stream #0:1(eng): Audio: aac (LC) (mp4a / 0x6134706D), 48000 Hz, stereo, fltp, 50 kb/s (default) Metadata: creation_time : 2017-10-25 12:55:59 handler_name : SoundHandle [NULL @ 0xb5c23600] Unable to find a suitable output format for '/storage/emulated/0/Android/data/com.test/files/sung/Uska' /storage/emulated/0/Android/data/com.test/files/sung/Uska: Invalid argument

tcking commented 6 years ago

try add suffix to your output file,eg: Uska.mp4

tcking commented 6 years ago

1.try add suffix to your output file 2.update version to 0.1.4 compile 'com.github.tcking:giraffecompressor:0.1.4'

deepakrokz commented 6 years ago

okay let me try

deepakrokz commented 6 years ago

Thanks a lot for instance support, the issue is currently ffmpeg is taking much time like for video which is of duration 5 secs compression time is

take time:30278 can you help me on this, how can I reduce compression time?

tcking commented 6 years ago

try add -threads to the cmd,just change FFMPEGVideoCompressor.java line 19 to -i %s -threads 8 -vcodec libx264 -b:v %s -y %s,but there is little effect,only reduce 10s for 11s video in my test case

deepakrokz commented 6 years ago

Okay, I will try it later Thanks