Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

MP4Box does not concatenate videos #549

Closed
mensurdurakovic opened this issue Jun 10, 2016 · 47 comments
Closed

MP4Box does not concatenate videos #549

mensurdurakovic opened this issue Jun 10, 2016 · 47 comments

Comments

@mensurdurakovic
Copy link

Hi! I have problem with MP4Box, can't concatenate videos in one video. I get out.mp4 file (~103 MB) but omxplayer can not play it. I have 6 very simple .mp4 videos and I want them to merge in one video. Until now, I was able to do that with command, without any problems:

MP4Box -cat Awards\ -\ Recognitions\ Screens\ Video.mp4 -cat Cornaro\ USLUGE\ video1.mp4 -cat Cornaro\ USLUGE\ video1.mp4 -cat DIOCLETIANS_BREAKFAST.mp4 -cat FLAVOURS_OF_DALMATIA.mp4 -cat Prognoza.mp4 -cat Restaurants\ -\ Bars\ 2016.mp4 -cat WineHappyHour3.mp4 -new out.mp4

but now omxplayer (also vlc) can not play out.mp4 video. Here is mediainfo output for every one of 6 videos:

General
Complete name                            : Awards - Recognitions Screens Video.mp4
Format                                   : MPEG-4
Format profile                           : Base Media
Codec ID                                 : isom
File size                                : 16.8 MiB
Duration                                 : 45s 379ms
Overall bit rate                         : 3 114 Kbps
Writing application                      : Lavf55.33.101

Video
ID                                       : 1
Format                                   : AVC
Format/Info                              : Advanced Video Codec
Format profile                           : Main@L5.1
Format settings, CABAC                   : Yes
Format settings, ReFrames                : 3 frames
Codec ID                                 : avc1
Codec ID/Info                            : Advanced Video Coding
Duration                                 : 45s 379ms
Bit rate                                 : 3 000 Kbps
Width                                    : 1 920 pixels
Height                                   : 1 080 pixels
Display aspect ratio                     : 16:9
Frame rate mode                          : Constant
Frame rate                               : 29.970 fps
Color space                              : YUV
Chroma subsampling                       : 4:2:0
Bit depth                                : 8 bits
Scan type                                : Progressive
Bits/(Pixel*Frame)                       : 0.048
Stream size                              : 16.8 MiB (100%)
Writing library                          : x264 core 142 r2389 956c8d8
Encoding settings                        : cabac=1 / ref=1 / deblock=1:0:0 / analyse=0x1:0 / me=dia / subme=2 / psy=1 / psy_rd=1.00:0.00 / mixed_ref=0 / me_range=16 / chroma_me=1 / trellis=0 / 8x8dct=0 / cqm=0 / deadzone=21,11 / fast_pskip=1 / chroma_qp_offset=0 / threads=6 / lookahead_threads=2 / sliced_threads=0 / nr=0 / decimate=1 / interlaced=0 / bluray_compat=0 / constrained_intra=0 / bframes=3 / b_pyramid=1 / b_adapt=1 / b_bias=0 / direct=1 / weightb=1 / open_gop=0 / weightp=2 / keyint=250 / keyint_min=25 / scenecut=40 / intra_refresh=0 / rc_lookahead=40 / rc=abr / mbtree=1 / bitrate=3000 / ratetol=1.0 / qcomp=0.60 / qpmin=0 / qpmax=69 / qpstep=4 / ip_ratio=1.40 / aq=1:1.00
Language                                 : English

General
Complete name                            : Cornaro USLUGE video1.mp4
Format                                   : MPEG-4
Format profile                           : Base Media
Codec ID                                 : isom
File size                                : 22.8 MiB
Duration                                 : 1mn 13s
Overall bit rate                         : 2 624 Kbps
Writing application                      : Lavf55.33.101

Video
ID                                       : 1
Format                                   : AVC
Format/Info                              : Advanced Video Codec
Format profile                           : Main@L5.1
Format settings, CABAC                   : Yes
Format settings, ReFrames                : 3 frames
Codec ID                                 : avc1
Codec ID/Info                            : Advanced Video Coding
Duration                                 : 1mn 13s
Bit rate                                 : 2 621 Kbps
Nominal bit rate                         : 3 000 Kbps
Width                                    : 1 920 pixels
Height                                   : 1 080 pixels
Display aspect ratio                     : 16:9
Frame rate mode                          : Constant
Frame rate                               : 29.970 fps
Color space                              : YUV
Chroma subsampling                       : 4:2:0
Bit depth                                : 8 bits
Scan type                                : Progressive
Bits/(Pixel*Frame)                       : 0.042
Stream size                              : 22.8 MiB (100%)
Writing library                          : x264 core 142 r2389 956c8d8
Encoding settings                        : cabac=1 / ref=1 / deblock=1:0:0 / analyse=0x1:0 / me=dia / subme=2 / psy=1 / psy_rd=1.00:0.00 / mixed_ref=0 / me_range=16 / chroma_me=1 / trellis=0 / 8x8dct=0 / cqm=0 / deadzone=21,11 / fast_pskip=1 / chroma_qp_offset=0 / threads=6 / lookahead_threads=2 / sliced_threads=0 / nr=0 / decimate=1 / interlaced=0 / bluray_compat=0 / constrained_intra=0 / bframes=3 / b_pyramid=1 / b_adapt=1 / b_bias=0 / direct=1 / weightb=1 / open_gop=0 / weightp=2 / keyint=250 / keyint_min=25 / scenecut=40 / intra_refresh=0 / rc_lookahead=40 / rc=abr / mbtree=1 / bitrate=3000 / ratetol=1.0 / qcomp=0.60 / qpmin=0 / qpmax=69 / qpstep=4 / ip_ratio=1.40 / aq=1:1.00
Language                                 : English

