[Libav-user] Merging two .mp4 files.

elkrystus elkrystus at gmail.com
Mon Nov 19 11:21:52 CET 2012


Hi,

I want to merge two .mp4 files without reencoding them.
And I want to do it on android phone.

So what have I done to this point.
1) I have compiled ffmpeg with x264 support for android as  shared library.
2) I've managed to merge two video files with identical codec settings( both
from android camera) by reading all AVPackets from both files and writing
them to output file without decoding/encoding.
3) I've managed to encode a .jpeg photo as h264 video, which on it's own
plays just fine.

What didnt work is:
When I try to merge video made by android with the one that I have made from
the photo, then it fails.
Only one part of output video is visible in player or in some cases it
doesnt play at all.
I'm trying to match codecs as closely as I can, but I am never able to match
them perfectly.

I have tried avcodec_copy_context() but it doesnt seem to be a solution.
I have also tried to use h264Context or x264Context but there are always
problems with includes and when program reaches x264context declaration I
get fatal signal 11 error.


Is it possible to put two h264 streams encoded with different setting into
one mp4 file and somehow tell decoder to decode them separately?



Do you have any ideas what am I doing wrong or what can I do to make it
work?

All help is appreciated.



--
View this message in context: http://libav-users.943685.n4.nabble.com/Merging-two-mp4-files-tp4656062.html
Sent from the libav-users mailing list archive at Nabble.com.


More information about the Libav-user mailing list