cropsly / ffmpeg-android-java

Android java library for FFmpeg binary compiled using https://github.com/writingminds/ffmpeg-android
http://writingminds.github.io/ffmpeg-android-java
GNU General Public License v3.0
3.32k stars 830 forks source link

Facing issue in compression after update | Output file #0 does not contain any stream #88

Open hannanriaz009 opened 8 years ago

hannanriaz009 commented 8 years ago

Here is my command

ffmpeg -y -i /storage/emulated/0/DCIM/Camera/VID_20160421_135729.mp4 -c:v libx264 -preset ultrafast -strict -2 -s 352x198 -aspect 16:9 /storage/emulated/0/Pictures/app_name/jv_tmpl.mp4 I am seeing following error in console log.

onFailure : 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

Output #0, mp4, to 'ffmpeg -y -i /storage/emulated/0/DCIM/Camera/VID_20160421_135729.mp4 -c:v libx264 -preset ultrafast -strict -2 -s 352x198 -aspect 16:9 /storage/emulated/0/Pictures/Jobvibe/jv_tmpl.mp4':
Output file #0 does not contain any stream

Please let me know whats wrong with my command or file. I created outfile with same path, name and extension on file system before command execution. File is well created without any exception. Your help will be highly appreciated.

Thanks

phil-lauffenburger commented 8 years ago

Hey @hannanriaz009 I believe you don't have to enter 'ffmepg' at the beginning of the command.

However, I am having the exact same issue whether or I not I add 'ffmpeg'. So, uh, help please?

phil-lauffenburger commented 8 years ago

@hannanriaz009 actually I believe I figured it out:

You actually have to break up the string[] cmd into a string[], instead of just entering the cmd as the first index of the string[]. Does that make sense?

Your command should be:

String[] cmd = {"-y", "-i", "/storage/emulated/0/DCIM/Camera/VID_20160421_135729.mp4", "-c:v", "libx264", "-preset", "ultrafast", "-strict", "-2", "-s", "352x198", "-aspect", "16:9", "/storage/emulated/0/Pictures/app_name/jv_tmpl.mp4" }

Does that work?

hannanriaz009 commented 8 years ago

Hello @lauffenp.

Thanks mate for your help. Yes your way of executing command works for me very well. :+1: But issue now I am facing is compressed video is very low in quality. I believe it has something to do with "16:9" or "352x198". I have some local code in my app calculating these values based on one frame of original video. Can you tell me what these params represent? Or some link from where I can check more combinations. If you can share the right code which works on multiple resolutions of video, captured by different cameras, that would be great favor.

phil-lauffenburger commented 8 years ago

This document will tell you what the parameters mean:

https://ffmpeg.org/ffmpeg.html

I would hazard that the 352x198 is causing the low quality.

mohittanwar94 commented 8 years ago

String[] cmd = {"-y", "-i", "/storage/emulated/0/DCIM/Camera/VID_20160421_135729.mp4", "-c:v", "libx264", "-preset", "ultrafast", "-strict", "-2", "-s", "352x198", "-aspect", "16:9", "/storage/emulated/0/Pictures/app_name/jv_tmpl.mp4" }

i have used above command and its gives me error Encoder (codec amr_nb) not found for output stream #0:1

please reply on this