I've two MP4 files. The video tracks of the two MP4 files are the same, while the audio tracks differ for what concerns the language: one is Italian and the other one is English.
However the duration of the two audio tracks is identical, as the duration of the two video tracks.
The two MP4 files contain even the subtitle tracks for every language.
I've tried to multiplex the video track of one of the MP4 files together with the audio and subtitle tracks of the two MP4 files.
So I obtained a new MP4 file with one video track, two audio tracks and two subtitle tracks for every language.
To multiplex the tracks together I used FFmpeg, MP4Box and MP4.tool (a GUI of MP4Box).
Everything worked fine. I checked the timeline of the new MP4 file with TMPGEnc MPEG Smart Renderer, and I found that both the audio tracks are in sync with the video track exactly as they are in the original MP4 files.
More over the duration of the single tracks is still the same.
However the clip duration of the new MP4 file differs from the ones of the original MP4 files.
The new MP4 file results longer than the original ones of about three seconds.
I really can't understand why, given that the video and the audio tracks of the three MP4 files are identical.
I even tried with other couples of files, and the result is the same in most times, even if sometime the duration matches.
When using FFmpeg I tried to use the "shortest" option to make the clip duration match the shortest track, but FFmpeg didn't recognize the "shortest" option.
Does anyone have any idea about what could be the problem? Thanks.
Try StreamFab Downloader and download from Netflix, Amazon, Youtube! Or Try DVDFab and copy Blu-rays! or rip iTunes movies!
+ Reply to Thread
Results 1 to 9 of 9
Thread
-
-
Check the very last subtitle. Sometimes it's duration can cause it to extend past the end of the video, or it may not begin until after the video has ended, either of which might change the over-all length reported by media players etc. It probably wouldn't hurt to check any chapter files being muxed too.
Failing that, I'd start with an MP4 of just the video, then another with video and a single audio stream, then with a second audio stream etc. Maybe that'll help you work out which stream is the culprit, but it's probably the subtitles.....Avisynth functions Resize8 Mod - Audio Speed/Meter/Wave - FixBlend.zip - Position.zip
Avisynth/VapourSynth functions CropResize - FrostyBorders - CPreview (Cropping Preview) -
To multiplex the streams now I'm using the latest version of MP4Box with the following commandline:
Code:mp4box.exe -add "D:\InputFile1.mp4"#1:name="":fps=25.000 -add "D:\InputFile1.mp4"#2:lang=ita:name="" -add "D:\InputFile2.mp4"#2:lang=eng:name="" -add "D:\InputFile2.mp4"#4:lang=ita:name="Italian" -add "D:\InputFile2.mp4"#3:lang=eng:name="English (assistive)" -new "D:\OutputFile.mp4"
Code:General Complete name : D:\InputFile1.mp4 Format : MPEG-4 Format profile : Base Media / Version 2 Codec ID : mp42 (mp42/iso6) File size : 305 MiB Duration : 23 min 6 s Overall bit rate mode : Variable Overall bit rate : 1 845 kb/s Encoded date : UTC 2022-06-16 15:36:41 Tagged date : UTC 2022-06-16 15:36:41 Video ID : 1 Format : AVC Format/Info : Advanced Video Codec Format profile : High@L4 Format settings : CABAC / 4 Ref Frames Format settings, CABAC : Yes Format settings, Reference frames : 4 frames Codec ID : avc1 Codec ID/Info : Advanced Video Coding Duration : 23 min 6 s Bit rate mode : Variable Bit rate : 1 711 kb/s Maximum bit rate : 20.0 Mb/s Width : 1 920 pixels Height : 1 080 pixels Display aspect ratio : 16:9 Frame rate mode : Constant Frame rate : 25.000 FPS Color space : YUV Chroma subsampling : 4:2:0 Bit depth : 8 bits Scan type : Progressive Bits/(Pixel*Frame) : 0.033 Stream size : 283 MiB (93%) Writing library : x264 core 148 r2727 7d026e8 Encoding settings : cabac=1 / ref=4 / deblock=1:0:0 / analyse=0x3:0x111 / me=umh / subme=10 / psy=1 / psy_rd=1.00:0.00 / mixed_ref=1 / me_range=120 / chroma_me=1 / trellis=2 / 8x8dct=1 / cqm=0 / deadzone=21,11 / fast_pskip=1 / chroma_qp_offset=-2 / threads=8 / lookahead_threads=2 / sliced_threads=0 / nr=0 / decimate=1 / interlaced=0 / bluray_compat=0 / stitchable=1 / constrained_intra=0 / bframes=16 / b_pyramid=2 / b_adapt=2 / b_bias=0 / direct=3 / weightb=1 / open_gop=0 / weightp=2 / keyint=250 / keyint_min=126 / scenecut=0 / intra_refresh=0 / rc_lookahead=250 / rc=crf / mbtree=1 / crf=21.0 / qcomp=0.50 / qpmin=6 / qpmax=51 / qpstep=4 / vbv_maxrate=20000 / vbv_bufsize=25000 / crf_max=0.0 / nal_hrd=vbr / filler=0 / ip_ratio=1.40 / aq=1:0.80 Encoded date : UTC 2022-06-16 15:36:41 Tagged date : UTC 2022-06-16 15:36:41 Codec configuration box : avcC Audio ID : 2 Format : E-AC-3 Format/Info : Enhanced AC-3 Commercial name : Dolby Digital Plus Codec ID : ec-3 Duration : 23 min 6 s Bit rate mode : Constant Bit rate : 128 kb/s Channel(s) : 2 channels Channel layout : L R Sampling rate : 48.0 kHz Frame rate : 31.250 FPS (1536 SPF) Compression mode : Lossy Stream size : 21.2 MiB (7%) Language : Italian Service kind : Complete Main Encoded date : UTC 2022-06-16 15:36:41 Tagged date : UTC 2022-06-16 15:36:41 Text ID : 3 Format : Timed Text Muxing mode : sbtl Codec ID : tx3g Duration : 23 min 0 s Bit rate mode : Variable Bit rate : 73 b/s Frame rate : 0.363 FPS Stream size : 12.3 KiB (0%) Title : Italian / Italian Language : Italian Forced : No Encoded date : UTC 2022-06-16 15:36:41 Tagged date : UTC 2022-06-16 15:36:41
Code:General Complete name : D:\InputFile2.mp4 Format : MPEG-4 Format profile : Base Media / Version 2 Codec ID : mp42 (mp42/iso6) File size : 35.6 MiB Duration : 23 min 6 s Overall bit rate mode : Variable Overall bit rate : 215 kb/s Encoded date : UTC 2022-06-16 16:06:18 Tagged date : UTC 2022-06-16 16:06:18 Video ID : 1 Format : AVC Format/Info : Advanced Video Codec Format profile : High@L2.2 Format settings : CABAC / 4 Ref Frames Format settings, CABAC : Yes Format settings, Reference frames : 4 frames Codec ID : avc1 Codec ID/Info : Advanced Video Coding Duration : 23 min 6 s Bit rate mode : Variable Bit rate : 81.3 kb/s Maximum bit rate : 4 000 kb/s Width : 480 pixels Height : 270 pixels Display aspect ratio : 16:9 Frame rate mode : Constant Frame rate : 25.000 FPS Color space : YUV Chroma subsampling : 4:2:0 Bit depth : 8 bits Scan type : Progressive Bits/(Pixel*Frame) : 0.025 Stream size : 13.4 MiB (38%) Writing library : x264 core 148 r2727 7d026e8 Encoding settings : cabac=1 / ref=4 / deblock=1:0:0 / analyse=0x3:0x133 / me=umh / subme=10 / psy=1 / psy_rd=1.00:0.00 / mixed_ref=1 / me_range=120 / chroma_me=1 / trellis=2 / 8x8dct=1 / cqm=0 / deadzone=21,11 / fast_pskip=1 / chroma_qp_offset=-2 / threads=8 / lookahead_threads=2 / sliced_threads=0 / nr=0 / decimate=1 / interlaced=0 / bluray_compat=0 / stitchable=1 / constrained_intra=0 / bframes=16 / b_pyramid=2 / b_adapt=2 / b_bias=0 / direct=3 / weightb=1 / open_gop=0 / weightp=2 / keyint=250 / keyint_min=126 / scenecut=0 / intra_refresh=0 / rc_lookahead=250 / rc=crf / mbtree=1 / crf=38.0 / qcomp=0.50 / qpmin=6 / qpmax=51 / qpstep=4 / vbv_maxrate=4000 / vbv_bufsize=4000 / crf_max=0.0 / nal_hrd=vbr / filler=0 / ip_ratio=1.40 / aq=1:0.80 Encoded date : UTC 2022-06-16 16:06:18 Tagged date : UTC 2022-06-16 16:06:18 Codec configuration box : avcC Audio ID : 2 Format : E-AC-3 Format/Info : Enhanced AC-3 Commercial name : Dolby Digital Plus Codec ID : ec-3 Duration : 23 min 6 s Bit rate mode : Constant Bit rate : 128 kb/s Channel(s) : 2 channels Channel layout : L R Sampling rate : 48.0 kHz Frame rate : 31.250 FPS (1536 SPF) Compression mode : Lossy Stream size : 21.2 MiB (59%) Language : English Service kind : Complete Main Encoded date : UTC 2022-06-16 16:06:18 Tagged date : UTC 2022-06-16 16:06:18 Text #1 ID : 3 Format : Timed Text Muxing mode : sbtl Codec ID : tx3g Duration : 22 min 33 s Bit rate mode : Variable Bit rate : 82 b/s Frame rate : 0.500 FPS Stream size : 13.6 KiB (0%) Title : English (assistive) / English (assistive) Language : English Forced : No Encoded date : UTC 2022-06-16 16:06:18 Tagged date : UTC 2022-06-16 16:06:18 Text #2 ID : 4 Format : Timed Text Muxing mode : sbtl Codec ID : tx3g Duration : 23 min 0 s Bit rate mode : Variable Bit rate : 73 b/s Frame rate : 0.363 FPS Stream size : 12.3 KiB (0%) Title : Italian / Italian Language : Italian Forced : No Encoded date : UTC 2022-06-16 16:06:18 Tagged date : UTC 2022-06-16 16:06:18
Code:General Complete name : D:\OutputFile.mp4 Format : MPEG-4 Format profile : Base Media Codec ID : isom (isom) File size : 325 MiB Duration : 23 min 6 s Overall bit rate mode : Variable Overall bit rate : 1 969 kb/s Encoded date : UTC 2022-11-16 14:45:47 Tagged date : UTC 2022-11-16 14:45:47 Video ID : 1 Format : AVC Format/Info : Advanced Video Codec Format profile : High@L4 Format settings : CABAC / 4 Ref Frames Format settings, CABAC : Yes Format settings, Reference frames : 4 frames Codec ID : avc1 Codec ID/Info : Advanced Video Coding Duration : 23 min 6 s Source duration : 23 min 6 s Bit rate mode : Variable Bit rate : 1 621 kb/s Maximum bit rate : 20.0 Mb/s Width : 1 920 pixels Height : 1 080 pixels Display aspect ratio : 16:9 Frame rate mode : Constant Frame rate : 25.000 FPS Color space : YUV Chroma subsampling : 4:2:0 Bit depth : 8 bits Scan type : Progressive Bits/(Pixel*Frame) : 0.031 Stream size : 268 MiB (82%) Source stream size : 283 MiB (87%) Writing library : x264 core 148 r2727 7d026e8 Encoding settings : cabac=1 / ref=4 / deblock=1:0:0 / analyse=0x3:0x111 / me=umh / subme=10 / psy=1 / psy_rd=1.00:0.00 / mixed_ref=1 / me_range=120 / chroma_me=1 / trellis=2 / 8x8dct=1 / cqm=0 / deadzone=21,11 / fast_pskip=1 / chroma_qp_offset=-2 / threads=8 / lookahead_threads=2 / sliced_threads=0 / nr=0 / decimate=1 / interlaced=0 / bluray_compat=0 / stitchable=1 / constrained_intra=0 / bframes=16 / b_pyramid=2 / b_adapt=2 / b_bias=0 / direct=3 / weightb=1 / open_gop=0 / weightp=2 / keyint=250 / keyint_min=126 / scenecut=0 / intra_refresh=0 / rc_lookahead=250 / rc=crf / mbtree=1 / crf=21.0 / qcomp=0.50 / qpmin=6 / qpmax=51 / qpstep=4 / vbv_maxrate=20000 / vbv_bufsize=25000 / crf_max=0.0 / nal_hrd=vbr / filler=0 / ip_ratio=1.40 / aq=1:0.80 Encoded date : UTC 2022-06-16 15:36:41 Tagged date : UTC 2022-11-16 14:46:00 mdhd_Duration : 1386160 Codec configuration box : avcC Audio #1 ID : 2 Format : E-AC-3 Format/Info : Enhanced AC-3 Commercial name : Dolby Digital Plus Codec ID : ec-3 Duration : 23 min 6 s Bit rate mode : Constant Bit rate : 128 kb/s Maximum bit rate : 135 kb/s Channel(s) : 2 channels Channel layout : L R Sampling rate : 48.0 kHz Frame rate : 31.250 FPS (1536 SPF) Compression mode : Lossy Stream size : 21.2 MiB (6%) Language : Italian Service kind : Complete Main Encoded date : UTC 2022-06-16 15:36:41 Tagged date : UTC 2022-11-16 14:46:00 Audio #2 ID : 3 Format : E-AC-3 Format/Info : Enhanced AC-3 Commercial name : Dolby Digital Plus Codec ID : ec-3 Duration : 23 min 6 s Bit rate mode : Constant Bit rate : 128 kb/s Maximum bit rate : 135 kb/s Channel(s) : 2 channels Channel layout : L R Sampling rate : 48.0 kHz Frame rate : 31.250 FPS (1536 SPF) Compression mode : Lossy Stream size : 21.2 MiB (6%) Language : English Service kind : Complete Main Encoded date : UTC 2022-06-16 16:06:18 Tagged date : UTC 2022-11-16 14:46:00 Text #1 ID : 4 Format : Timed Text Muxing mode : sbtl Codec ID : tx3g Duration : 23 min 0 s Bit rate mode : Variable Bit rate : 73 b/s Frame rate : 0.363 FPS Stream size : 12.3 KiB (0%) Title : Italian / Italian Language : Italian Forced : No Encoded date : UTC 2022-06-16 16:06:18 Tagged date : UTC 2022-11-16 14:46:00 Text #2 ID : 5 Format : Timed Text Muxing mode : sbtl Codec ID : tx3g Duration : 22 min 33 s Bit rate mode : Variable Bit rate : 82 b/s Frame rate : 0.500 FPS Stream size : 13.6 KiB (0%) Title : English (assistive) / English (assistive) Language : English Forced : No Encoded date : UTC 2022-06-16 16:06:18 Tagged date : UTC 2022-11-16 14:46:00
In the input files the "General Codec ID" is "mp42 (mp42/iso6)", while in the output file the "General Codec ID" is "isom (isom)".
In the 1st input file the "Video Stream size" is "283 MiB (93%)", while in the output file there are two fields:
- "Video Stream size" that is "268 MiB (82%)"
- "Video Source stream size" that is "283 MiB (87%)", like in the 1st input file.
What does this mean? Has the video somehow been lossless compressed in the output file?
I extracted the video tracks of the 1st input file and of the output file, then I compared them with "Beyond Compare" (binary comparison) and they're identical, and obviously they have the same size. -
I tried to multiplex again the tracks with FFmpeg, and analyzing the resulting MP4 file with MediaInfo, this still shows me two fields:
"Video Stream Size" that is 270 MiB, and "Video Source stream size" that is 283 MiB.
But when I extract the video stream, from the resulting MP4 file to the H.264 elementary stream, this is around 283 MiB.
So I can't understand why MediaInfo gives me two different values.
Please excuse me if my question is too elementary, but I can't find an answer.
Could you help me please? -
@ arturo83.
Elementare. Ti dice che il video sorgente ha 283MB, mentre il video nuovo (recompresso) ha solo 270MB.
Un risultato del tutto normale, visto la recodifica.
Se vuoi eliminare i dati/tags del video sorgente fai un nuovo remux con ffmpeg, senza - map 0 (che riporta tutti i tags del video sorgente), usando solo i maps richiesti.
Oppure, per semplificare, fai un remux con clever Ffmpeg-GUI, invece di mp4box.Last edited by ProWo; 4th Dec 2022 at 07:26.
-
Ti ringrazio per le informazioni.
Tuttavia il video non è stato ricodificato, è stato semplicemente remuxato.
Infatti, una volta estratti, gli elementary streams del video sorgente e del video risultante, risultano identici ad un confronto bit a bit, o tramite checksum.
Inoltre il procedimento di remux è durato solo un paio di minuti, un tempo troppo limitato per una ricodifica totale del video.
Spero di aver capito bene quanto intendevi dire. -
Utilizzando clever FFmpeg-GUI sono riuscito a eliminare il campo "Video Source stream size".
Ora compare solo il campo "Video Stream Size" che indica la dimensione corretta del video, che è 283 MiB.
Però se vado a riprocessare il file risulatante con MP4Box, nonostante l'operazione vada a buon fine, ottengo il seguente errore:
Code:[iso file] Found stts entry with sample_delta=0 - forbidden ! Fixing to 1
Similar Threads
-
Match the duration of images to audios in Sony Vegas
By bosil in forum EditingReplies: 0Last Post: 4th May 2022, 01:10 -
Video Doesn’t Load Into Premiere Pro When Importing Clip. Only Audio Does
By jealousy91 in forum EditingReplies: 4Last Post: 25th Feb 2022, 12:35 -
[Avisynth] Gradually transition from clip A to clip B with a “wipe” effect
By abolibibelot in forum Video ConversionReplies: 6Last Post: 31st Oct 2021, 09:47 -
Interlaced Audio Duration Longer than Video Duration (lip-sync issue)
By senlab in forum Video ConversionReplies: 7Last Post: 27th Aug 2018, 15:36 -
Splice: The number of audio channels doesn't match
By pooksahib in forum EditingReplies: 8Last Post: 5th Jun 2018, 15:27