x2305andy2305x
30th June 2011, 15:22
Hi,
I have a bunch of mp4 x264 encoded files and i would like to concatenate them into a single mp4 file. I've tried the MP4Box solution, but appears to damage the output file. For instance i can't do a qt_faststart on a file produced by MP4Box (that's why i say damage, although the file does play even in a more sensitive MoviePlayer, not only in mplayer)
So then i thought i'd try the mencoder approach:
mencoder -oac copy -ovc copy -idx -o output.mp4 video1.mp4 video2mp4...
MEncoder SVN-r33453-4.5.2 (C) 2000-2011 MPlayer Team
WARNING: OUTPUT FILE FORMAT IS _AVI_. See -of help.
success: format: 0 data: 0x0 - 0x31bf9f
libavformat file format detected.
[lavf] stream 0: video (h264), -vid 0
[lavf] stream 1: audio (aac), -aid 0, -alang und
VIDEO: [H264] 1280x720 24bpp 25.000 fps 2598.2 kbps (317.2 kbyte/s)
[V] filefmt:44 fourcc:0x34363248 size:1280x720 fps:25.000 ftime:=0.0400
==========================================================================
Opening audio decoder: [ffmpeg] FFmpeg/libavcodec audio decoders
AUDIO: 44100 Hz, 2 ch, s16le, 3.1 kbit/0.22% (ratio: 391->176400)
Selected audio codec: [ffaac] afm: ffmpeg (FFmpeg AAC (MPEG-2/MPEG-4 Audio))
==========================================================================
videocodec: framecopy (1280x720 24bpp fourcc=34363248)
Writing header...
ODML: Aspect information not (yet?) available or unspecified, not writing vprp header.
Writing header...
ODML: Aspect information not (yet?) available or unspecified, not writing vprp header.
Pos: 10.0s 250f (99%) 0.00fps Trem: 0min 4mb A-V:0.022 [2608:1411]
success: format: 0 data: 0x0 - 0x30b8e4
libavformat file format detected.
[lavf] stream 0: video (h264), -vid 0
[lavf] stream 1: audio (aac), -aid 0, -alang und
VIDEO: [H264] 1280x720 24bpp 25.000 fps 2544.4 kbps (310.6 kbyte/s)
[V] filefmt:44 fourcc:0x34363248 size:1280x720 fps:25.000 ftime:=0.0400
==========================================================================
Opening audio decoder: [ffmpeg] FFmpeg/libavcodec audio decoders
AUDIO: 44100 Hz, 2 ch, s16le, 3.1 kbit/0.22% (ratio: 391->176400)
Selected audio codec: [ffaac] afm: ffmpeg (FFmpeg AAC (MPEG-2/MPEG-4 Audio))
==========================================================================
videocodec: framecopy (1280x720 24bpp fourcc=34363248)
videocodec: framecopy (1280x720 24bpp fourcc=34363248)
All video files must have identical fps, resolution, and codec for -ovc copy.
Exiting...
Hell of a headache because all of the little mp4s are produced with the same ffmpeg mp4 encoding command that ensures they have the same resolution, fps and x264. I even force them to the same pix_fmt so i'm not sure what mencoder is blabbing at here. Do i need to make sure even kb/s is the same? Probably by using CRF?
Can any of you that have successfully done this give me a pointer?
Thanks in advance.
I have a bunch of mp4 x264 encoded files and i would like to concatenate them into a single mp4 file. I've tried the MP4Box solution, but appears to damage the output file. For instance i can't do a qt_faststart on a file produced by MP4Box (that's why i say damage, although the file does play even in a more sensitive MoviePlayer, not only in mplayer)
So then i thought i'd try the mencoder approach:
mencoder -oac copy -ovc copy -idx -o output.mp4 video1.mp4 video2mp4...
MEncoder SVN-r33453-4.5.2 (C) 2000-2011 MPlayer Team
WARNING: OUTPUT FILE FORMAT IS _AVI_. See -of help.
success: format: 0 data: 0x0 - 0x31bf9f
libavformat file format detected.
[lavf] stream 0: video (h264), -vid 0
[lavf] stream 1: audio (aac), -aid 0, -alang und
VIDEO: [H264] 1280x720 24bpp 25.000 fps 2598.2 kbps (317.2 kbyte/s)
[V] filefmt:44 fourcc:0x34363248 size:1280x720 fps:25.000 ftime:=0.0400
==========================================================================
Opening audio decoder: [ffmpeg] FFmpeg/libavcodec audio decoders
AUDIO: 44100 Hz, 2 ch, s16le, 3.1 kbit/0.22% (ratio: 391->176400)
Selected audio codec: [ffaac] afm: ffmpeg (FFmpeg AAC (MPEG-2/MPEG-4 Audio))
==========================================================================
videocodec: framecopy (1280x720 24bpp fourcc=34363248)
Writing header...
ODML: Aspect information not (yet?) available or unspecified, not writing vprp header.
Writing header...
ODML: Aspect information not (yet?) available or unspecified, not writing vprp header.
Pos: 10.0s 250f (99%) 0.00fps Trem: 0min 4mb A-V:0.022 [2608:1411]
success: format: 0 data: 0x0 - 0x30b8e4
libavformat file format detected.
[lavf] stream 0: video (h264), -vid 0
[lavf] stream 1: audio (aac), -aid 0, -alang und
VIDEO: [H264] 1280x720 24bpp 25.000 fps 2544.4 kbps (310.6 kbyte/s)
[V] filefmt:44 fourcc:0x34363248 size:1280x720 fps:25.000 ftime:=0.0400
==========================================================================
Opening audio decoder: [ffmpeg] FFmpeg/libavcodec audio decoders
AUDIO: 44100 Hz, 2 ch, s16le, 3.1 kbit/0.22% (ratio: 391->176400)
Selected audio codec: [ffaac] afm: ffmpeg (FFmpeg AAC (MPEG-2/MPEG-4 Audio))
==========================================================================
videocodec: framecopy (1280x720 24bpp fourcc=34363248)
videocodec: framecopy (1280x720 24bpp fourcc=34363248)
All video files must have identical fps, resolution, and codec for -ovc copy.
Exiting...
Hell of a headache because all of the little mp4s are produced with the same ffmpeg mp4 encoding command that ensures they have the same resolution, fps and x264. I even force them to the same pix_fmt so i'm not sure what mencoder is blabbing at here. Do i need to make sure even kb/s is the same? Probably by using CRF?
Can any of you that have successfully done this give me a pointer?
Thanks in advance.