Open hannanriaz009 opened 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?
@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?
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.
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.
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
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.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