These are chat archives for WritingMinds/ffmpeg-android-java

31st
Aug 2015
cldcloud
@cldcloud
Aug 31 2015 04:12
Hello everybody!
Guys, tell me please, how can i concatenate two videos using hiteshsondhi88 andoid-ffmpeg-java?
I mean, I'm using Android Lolipop, in my app I'm creating a video using native camera (the extention of the videos is mp4) and i need merge it together. I was trying different commands, but it doesn't help to me.
cldcloud
@cldcloud
Aug 31 2015 06:24
Now i solved this problem usnig the txt file as root of the videos, but now i can't merge this video with audio
"unable to find a suitable output format fot 'ffmpeg'
ffmpeg: Invalid argument' - this is what i'm getting instad of result..
Tooto
@Tooto
Aug 31 2015 07:41

@cldcloud here is my code:
final String command = "-i " + audioFile.getAbsolutePath() + " -i " + filePath + " -strict -2 " + newFilePath;

look at " -strict -2" it should solve your problem

filepath - path to videoFile
cldcloud
@cldcloud
Aug 31 2015 07:46
That's great! Thank you very much ;) Now the process is running and i think it would work correctly =)
As I understood, with this library we shouldn't use "ffmpeg -i ....", only "-i..."?
Tooto
@Tooto
Aug 31 2015 07:47
@cldcloud yes, u are right
@cldcloud note, that for my command video and audio should be same length
cldcloud
@cldcloud
Aug 31 2015 07:49
my video is shorter than audio, i should use -shortest command?
smth like:
-i /storage/emulated/0/video.mp4 -i /storage/emulated/0/audio.mp3 -strict -2 -shortest /storage/emulated/0/final.mp4 ?
Hitesh Sondhi
@hiteshsondhi88
Aug 31 2015 07:50
Good to see people talking here :-)
cldcloud
@cldcloud
Aug 31 2015 07:50
You can't imagine how I'm happy! =)
Thanh Chinh Ban
@thanhbc
Aug 31 2015 07:56
@cldcloud look like u're create movies making app :D
cldcloud
@cldcloud
Aug 31 2015 07:58
@thanhbc not really =)
Tooto
@Tooto
Aug 31 2015 07:59
@cldcloud sry, i dont know how, but you should use -shortest command:) I tried and it works for me sometimes
cldcloud
@cldcloud
Aug 31 2015 07:59
@Tooto thank you very much =)
Tooto
@Tooto
Aug 31 2015 08:00
@cldcloud but -strict -2 should be exactly before output file.
cldcloud
@cldcloud
Aug 31 2015 08:01
Hmm, ok, my process should stop after a minute and i'll check the result
@Tooto th commant i wrote (-strict -2 before -shortest) is working too =)