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

1st
Sep 2015
cldcloud
@cldcloud
Sep 01 2015 09:29
Hello everyone!
Today I have a new problem...
I need to concatenate a myltiple videos (it's about 10), so 8 of them are recorded from the camera and they have the same codecs, but two of them are using another codec. So, how should i concatenate them together? I had learn information from this link https://trac.ffmpeg.org/wiki/Concatenate and there is answer in section "Concatenation of files with different codecs"
But I can't use it (neither with text file with videos nor with single-line command).
Does anybody had the same problem?
Hitesh Sondhi
@hiteshsondhi88
Sep 01 2015 09:30
You cannot solve this with simple single line command
you first need to create a ts files from all of them and then concatenate
cldcloud
@cldcloud
Sep 01 2015 09:31
I was trying to create .ts as there: 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
but I'm getting error "No such file opr directory"
Hitesh Sondhi
@hiteshsondhi88
Sep 01 2015 09:32
intermediate1.ts should be the full path
and it works as I am using this for one of my project
cldcloud
@cldcloud
Sep 01 2015 09:34
-i /storage/emulated/0/input1.mp4 -c copy -bsf:v h264_mp4toannexb -f mpegts /storage/emulated/0/intermediate1.ts
-i /storage/emulated/0/input2.mp4 -c copy -bsf:v h264_mp4toannexb -f mpegts /storage/emulated/0/intermediate2.ts
-i "concat:/storage/emulated/0/intermediate1.ts|/storage/emulated/0/intermediate2.ts" -c copy -bsf:a aac_adtstoasc /storage/emulated/0/output.mp4
Is this commant right?
Hitesh Sondhi
@hiteshsondhi88
Sep 01 2015 09:34
I am not sure as I need to check FFmpeg’s documentation for this
but the command is definitely similar
cldcloud
@cldcloud
Sep 01 2015 09:36
When i'm paste this code into edit text inside your sample application, i'm getting "No such fileor directory"
Could you please write there code from your project?
cldcloud
@cldcloud
Sep 01 2015 09:51
Ok, I made a rude mistake, I' paste full code instead of array of strings...
The right way is:
-i /storage/emulated/0/input1.mp4 -c copy -bsf:v h264_mp4toannexb -f mpegts /storage/emulated/0/intermediate1.ts
then execute
-i /storage/emulated/0/input2.mp4 -c copy -bsf:v h264_mp4toannexb -f mpegts /storage/emulated/0/intermediate2.ts
and then merge it
Hitesh Sondhi
@hiteshsondhi88
Sep 01 2015 09:54
cool
cldcloud
@cldcloud
Sep 01 2015 09:54
ts files was generated, but not concatenated.. No such file or directory..
Hitesh Sondhi
@hiteshsondhi88
Sep 01 2015 11:15
instead of “/storage/emulated/0” try /sdcard
Anmol92verma
@Anmol92verma
Sep 01 2015 12:41
hi
i just posted an issue
can you please help with it?
Hitesh Sondhi
@hiteshsondhi88
Sep 01 2015 12:47
Hi Anmol you are stuck with the basics, please google about this or ask on SO
Anmol92verma
@Anmol92verma
Sep 01 2015 12:47
i googled it, do you have an answer for it? please it would be great if you can share something
Hitesh Sondhi
@hiteshsondhi88
Sep 01 2015 13:40
@Anmol92verma
ffmpeg -i /storage/sdcard0/ptlinkx/2ada2463-0f81-4b0e-b3b1-711df7428552.mp4 -vcodec mpeg4 /storage/sdcard0/2ada2463-0f81-4b0e-b3b1-711df7428552.mp4
are you sure sdcard location is fine here ?
try to use above command without “-vcodec mpeg4 “ as the default codec is libx264