I am using writemind's ffmpeg module (running ffmpeg v3.0.2)
http://writingminds.github.io/ffmpeg-android-java/
But I am getting the follow error when executing the command
[NULL # 0xe93aa000] Unable to find a suitable output format for ' -i
"/storage/emulated/0/Android/data/com.charaku.popsical.tv/cache/video_recording.mp4"
-i "/storage/emulated/0/Download/132859_aac-group-2.mp4" -c:v copy -filter_complex '[1:a] adelay=2500|2500 [delayed]; [0:a] [delayed] amix [out]' -map 0:v -map '[out]'
"/storage/emulated/0/Android/data/com.charaku.popsical.tv/cache/mixed_test2.mp4"'
-i "/storage/emulated/0/Android/data/com.charaku.popsical.tv/cache/video_recording.mp4"
-i "/storage/emulated/0/Download/132859_aac-group-2.mp4" -c:v copy -filter_complex '[1:a] adelay=2500|2500 [delayed]; [0:a] [delayed] amix [out]' -map 0:v -map '[out]'
"/storage/emulated/0/Android/data/com.charaku.popsical.tv/cache/mixed_test2.mp4":
Invalid argument
The command is supposed to mix the audio of a video file with the audio of another audio file to produce a new video file.
Able to get pass this error by following the suggestion in this link
FFmpeg error Output file #0 does not contain any stream
Basically putting each argument in its own array element
Related
I have 2 commands, one for overlay(work alone), one for add text (work alone), i want this 2 commands in one.
ffmpeg -i myvideo.mp4 -i image.png -filter_complex [0:v][1:v]overlay=5:5,drawtext=fontfile=:text=mytext:fontcolor=orange#1.0:fontsize=30:x=30:y=200[v] -map [output] output.mp4
This command generate empty file without error.
Your -map option is using a label that does not reference anything.
You should be getting this error:
Output with label 'output' does not exist in any defined filter graph, or was already used elsewhere.
The -filter_complex output and the -map option should use the same label. It can be almost any arbitrary name as long as they match. Also, your fontfile is missing the font path. You may have to quote your text string, but you're using Android and it is weird with quoting. Lastly, you should stream copy the audio.
Use this: both filter output and -map are using [v]
ffmpeg -i myvideo.mp4 -i image.png -filter_complex [0:v][1:v]overlay=5:5,drawtext=text=mytext:fontcolor=orange#1.0:fontsize=30:x=30:y=200[v] -map [v] -map 0:a -c:a copy output.mp4
or this: both filter output and -map are using [output]
ffmpeg -i myvideo.mp4 -i image.png -filter_complex [0:v][1:v]overlay=5:5,drawtext=text=mytext:fontcolor=orange#1.0:fontsize=30:x=30:y=200[output] -map [output] -map 0:a -c:a copy output.mp4
or this: use the default stream selection
ffmpeg -i myvideo.mp4 -i image.png -filter_complex [0:v][1:v]overlay=5:5,drawtext=text=mytext:fontcolor=orange#1.0:fontsize=30:x=30:y=200 -c:a copy output.mp4
I m using below ffmpeg command to generate video(slideshow) from list of images,but the issue is that its only displaying first image.
ffmpeg -loop 1 -t 3 -i image1.jpg -i image2.jpg -i image3.jpg -filter_complex [v][v1][v2] concat=n=3:v=1,format=yuv422p[a] -map [a] out.mp4
Any help will be appreciate.
Thanks.
Finally after lot of practices got the solution and better ffmpeg command then above command.
ffmpeg -f concat -safe 0 -i img-list.txt -f concat -safe 0 -i audio-list.txt -c:a aac -pix_fmt yuv420p -crf 23 -r 24 -shortest -y -vf "scale=trunc(iw/2)*2:trunc(ih/2)*2" video.mp4
in above command input.txt will contains path of image files seperated with new line.
input.txt
file '*/image1.jpg'
file '*/image2.jpg'
file '*/image3.jpg'
I have used this command to concate multiple images with transition effects to create video.
"-y -f concat -safe 0 -i <txt file path> -filter_complex [0:0][1:0]concat=n=2:v=0:a=1[out] -map [v] -shortest -vf fps=40 -pix_fmt yuv420p <video path>"
But it is showing error :
Stream specifier ':0' in filtergraph description [0:0][1:0]concat=n=2:v=0:a=1[out] matches no streams.
Here is my txt file
file '/storage/emulated/0/image1.jpg'
duration 5
file '/storage/emulated/0/image2.jpg'
duration 5
file '/storage/emulated/0/image3.jpg'
However if i am not applying any filter effect, it is successfully creating a video.
Following command creates the video at a frame rate of 1 frame for 5 seconds.
ffmpeg -y -r 1/5 -i image1.jpg -i image2.jpg -i image3.jpg -filter_complex 'concat=n=3:v=1:a=0 [out]' -map [out] -c:v libx264 output.mp4
I want use images to generate a video, i found a ffmpeg command option name '-f concat' ,anybody can give me more infomations?
i try like this:
ffmpeg -r 1/5 -s 480*480 -f concat -safe 0 -i test/b.txt -c:v libx264 test/test.mp4
but an error appear:
Option video_size not found.
I am cutting out segments from a long mp4 file and then rejoining parts of them. However, since FFMPEG apparently keeps the same MOOV atom for the trimmed files as the original, it looks to FFMPEG that the trimmed videos are all identical since they all have the same MOOV atom, and therefore only uses the first segment when trying to join the videos. Is there a way around this? Unfortunately since FFMPEG is embedded in an Android app, I can only use version 0.11.
Edit:
This is a sample of the processes:
ffmpeg -i /sdcard/path/movie.mp4 -ss 00:00:06.000, -t 00:00:05.270, -c:a aac -c:v libx264 /sdcard/path/file1.mp4
ffmpeg -i /sdcard/path/movie.mp4 -ss 00:00:12.000, -t 00:00:04.370, -c:a aac -c:v libx264 /sdcard/path/file2.mp4
ffmpeg -i /sdcard/path/movie.mp4 -ss 00:00:23.000, -t 00:00:03.133, -c:a aac -c:v libx264 /sdcard/path/file3.mp4
ffmpeg -i "concat:/sdcard/path/file1.mp4|/sdcard/path/file2.mp4|/sdcard/path/file3.mp4" -c:a aac -c:v libx264 /sdcard/path/output.mp4
I've also tried using the copy codec option but that hasn't helped.
Can you try something like:
ffmpeg -i input1.mp4 -c copy -bsf:v h264_mp4toannexb -f mpegts intermediate1.ts
ffmpeg -i input2.mp4 -c copy -bsf:v h264_mp4toannexb -f mpegts intermediate2.ts
ffmpeg -i "concat:intermediate1.ts|intermediate2.ts" -c copy -bsf:a aac_adtstoasc output.mp4
I hope this works with ffmpeg version 0.11. We need to make sure you can concat before applying the cut of file.
Also can you check the intermediary file*.mp4 works well? Can you try to put your video files on the same folder as ffmpeg I am not sure how the concat protocol reacts to /sdcard/path/file1.mp4|/sdcard/path/file2.mp4?