General
Complete name                            : DIOCLETIANS_BREAKFAST.mp4
Format                                   : MPEG-4
Format profile                           : Base Media
Codec ID                                 : isom
File size                                : 11.6 MiB
Duration                                 : 33s 0ms
Overall bit rate                         : 2 950 Kbps
Writing application                      : Lavf55.33.101

Video
ID                                       : 1
Format                                   : AVC
Format/Info                              : Advanced Video Codec
Format profile                           : Main@L5.1
Format settings, CABAC                   : Yes
Format settings, ReFrames                : 3 frames
Codec ID                                 : avc1
Codec ID/Info                            : Advanced Video Coding
Duration                                 : 33s 0ms
Bit rate                                 : 3 000 Kbps
Width                                    : 1 920 pixels
Height                                   : 1 080 pixels
Display aspect ratio                     : 16:9
Frame rate mode                          : Constant
Frame rate                               : 29.970 fps
Color space                              : YUV
Chroma subsampling                       : 4:2:0
Bit depth                                : 8 bits
Scan type                                : Progressive
Bits/(Pixel*Frame)                       : 0.048
Stream size                              : 11.6 MiB (100%)
Writing library                          : x264 core 142 r2389 956c8d8
Encoding settings                        : cabac=1 / ref=1 / deblock=1:0:0 / analyse=0x1:0 / me=dia / subme=2 / psy=1 / psy_rd=1.00:0.00 / mixed_ref=0 / me_range=16 / chroma_me=1 / trellis=0 / 8x8dct=0 / cqm=0 / deadzone=21,11 / fast_pskip=1 / chroma_qp_offset=0 / threads=6 / lookahead_threads=2 / sliced_threads=0 / nr=0 / decimate=1 / interlaced=0 / bluray_compat=0 / constrained_intra=0 / bframes=3 / b_pyramid=1 / b_adapt=1 / b_bias=0 / direct=1 / weightb=1 / open_gop=0 / weightp=2 / keyint=250 / keyint_min=25 / scenecut=40 / intra_refresh=0 / rc_lookahead=40 / rc=abr / mbtree=1 / bitrate=3000 / ratetol=1.0 / qcomp=0.60 / qpmin=0 / qpmax=69 / qpstep=4 / ip_ratio=1.40 / aq=1:1.00
Language                                 : English
General
Complete name                            : FLAVOURS_OF_DALMATIA.mp4
Format                                   : MPEG-4
Format profile                           : Base Media
Codec ID                                 : isom
File size                                : 11.4 MiB
Duration                                 : 33s 0ms
Overall bit rate                         : 2 891 Kbps
Writing application                      : Lavf55.33.101

Video
ID                                       : 1
Format                                   : AVC
Format/Info                              : Advanced Video Codec
Format profile                           : Main@L5.1
Format settings, CABAC                   : Yes
Format settings, ReFrames                : 3 frames
Codec ID                                 : avc1
Codec ID/Info                            : Advanced Video Coding
Duration                                 : 33s 0ms
Bit rate                                 : 3 000 Kbps
Width                                    : 1 920 pixels
Height                                   : 1 080 pixels
Display aspect ratio                     : 16:9
Frame rate mode                          : Constant
Frame rate                               : 29.970 fps
Color space                              : YUV
Chroma subsampling                       : 4:2:0
Bit depth                                : 8 bits
Scan type                                : Progressive
Bits/(Pixel*Frame)                       : 0.048
Stream size                              : 11.4 MiB (100%)
Writing library                          : x264 core 142 r2389 956c8d8
Encoding settings                        : cabac=1 / ref=1 / deblock=1:0:0 / analyse=0x1:0 / me=dia / subme=2 / psy=1 / psy_rd=1.00:0.00 / mixed_ref=0 / me_range=16 / chroma_me=1 / trellis=0 / 8x8dct=0 / cqm=0 / deadzone=21,11 / fast_pskip=1 / chroma_qp_offset=0 / threads=6 / lookahead_threads=2 / sliced_threads=0 / nr=0 / decimate=1 / interlaced=0 / bluray_compat=0 / constrained_intra=0 / bframes=3 / b_pyramid=1 / b_adapt=1 / b_bias=0 / direct=1 / weightb=1 / open_gop=0 / weightp=2 / keyint=250 / keyint_min=25 / scenecut=40 / intra_refresh=0 / rc_lookahead=40 / rc=abr / mbtree=1 / bitrate=3000 / ratetol=1.0 / qcomp=0.60 / qpmin=0 / qpmax=69 / qpstep=4 / ip_ratio=1.40 / aq=1:1.00
Language                                 : English
General
Complete name                            : Prognoza.mp4
Format                                   : MPEG-4
Format profile                           : Base Media
Codec ID                                 : isom
File size                                : 3.27 MiB
Duration                                 : 10s 44ms
Overall bit rate                         : 2 733 Kbps
Writing application                      : Lavf55.33.101

