Welcome to Doom9's Forum, THE in-place to be for everyone interested in DVD conversion.

Before you start posting please read the forum rules. By posting to this forum you agree to abide by the rules.

 

Go Back   Doom9's Forum > Video Encoding > MPEG-4 AVC / H.264

Reply
 
Thread Tools Search this Thread Display Modes
Old 21st January 2013, 17:28   #1  |  Link
link626
Registered User
 
Join Date: Mar 2009
Posts: 14
Concatenate h264 stream from different sources? keeps joining as 2 different tracks

I'm trying to join two h264 video streams into one mp4 with one track.
But mp4box keeps outputting an mp4 file containing two separate tracks.
If I try to force it into one track with avidemux, the 2nd part of the video stream is corrupt.

Both video streams have the same resolution.

Mp4box info of the two h264 files-

Code:
-info 1111.mp4
* Movie Info *
        Timescale 600 - Duration 00:00:09.008
        Fragmented File no - 1 track(s)
        File Brand isom - version 1
        Created: GMT Mon Jan 21 11:46:47 2013

File has root IOD
Scene PL 0xff - Graphics PL 0xff - OD PL 0xff
Visual PL: AVC/H264 Profile (0x15)
Audio PL: No audio capability required (0xff)
No streams included in root OD

Track # 1 Info - TrackID 1 - TimeScale 30000 - Duration 00:00:09.009
Media Info: Language "Undetermined" - Type "vide:avc1" - 270 samples
Visual Track layout: x=0 y=0 width=704 height=386
MPEG-4 Config: Visual Stream - ObjectTypeIndication 0x21
AVC/H264 Video - Visual Size 704 x 386
        AVC Info: 1 SPS - 1 PPS - Profile High @ Level 3
        NAL Unit length bits: 32
        Pixel Aspect Ratio 1:1 - Indicated track size 704 x 386
Self-synchronized
Code:
-info 4444.mp4
* Movie Info *
        Timescale 600 - Duration 00:03:50.230
        Fragmented File no - 1 track(s)
        File Brand isom - version 1
        Created: GMT Mon Jan 21 11:29:47 2013

File has root IOD
Scene PL 0xff - Graphics PL 0xff - OD PL 0xff
Visual PL: AVC/H264 Profile (0x15)
Audio PL: No audio capability required (0xff)
No streams included in root OD

Track # 1 Info - TrackID 1 - TimeScale 11988 - Duration 00:03:50.230
Media Info: Language "Undetermined" - Type "vide:avc1" - 6900 samples
Visual Track layout: x=0 y=0 width=704 height=386
MPEG-4 Config: Visual Stream - ObjectTypeIndication 0x21
AVC/H264 Video - Visual Size 704 x 386
        AVC Info: 1 SPS - 1 PPS - Profile High @ Level 3.1
        NAL Unit length bits: 32
        Pixel Aspect Ratio 1:1 - Indicated track size 704 x 386
Self-synchronized

Anyone know why I can't join these two files into one stream in an mp4 container?

I'm trying to do the same thing I've done with xvid, where you can join 2 different video sources as long as resolution is the same.
link626 is offline   Reply With Quote
Old 21st January 2013, 17:42   #2  |  Link
poisondeathray
Registered User
 
Join Date: Sep 2007
Posts: 5,346
High@Level3.0 vs. High@Level3.1 . Even if it's just a "label", usually everything has to match for the highest probability to append streams successfully

You might be able to patch one to match the other using H264 Level Editor, or this ffmpeg patched build , then join . But if there are other differences in the streams, you might have problems anyways
http://forum.doom9.org/showthread.php?t=152419
http://www.videohelp.com/tools/H264-AVC-Level-Editor

Another approach would be to re-encode the 1st one using the same settings as the 2nd, then try appending
poisondeathray is offline   Reply With Quote
Old 21st January 2013, 22:15   #3  |  Link
link626
Registered User
 
Join Date: Mar 2009
Posts: 14
modified the profile level of 1111.mp4 to 3.1, forced cat, and error message and video still corrupt....

Code:
D:\>MP4Box.exe -force-cat -cat 1111.h264 -cat 4444.h264 testing.mp4
AVC-H264 import - frame size 704 x 386 at 29.970 FPS
AVC Import results: 270 samples - Slices: 2 I 266 P 2 B - 1 SEI - 2 IDR
Appending file 1111.h264
No suitable destination track found - creating new one (type vide)
AVC-H264 import - frame size 704 x 386 at 29.970 FPS
AVC Import results: 6900 samples - Slices: 23 I 1868 P 5009 B - 0 SEI - 23 IDR
Stream uses forward prediction - stream CTS offset: 2 frames
Appending file 4444.h264
WARNING: Concatenating track ID 1 even though sample descriptions do not match
Saving to testing.mp4: 0.500 secs Interleaving
Anything else need to match up?
link626 is offline   Reply With Quote
Old 21st January 2013, 22:19   #4  |  Link
Guest
Guest
 
Join Date: Jan 2002
Posts: 21,901
Quote:
Originally Posted by link626 View Post
Anything else need to match up?
Yes, the SPS's and PPS's must match.
Guest is offline   Reply With Quote
Old 22nd January 2013, 10:35   #5  |  Link
link626
Registered User
 
Join Date: Mar 2009
Posts: 14
Got it to work finally after lots of trial and error and tons of remuxing.

Used x264gui to reencode the 9 second intro to match the profile settings of the 4444.mp4,
then used mp4box to extract h264 raw streams,
-concat'd the two h264 streams to mp4,
extract the h264 again from the concat'd file,
then remuxed to final output file.
link626 is offline   Reply With Quote
Reply

Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump


All times are GMT +1. The time now is 23:24.


Powered by vBulletin® Version 3.8.11
Copyright ©2000 - 2024, vBulletin Solutions Inc.