Hi i am using FFMpeg for splitting video(39MB) as 15 parts using below command and that's fine video is splitting and there is no damage.
But problem is actually my main file size is 39MB but after splitting this video then splitting video files size become very large compare to main file
When i count splitting files size it was 69MB
Can some one suggested me please.
-i "input.mp4" -ss 00:00:01 -t 00:00:03 -acodec copy -vcodec copy "output.mp4"
Related
I want to reduce WEBP file size. I'm using https://github.com/tanersener/ffmpeg-kit library to convert my video .mp4 to .webp
Input File MP4 Size - 800kb
Output File WEBP size - 5.22 MB
Commands which i used
ffmpeg.exe -i outputbitrate.mp4 -vcodec libwebp -filter:v fps=fps=20 -lossless 1 -loop 0 -preset default -an -vsync 0 -vf scale=512:512:force_original_aspect_ratio=decrease,format=rgba,pad=512:512:-1:-1:color=#00000000 finalout.webp
I tried with compress_level,quality also. which is not reducing the output size.
in mycase, the output should be less then 512kb. how to achieve this.
Any articles or sample code will be very helpful. Thanks
I am using ffmpeg for making video(mp4) of image.jpg and audio.mp3.i used -y,-i,%s,-i,%s,-shortest,-acodec,copy,-vcodec,mjpeg,-shortest,%s this as command its run well but in output getting only 1 frame. my audio file length is 3min and getting output of 1 sec.I refere this as well but not getting desire output.
Add the -loop 1 input option before -i image.jpg.
I am new to Video related operations. I am using [FFMPEG][1] to compress a video in my Android application.
I am trying to compress a video of 50MB to 10MB by executing following command
ffmpeg -y -i /videos/in.mp4 -strict experimental -s 640x480 -r 25 -vcodec mpeg4 -b 150k -ab 48000 -ac 2 -ar 22050 /videos/out.mp4
Video compressing successfully, but it taking more than 150 seconds. I am unable find out how to reduce that time.
I want to change this command to complete this process in less time.
You can't do much here,few things you can try :
you can set the -preset value to fast/veryfast/ultrafast
you can set the -crf value (usually 18 to 28).
If you do not want to alter your audio/video codecs, you should retain the original settings using: -c copy (this can drastically improve the execution time, depending upon your use-case)
Also read this :https://github.com/WritingMinds/ffmpeg-android-java/issues/54
3.possibly use x264 "ultrafast" options (you can set the -preset value to fast/veryfast/ultrafast), or if you want mp4 video codec, maybe decrease the resolution or some option it allows
I am using ffmpeg in android for create video from multiple images, it has done and now i want to add more images in generated video. i found many times but not getting any proper command in ffmpeg for that.please help
Try using this command,
1.
ffmpeg -y -framerate 1/2 -start_number 1 -i img/%1d.jpg -vf scale=720:756 -c:v libx264 -r 10 -pix_fmt yuv420p videos.mp4
If you want to add watermark image to your generated video, you can use this one:
2.
ffmpeg -i videos.mp4 -i watermark_img.jpg -filter_complex "overlay=(main_w-overlay_w)/2:(main_h-overlay_h)/2" -codec:a copy watermark_videos.mp4
In order to create video from random images, You have to keep all images in dir called img, as you can see in first command, and just name all images in the dir, like: 1.jpg,2.jpg...N.jpg,etc , you have to name all the images in sequential number format, which is required by the ffmpeg command as you can see in the first command -i img/%1d.jpg , here -start_number 1 indicates it should start from image preceding with 1 number, and go on with all the images stored in img/ dir, sequentially.
In order to understand the ffmeg command please read all of it's CLI parameters:
man ffmpeg
OR
ffmpeg --help
I'm trying to use ffmpeg binary to convert aac format to mp3 format in andorid
I am too referring to a example here: https://github.com/sjitech/ffmpeg-android
What I tried with failure is
p = Runtime.getRuntime().exec("/data/data/myapp/app_bin/ffmpeg -i /sdcard/chua.aac -acodec libmp3lame -ac 2 -ab 160 /sdcard/chua.mp3");
I make sure that "/sdcard/chua.aac" exists on my phone
I guess the problem may come from libmp3lame in the command which is disabled in ffmpeg binary when building before with the example but I'm not very sure
Please someone reveal what my problem is and how to fix it.