Video
ID                                       : 1
Format                                   : AVC
Format/Info                              : Advanced Video Codec
Format profile                           : Main@L5.1
Format settings, CABAC                   : Yes
Format settings, ReFrames                : 3 frames
Codec ID                                 : avc1
Codec ID/Info                            : Advanced Video Coding
Duration                                 : 10s 44ms
Bit rate                                 : 2 730 Kbps
Nominal bit rate                         : 3 000 Kbps
Width                                    : 1 920 pixels
Height                                   : 1 080 pixels
Display aspect ratio                     : 16:9
Frame rate mode                          : Constant
Frame rate                               : 29.970 fps
Color space                              : YUV
Chroma subsampling                       : 4:2:0
Bit depth                                : 8 bits
Scan type                                : Progressive
Bits/(Pixel*Frame)                       : 0.044
Stream size                              : 3.27 MiB (100%)
Writing library                          : x264 core 142 r2389 956c8d8
Encoding settings                        : cabac=1 / ref=1 / deblock=1:0:0 / analyse=0x1:0 / me=dia / subme=2 / psy=1 / psy_rd=1.00:0.00 / mixed_ref=0 / me_range=16 / chroma_me=1 / trellis=0 / 8x8dct=0 / cqm=0 / deadzone=21,11 / fast_pskip=1 / chroma_qp_offset=0 / threads=6 / lookahead_threads=2 / sliced_threads=0 / nr=0 / decimate=1 / interlaced=0 / bluray_compat=0 / constrained_intra=0 / bframes=3 / b_pyramid=1 / b_adapt=1 / b_bias=0 / direct=1 / weightb=1 / open_gop=0 / weightp=2 / keyint=250 / keyint_min=25 / scenecut=40 / intra_refresh=0 / rc_lookahead=40 / rc=abr / mbtree=1 / bitrate=3000 / ratetol=1.0 / qcomp=0.60 / qpmin=0 / qpmax=69 / qpstep=4 / ip_ratio=1.40 / aq=1:1.00
Language                                 : English`
General
Complete name                            : Restaurants - Bars 2016.mp4
Format                                   : MPEG-4
Format profile                           : Base Media
Codec ID                                 : isom
File size                                : 33.4 MiB
Duration                                 : 1mn 35s
Overall bit rate                         : 2 929 Kbps
Writing application                      : Lavf55.33.101

Video
ID                                       : 1
Format                                   : AVC
Format/Info                              : Advanced Video Codec
Format profile                           : Main@L5.1
Format settings, CABAC                   : Yes
Format settings, ReFrames                : 3 frames
Codec ID                                 : avc1
Codec ID/Info                            : Advanced Video Coding
Duration                                 : 1mn 35s
Bit rate                                 : 3 000 Kbps
Width                                    : 1 920 pixels
Height                                   : 1 080 pixels
Display aspect ratio                     : 16:9
Frame rate mode                          : Constant
Frame rate                               : 29.970 fps
Color space                              : YUV
Chroma subsampling                       : 4:2:0
Bit depth                                : 8 bits
Scan type                                : Progressive
Bits/(Pixel*Frame)                       : 0.048
Stream size                              : 33.4 MiB (100%)
Writing library                          : x264 core 142 r2389 956c8d8
Encoding settings                        : cabac=1 / ref=1 / deblock=1:0:0 / analyse=0x1:0 / me=dia / subme=2 / psy=1 / psy_rd=1.00:0.00 / mixed_ref=0 / me_range=16 / chroma_me=1 / trellis=0 / 8x8dct=0 / cqm=0 / deadzone=21,11 / fast_pskip=1 / chroma_qp_offset=0 / threads=6 / lookahead_threads=2 / sliced_threads=0 / nr=0 / decimate=1 / interlaced=0 / bluray_compat=0 / constrained_intra=0 / bframes=3 / b_pyramid=1 / b_adapt=1 / b_bias=0 / direct=1 / weightb=1 / open_gop=0 / weightp=2 / keyint=250 / keyint_min=25 / scenecut=40 / intra_refresh=0 / rc_lookahead=40 / rc=abr / mbtree=1 / bitrate=3000 / ratetol=1.0 / qcomp=0.60 / qpmin=0 / qpmax=69 / qpstep=4 / ip_ratio=1.40 / aq=1:1.00
Language                                 : English
General
Complete name                            : WineHappyHour3.mp4
Format                                   : MPEG-4
Format profile                           : Base Media
Codec ID                                 : isom
File size                                : 4.10 MiB
Duration                                 : 13s 581ms
Overall bit rate                         : 2 533 Kbps
Writing application                      : Lavf55.33.101

Video
ID                                       : 1
Format                                   : AVC
Format/Info                              : Advanced Video Codec
Format profile                           : Main@L5.1
Format settings, CABAC                   : Yes
Format settings, ReFrames                : 3 frames
Codec ID                                 : avc1
Codec ID/Info                            : Advanced Video Coding
Duration                                 : 13s 581ms
Bit rate                                 : 2 530 Kbps
Nominal bit rate                         : 3 000 Kbps
Width                                    : 1 920 pixels
Height                                   : 1 080 pixels
Display aspect ratio                     : 16:9
Frame rate mode                          : Constant
Frame rate                               : 29.970 fps
Color space                              : YUV
Chroma subsampling                       : 4:2:0
Bit depth                                : 8 bits
Scan type                                : Progressive
Bits/(Pixel*Frame)                       : 0.041
Stream size                              : 4.10 MiB (100%)
Writing library                          : x264 core 142 r2389 956c8d8
Encoding settings                        : cabac=1 / ref=1 / deblock=1:0:0 / analyse=0x1:0 / me=dia / subme=2 / psy=1 / psy_rd=1.00:0.00 / mixed_ref=0 / me_range=16 / chroma_me=1 / trellis=0 / 8x8dct=0 / cqm=0 / deadzone=21,11 / fast_pskip=1 / chroma_qp_offset=0 / threads=6 / lookahead_threads=2 / sliced_threads=0 / nr=0 / decimate=1 / interlaced=0 / bluray_compat=0 / constrained_intra=0 / bframes=3 / b_pyramid=1 / b_adapt=1 / b_bias=0 / direct=1 / weightb=1 / open_gop=0 / weightp=2 / keyint=250 / keyint_min=25 / scenecut=40 / intra_refresh=0 / rc_lookahead=40 / rc=abr / mbtree=1 / bitrate=3000 / ratetol=1.0 / qcomp=0.60 / qpmin=0 / qpmax=69 / qpstep=4 / ip_ratio=1.40 / aq=1:1.00
Language                                 : English

So all 6 videos have good mediainfo output but anways I tried executing command to test without 1 video (one by one), and then merging them, but same result. I get strange command line output when I execute mp4box command:

Appending file Awards - Recognitions Screens Video.mp4
No suitable destination track found - creating new one (type vide)
Appending file Cornaro USLUGE video1.mp4         
Appending file Cornaro USLUGE video1.mp4         
No suitable destination track found - creating new one (type vide)
Appending file DIOCLETIANS_BREAKFAST.mp4         
Appending file FLAVOURS_OF_DALMATIA.mp4          
Appending file Prognoza.mp4                      
Appending file Restaurants - Bars 2016.mp4       
No suitable destination track found - creating new one (type vide)
Appending file WineHappyHour3.mp4                
Saving out.mp4: 0.500 secs Interleaving  

Here is mediainfo for out.mp4 video:

General
Complete name                            : out.mp4
Format                                   : MPEG-4
Format profile                           : Base Media
Codec ID                                 : isom
File size                                : 126 MiB
Duration                                 : 4mn 50s
Overall bit rate                         : 3 651 Kbps
Encoded date                             : UTC 2016-06-10 15:32:13
Tagged date                              : UTC 2016-06-10 15:32:13

Video #1
ID                                       : 1
Format                                   : avc3
Codec ID                                 : avc3
Duration                                 : 1mn 58s
Bit rate                                 : 2 809 Kbps
Width                                    : 1 920 pixels
Height                                   : 1 080 pixels
Display aspect ratio                     : 16:9
Frame rate mode                          : Constant
Frame rate                               : 29.970 fps
Bits/(Pixel*Frame)                       : 0.045
Stream size                              : 39.6 MiB (31%)
Language                                 : English
Tagged date                              : UTC 2016-06-10 15:32:15

Video #2
ID                                       : 2
Format                                   : AVC
Format/Info                              : Advanced Video Codec
Format profile                           : Main@L5.1
Format settings, CABAC                   : Yes
Format settings, ReFrames                : 3 frames
Codec ID                                 : avc1
Codec ID/Info                            : Advanced Video Coding
Duration                                 : 4mn 41s
Source duration                          : 3mn 28s
Bit rate                                 : 2 143 Kbps
Nominal bit rate                         : 3 000 Kbps
Width                                    : 1 920 pixels
Height                                   : 1 080 pixels
Display aspect ratio                     : 16:9
Frame rate mode                          : Variable
Frame rate                               : 23.432 fps
Minimum frame rate                       : 0.022 fps
Maximum frame rate                       : 29.970 fps
Color space                              : YUV
Chroma subsampling                       : 4:2:0
Bit depth                                : 8 bits
Scan type                                : Progressive
Bits/(Pixel*Frame)                       : 0.044
Stream size                              : 53.1 MiB (42%)
Source stream size                       : 53.1 MiB (42%)
Writing library                          : x264 core 142 r2389 956c8d8
Encoding settings                        : cabac=1 / ref=1 / deblock=1:0:0 / analyse=0x1:0 / me=dia / subme=2 / psy=1 / psy_rd=1.00:0.00 / mixed_ref=0 / me_range=16 / chroma_me=1 / trellis=0 / 8x8dct=0 / cqm=0 / deadzone=21,11 / fast_pskip=1 / chroma_qp_offset=0 / threads=6 / lookahead_threads=2 / sliced_threads=0 / nr=0 / decimate=1 / interlaced=0 / bluray_compat=0 / constrained_intra=0 / bframes=3 / b_pyramid=1 / b_adapt=1 / b_bias=0 / direct=1 / weightb=1 / open_gop=0 / weightp=2 / keyint=250 / keyint_min=25 / scenecut=40 / intra_refresh=0 / rc_lookahead=40 / rc=abr / mbtree=1 / bitrate=3000 / ratetol=1.0 / qcomp=0.60 / qpmin=0 / qpmax=69 / qpstep=4 / ip_ratio=1.40 / aq=1:1.00
Language                                 : English
Tagged date                              : UTC 2016-06-10 15:32:15

Video #3
ID                                       : 3
Format                                   : AVC
Format/Info                              : Advanced Video Codec
Format profile                           : Main@L5.1
Format settings, CABAC                   : Yes
Format settings, ReFrames                : 3 frames
Codec ID                                 : avc1
Codec ID/Info                            : Advanced Video Coding
Duration                                 : 4mn 50s
Source duration                          : 1mn 35s
Nominal bit rate                         : 3 000 Kbps
Width                                    : 1 920 pixels
Height                                   : 1 080 pixels
Display aspect ratio                     : 16:9
Frame rate mode                          : Constant
Frame rate                               : 29.970 fps
Color space                              : YUV
Chroma subsampling                       : 4:2:0
Bit depth                                : 8 bits
Scan type                                : Progressive
Bits/(Pixel*Frame)                       : 0.048
Source stream size                       : 33.4 MiB (26%)
Writing library                          : x264 core 142 r2389 956c8d8
Encoding settings                        : cabac=1 / ref=1 / deblock=1:0:0 / analyse=0x1:0 / me=dia / subme=2 / psy=1 / psy_rd=1.00:0.00 / mixed_ref=0 / me_range=16 / chroma_me=1 / trellis=0 / 8x8dct=0 / cqm=0 / deadzone=21,11 / fast_pskip=1 / chroma_qp_offset=0 / threads=6 / lookahead_threads=2 / sliced_threads=0 / nr=0 / decimate=1 / interlaced=0 / bluray_compat=0 / constrained_intra=0 / bframes=3 / b_pyramid=1 / b_adapt=1 / b_bias=0 / direct=1 / weightb=1 / open_gop=0 / weightp=2 / keyint=250 / keyint_min=25 / scenecut=40 / intra_refresh=0 / rc_lookahead=40 / rc=abr / mbtree=1 / bitrate=3000 / ratetol=1.0 / qcomp=0.60 / qpmin=0 / qpmax=69 / qpstep=4 / ip_ratio=1.40 / aq=1:1.00
Language                                 : English
Tagged date                              : UTC 2016-06-10 15:32:15

As you can notice there are exactly "#" videos parts as "No suitable destination track found..." lines, which is strange. So far closest thing for fixing my problem is this command:

MP4Box -force-cat -add Awards\ -\ Recognitions\ Screens\ Video.mp4 -cat Cornaro\ USLUGE\ video1.mp4 -cat Cornaro\ USLUGE\ video1.mp4 -cat DIOCLETIANS_BREAKFAST.mp4 -cat FLAVOURS_OF_DALMATIA.mp4 -cat Prognoza.mp4 -cat Restaurants\ -\ Bars\ 2016.mp4 -cat WineHappyHour3.mp4 out.mp4 

but it is showing second video (Cornaro USLUGE video1.mp4) two times in row and then rest is normal. I am really out of idea what to do. Any help will be appreciated.

@rbouqueau
Copy link
Member

Hi, thanks for reporting. Would it be possible to share your input MP4s with us so that we reproduce your issue? https://www.mediafire.com/filedrop/filedrop_hosted.php?drop=eec9e058a9486fe4e99c33021481d9e1826ca9dbc242a6cfaab0fe95da5e5d95

@mensurdurakovic
Copy link
Author

Thank you, here is zip file with videos: http://www.mediafire.com/download/aulvr1lpv6bu1o8/videos.zip

@rbouqueau
Copy link
Member

Files are not encoded the same by FFmpeg: sometimes the Aspect Ratio is set, sometimes not:

rbouqueau@rbouqueau-PC MSYS /d/Works/gpac/issues/549_cat
$ MP4Box -info Awards\ -\ Recognitions\ Screens\ Video.mp4
* Movie Info *
        Timescale 1000 - 1 track
        Computed Duration 00:00:45.379 - Indicated Duration 00:00:45.379
        Fragmented File: no
        File Brand isom - version 512
        Created: UNKNOWN DATE   Modified: UNKNOWN DATE
File has no MPEG4 IOD/OD

iTunes Info:
        Encoder Software: Lavf55.33.101
1 UDTA types: meta (1)

Track # 1 Info - TrackID 1 - TimeScale 11988
Media Duration 00:00:45.378 - Indicated Duration 00:00:45.378
Track has 1 edit lists: track duration is 00:00:45.379
Media Info: Language "English (eng)" - Type "vide:avc1" - 1360 samples
Visual Track layout: x=0 y=0 width=1920 height=1080
MPEG-4 Config: Visual Stream - ObjectTypeIndication 0x21
AVC/H264 Video - Visual Size 1920 x 1080
        AVC Info: 1 SPS - 1 PPS - Profile Main @ Level 5.1
        NAL Unit length bits: 32
        SPS#1 hash: 2FFFF5E96B1EDBCE7268D1B4011C54E1F82128B9
        PPS#1 hash: 60F1B6D03586F4AE6706E664422C564AED9C9704
Self-synchronized
        RFC6381 Codec Parameters: avc1.4d4033
        Average GOP length: 226 samples


rbouqueau@rbouqueau-PC MSYS /d/Works/gpac/issues/549_cat
$ MP4Box -info Cornaro\ USLUGE\ video1.mp4
* Movie Info *
        Timescale 1000 - 1 track
        Computed Duration 00:01:13.007 - Indicated Duration 00:01:13.007
        Fragmented File: no
        File Brand isom - version 512
        Created: UNKNOWN DATE   Modified: UNKNOWN DATE
File has no MPEG4 IOD/OD

iTunes Info:
        Encoder Software: Lavf55.33.101
1 UDTA types: meta (1)

Track # 1 Info - TrackID 1 - TimeScale 11988
Media Duration 00:01:13.006 - Indicated Duration 00:01:13.006
Track has 1 edit lists: track duration is 00:01:13.007
Media Info: Language "English (eng)" - Type "vide:avc1" - 2188 samples
Visual Track layout: x=0 y=0 width=1920 height=1080
MPEG-4 Config: Visual Stream - ObjectTypeIndication 0x21
AVC/H264 Video - Visual Size 1920 x 1080
        AVC Info: 1 SPS - 1 PPS - Profile Main @ Level 5.1
        NAL Unit length bits: 32
        Pixel Aspect Ratio 1:1 - Indicated track size 1920 x 1080
        SPS#1 hash: 676540C805C4FF5CE47B3ACF57C0A11F8C62A1E5
        PPS#1 hash: 60F1B6D03586F4AE6706E664422C564AED9C9704
Self-synchronized
        RFC6381 Codec Parameters: avc1.4d4033
        Average GOP length: 198 samples

I remember having already seen this issue, let me check.

@rbouqueau
Copy link
Member

Duplicate of #13 and #235.

Do you have any guess on this? Any FFmpeg command-line or source file prior to the MP4 generation?

@mensurdurakovic
Copy link
Author

mensurdurakovic commented Jun 10, 2016

No longer working, I will check tommorow and post updates. Thanks for helping

@mensurdurakovic
Copy link
Author

We have PHP script that is converting videos with help of ffmpeg. Command is here:

ffmpeg.exe -r 29.97 -vcodec libx264 -pass 1 -refs 1 -b-pyramid 1 -b:v 10M -vf scale=1920x1080 -sws_flags lanczos -profile:v main -level 51 -an -y output.mp4 -i pht-1.mp4
��������������������������������������������������������������������������������������������������������������������������������������������������������������������������������
I have tried to change line to this:

ffmpeg.exe -r 29.97 -vcodec libx264 -pass 1 -refs 1 -b-pyramid 1 -b:v 10M -vf scale=1920x1080,setdar=16:9 -sws_flags lanczos -profile:v main -level 51 -an -y output.mp4 -i pht-1.mp4

and this:

ffmpeg.exe -r 29.97 -vcodec libx264 -pass 1 -refs 1 -b-pyramid 1 -b:v 10M -vf scale=1920x1080,setsar=1:1 -sws_flags lanczos -profile:v main -level 51 -an -y output.mp4 -i pht-1.mp4

and tried to add constant rate factor:

ffmpeg.exe -r 29.97 -vcodec libx264 -pass 1 -refs 1 -b-pyramid 1 -b:v 10M -vf scale=1920x1080,setdar=16:9 -cfr 20 -sws_flags lanczos -profile:v main -level 51 -an -y output.mp4 -i pht-1.mp4

but still same result, after execution Awards video still does not have Pixel Aspect Ratio info. Any ideas ?

@rbouqueau
Copy link
Member

I think the information is forwarded by FFmpeg i.e. it would come from the source input. Would you be able to share two of these files with me?

@mensurdurakovic
Copy link
Author

I really don't understand, you mean input and output .mp4 files ?

@rbouqueau
Copy link
Member

Yes, I mean the input of the FFmpeg compression command-line.

@mensurdurakovic
Copy link
Author

Here are all files: http://www.mediafire.com/download/6q22s4gke1c4rjo/ffmpeg_data.zip

I tried to get info from Input.mp4, but that video also does not have par info.

@rbouqueau
Copy link
Member

Your command-line contains -vf scale="1920x1080,setsar=1:1". If I remove ,setsar=1:1, the PAR info is removed from the SPS.

So either you have to force it or remove the options on all the encodings.

Does it solve your issue?

@mensurdurakovic
Copy link
Author

mensurdurakovic commented Jun 11, 2016

I just want to get full HD (1920x1080, 16:9) .mp4 videos from input .mp4 videos (that I can merge with MP4Box later), nothing else. Honestly I am not familiar with ffmpeg as we used this php script for long time and now we have problems (not sure what params and encodings we need as I didn't write script). Can you give me example of command line for both cases so I can try it and update you?

@rbouqueau
Copy link
Member

I don't have the information to do this. You need to find a source using the same command-line as you provided that doesn't contain the PAR in the SPS after encoding.

@mensurdurakovic
Copy link
Author

OK, I will try. Thank you!

@rbouqueau
Copy link
Member

Note that in this case you could just use -force-cat, but don't mix -add and -cat in your command-line (or look for + in the help if you really need to do so).

@mensurdurakovic
Copy link
Author

I will try today with only -force-cat params to merge videos and update you with situation...

@mensurdurakovic
Copy link
Author

Changed command and can confirm this works like charm (even if video is missing PAR param info):

MP4Box -force-cat -cat Awards\ -\ Recognitions\ Screens\ Video.mp4 -cat Cornaro\ USLUGE\ video1.mp4 -cat Cornaro\ USLUGE\ video1.mp4 -cat DIOCLETIANS_BREAKFAST.mp4 -cat FLAVOURS_OF_DALMATIA.mp4 -cat Prognoza.mp4 -cat Restaurants\ -\ Bars\ 2016.mp4 -cat WineHappyHour3.mp4 output.mp4

@rbouqueau
Copy link
Member

Excellent :)
Please close the current issue if ok for you.

PS: could you report this on the stackoverflow thread too?

@mensurdurakovic
Copy link
Author

Ofcourse, thank you for help! If you ever come to Split, Croatia, email me and you have free beer! :)

@ShanthiniMichael
Copy link

Hi @rbouqueau,

I am using MP4Box to concatenate my two videos. After concatenation, I cannot play the second part, the first part working fine. Kindly help me to solve this. I have used -force-cat also but no luck.

MP4Box -force-cat -cat video1.mp4 -cat video2.mp4 final_video.mp4

Thanks in advance.

@rbouqueau
Copy link
Member

@ShanthiniMichael Can you share a sample so that we can reproduce?

@ShanthiniMichael
Copy link

@rbouqueau Sorry, I can't share those files. But I can share the info of the files. Is it enough. or is it required to find an issue?

First video info

Movie Info - 2 tracks - TimeScale 1000

Duration 00:00:00.915 (recomputed 00:00:00.914)
Fragmented: no
Major Brand isom - version 512 - compatible brands: isom iso2 avc1 mp41
Created: UNKNOWN DATE

Meta-Data Tags:
tool: Lavf60.16.100

Track 1 Info - ID 1 - TimeScale 30000

Media Duration 00:00:00.800 (recomputed 00:00:00.834)
Track has 1 edits: track duration is 00:00:00.801
Track flags: Enabled In Movie
Media Samples: 24
Visual Track layout: x=0 y=0 width=1920 height=1080
Media Type: vide:avc1
Visual Sample Entry Info: width=1920 height=1080 (depth=24 bits)
AVC/H264 Video - Visual Size 1920 x 1080
AVC Info: 1 SPS - 1 PPS - Profile High @ Level 4
NAL Unit length bits: 32
Chroma format YUV 4:2:0 - Luma bit depth 8 - chroma bit depth 8
SPS#1 hash: 73DDB6AA83D48FE12263E34E8F292891088B9636
PPS#1 hash: B9F27D9ECFC297B5E200E7C763C3772BB312EB51
RFC6381 Codec Parameters: avc1.640028
Only one sync sample
Max sample duration: 1001 / 30000

Track 2 Info - ID 2 - TimeScale 44100

Media Duration 00:00:00.937
Track has 1 edits: track duration is 00:00:00.914
Track flags: Enabled In Movie
Media Samples: 41
Alternate Group ID 1
Media Type: soun:mp4a
MPEG-4 Audio AAC LC (AOT=2 implicit) - 1 Channel(s) - SampleRate 44100
RFC6381 Codec Parameters: mp4a.40.2
All samples are sync
Max sample duration: 1024 / 44100

Second file info

Movie Info - 2 tracks - TimeScale 1000

Duration 00:00:34.468
Fragmented: no
Major Brand isom - version 512 - compatible brands: isom iso2 avc1 mp41
Created: UNKNOWN DATE

Meta-Data Tags:
tool: Lavf60.3.100

Track 1 Info - ID 1 - TimeScale 30000

Media Duration 00:00:34.467 (recomputed 00:00:34.501)
Track has 1 edits: track duration is 00:00:34.468
Track flags: Enabled In Movie
Media Samples: 1033
Visual Track layout: x=0 y=0 width=1920 height=1080
Media Type: vide:avc1
Visual Sample Entry Info: width=1920 height=1080 (depth=24 bits)
AVC/H264 Video - Visual Size 1920 x 1080
AVC Info: 1 SPS - 1 PPS - Profile High @ Level 4
NAL Unit length bits: 32
Chroma format YUV 4:2:0 - Luma bit depth 8 - chroma bit depth 8
SPS#1 hash: 73DDB6AA83D48FE12263E34E8F292891088B9636
PPS#1 hash: 7FA173B58D64544CFE8D0C34CB59E3FB0BA4391A
RFC6381 Codec Parameters: avc1.640028
Average GOP length: 258 samples
Max sample duration: 1001 / 30000

Track 2 Info - ID 2 - TimeScale 48000

Media Duration 00:00:34.485
Track has 1 edits: track duration is 00:00:34.464
Track flags: Enabled In Movie
Media Samples: 1615
Alternate Group ID 1
Media Type: soun:mp4a
MPEG-4 Audio AAC LC (AOT=2 implicit) - 2 Channel(s) - SampleRate 48000
RFC6381 Codec Parameters: mp4a.40.2
All samples are sync
Max sample duration: 2546 / 48000

@rbouqueau
Copy link
Member

There is an apparent diff with the audio ("1 Channel(s)" vs "2 Channel(s)"). Did you try with video only (e.g. by appending #video to your filenames in MP4Box?

FYI we have an anonymous dropbox for sharing files (https://www.mediafire.com/filedrop/filedrop_hosted.php?drop=eec9e058a9486fe4e99c33021481d9e1826ca9dbc242a6cfaab0fe95da5e5d95). Most issues can't be fixed if we can't reproduce.

@jeanlf
Copy link
Member

jeanlf commented Apr 3, 2024

This is likely due to the change of sample rate in the two files. I patched MP4Box to allow this

@ShanthiniMichael
Copy link

@jeanlf Okay. Do I need to reinstall again?

@jeanlf
Copy link
Member

jeanlf commented Apr 3, 2024

yes

@ShanthiniMichael
Copy link

@jeanlf I am using mac. I have reinstalled the MP4box using Brew. but still, I am facing the issue.

@jeanlf
Copy link
Member

jeanlf commented Apr 3, 2024

You need to wait for installers to be updated, or recompile yourself

@ShanthiniMichael
Copy link

@jeanlf I have recompiled the gpac. But still, I am facing the issue.

@rbouqueau
Copy link
Member

It plays here with gpac -play out.mp4or vlc. Which player do you use?

@ShanthiniMichael
Copy link

@rbouqueau I am using QuickTime Player.

@rbouqueau
Copy link
Member

I don't have acces to a mac. I just realize Apple stopped updating QT on Windows at v7 (while they are at v10 now).

@ShanthiniMichael
Copy link

@rbouqueau Okay, I will check with any other players and I will come back.

@ShanthiniMichael
Copy link

ShanthiniMichael commented Apr 4, 2024

@rbouqueau The first part of the audio missing in the VLC player & android mobile and the second part of the audio is missing in the Quicktime player. Can't I use it in any player?

I used this also. gpac -play out.mp4, but the first part is missing.

Is there anything I need to change in the format of the first part?

@rbouqueau
Copy link
Member

With VLC it plays well but I lose the sound when I seek.

Is there anything I need to change in the format of the first part?

Yes, you need to prepare your content so that you don't need the -force-cat option anymore. I think the simplest would be to re-encode the audio e.g. gpac flist:srcs=319155997-c6a99c83-ae19-4373-b186-a339e01925f9.mp4,319156271-7e5fac7f-b6dc-40b9-9422-e67a2f2766cd.mp4 @#audio c=aac @ @1#video -o cat.mp4. It is quite fast.

CC @jeanlf In this case I need to add the explicit @ to avoid the audio out of the flist to be connected directly to the muxer (whereas the flist output pid is already connected to the encoder!).

@ShanthiniMichael
Copy link

@rbouqueau I have tried, but still facing the issue. I have re-encoded the video also.

But it is working fine for only one video.

@rbouqueau
Copy link
Member

What did you try exactly? Can you share some command-lines based on some content I have access too? Which player fails (I can't try QT).

@ShanthiniMichael
Copy link

@rbouqueau Sorry to ask this. Can we connect in meet or anydesk?

@rbouqueau
Copy link
Member

No. This forum is handled by volunteers during their free time.

@ShanthiniMichael
Copy link

@rbouqueau Okay. I have an audio, I am setting that audio to a video using ffmpeg.

ffmpeg -i ${video_first_url} -i ${filename} -c:v copy -map 0:v:0 -map 1:a:0 -shortest ${output_video}

After that I am merging this video into second video using MP4box.

Guide me if i am doing anything wrong.

@rbouqueau
Copy link
Member

This doesn't answer my questions. Based on the content you provided, what did you do with gpac (including the audio encoding command-line I shared with you) and why did you try that failed? Please detail your answer so that we can reproduce to further help you.

@ShanthiniMichael
Copy link

I have tried

gpac flist:srcs=video1.mp4,video2.mp4 @#audio c=aac @ @1#video -o cat.mp4

my second part audio, not coming. only video coming.

@rbouqueau
Copy link
Member

Do you confirm you have the issue with samples you shared above? And which player did you use?

@ShanthiniMichael
Copy link

@rbouqueau Thank you so much for your help. I found the solution. I have changed the sample rate and codec in both videos using the below command, it worked.

ffmpeg -y -i video.mp4 -ar 44100 -acodec aac -ac 2 video-changed.mp4

@rbouqueau
Copy link
Member

Great. If you want to avoid the extra step, gpac can do it for you:

gpac flist:srcs=video1.mp4,video2.mp4 @#audio c=aac @ resample:och=2:osr=44100 @ @@0#video -o cat.mp4

@ShanthiniMichael
Copy link

Okay. I will try this. Thank you :).

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

4 participants