android - Concat video files of different resolutions using FFmpeg -


i using ffmpeg concat videos in android application.i have followed of steps merge videos of different formats. mp4 videos, have convert input files mpeg-2 ts files , merge .ts files output mp4 file.

  • i have problem in merging videos if of different resolutions(say 1 640*480 , other 1280*720).the output video not merge properly(sometimes throws error in streams). there way handle without losing quality of videos?

  • lets merging 2 videos 1 audio , other without audio.when try merge these 2 getting errors in audio streams.is there way handle also(videos should merged or without audio)?

i facing problems in above 2 things , spent more time without success. idea appreciated.

for merging videos need work same resolution, should scale 640x480 video or compress 1280x720, you. recommend compress bigger 1 faster.

moreover, merging videos need media file audio , video part. can create silence audio same duration of video , after can add video. videos should merged audio.

ffmpeg -ar 48000 -t 60 -f s16le -acodec pcm_s16le -i /dev/zero -ab 128k -f mp2 -acodec mp2 -y silence.mp2  ffmpeg -i video_without_audio.mpg -i silence.mp2 video_to_merge.mpg  

Comments