VideoHelp Forum

+ Reply to Thread
Results 1 to 21 of 21
Thread
  1. Hi all and sorry for my bad english!

    I usually mux video track (from ENG HD source) with audio track (from NON-ENG SD source) only using MKVToolNix, MediaInfo and MPC-HC: after having read the characteristics of the two files with MediaInfo, with MKVToolNix I merge the two tracks by modifying FPS of the HD video with the value of the SD one; then with MPC-HC I evaluate by eye and ear a possible delay between audio and video, and with MKVToolNix I modify the .mkv file created by adding a delay equal to the one just found to the audio track.
    This procedure is quite simple, fast, doesn't require any recoding and I get results that are more than satisfactory to me; although of course that only works as long as the two HD and SD movies share the same version.

    Now however I am dealing with two files with which the above procedure doesn't work.
    I also tried editing the NON-ENG audio track with Audacity: after importing the two audio tracks, I identified two well-defined instants in each of the tracks and from these I obtained the "percent change" relative to the "change tempo" effect so that the NON-ENG audio track was in sync with the ENG one, so I applied the "change tempo" effect with the "percent change" value I just found to the entire NON-ENG track; unfortunately, however, at this point the two tracks are synchronized only in the two instants mentioned above, while as we move away from them the synchrony is lost.
    It seems to me that the two films are characterized by the same version, although of course I'm not 100% sure. The reason I'm not sure the problem is due to different versions is that NON-ENG audio is "interleaved", which I honestly don't know what that means.

    Is it possible that the problem is due to the "interleaved" audio? And if so how can I fix it?


    If it is useful, I report the characteristics of the two files generated with MediaInfo:

    Code:
    General
    Complete name               : ENG_FILM.mp4
    Format                      : MPEG-4
    Format profile              : Base Media
    Codec ID                    : isom (isom/iso2/avc1/mp41)
    File size                   : 1.71 GiB
    Duration                    : 1 h 29 min
    Overall bit rate            : 2 730 kb/s
    Encoded date                : UTC 2018-02-17 23:53:08
    Tagged date                 : UTC 2018-02-17 23:53:08
    Writing application         : Lavf57.83.100
    
    Video
    ID                          : 1
    Format                      : AVC
    Format/Info                 : Advanced Video Codec
    Format profile              : High@L4.1
    Format settings             : CABAC / 4 Ref Frames
    Format settings, CABAC      : Yes
    Format settings, Reference  : 4 frames
    Codec ID                    : avc1
    Codec ID/Info               : Advanced Video Coding
    Duration                    : 1 h 29 min
    Bit rate                    : 2 500 kb/s
    Width                       : 1 920 pixels
    Height                      : 1 080 pixels
    Display aspect ratio        : 16:9
    Frame rate mode             : Constant
    Frame rate                  : 23.976 (23976/1000) FPS
    Color space                 : YUV
    Chroma subsampling          : 4:2:0
    Bit depth                   : 8 bits
    Scan type                   : Progressive
    Bits/(Pixel*Frame)          : 0.050
    Stream size                 : 1.57 GiB (92%)
    Writing library             : x264 core 152 r2851M ba24899
    Encoding settings           : cabac=1 / ref=4 / deblock=1:-1:-1 / analyse=0x3:0x113 / me=umh / subme=9 / psy=1 / psy_rd=1.00:0.15 / mixed_ref=1 / me_range=24 / chroma_me=1 / trellis=2 / 8x8dct=1 / cqm=0 / deadzone=21,11 / fast_pskip=1 / chroma_qp_offset=-3 / threads=32 / lookahead_threads=4 / sliced_threads=0 / nr=0 / decimate=1 / interlaced=0 / bluray_compat=0 / constrained_intra=0 / bframes=3 / b_pyramid=2 / b_adapt=2 / b_bias=0 / direct=3 / weightb=1 / open_gop=0 / weightp=2 / keyint=250 / keyint_min=25 / scenecut=40 / intra_refresh=0 / rc_lookahead=50 / rc=2pass / mbtree=1 / bitrate=2500 / ratetol=1.0 / qcomp=0.60 / qpmin=0 / qpmax=69 / qpstep=4 / cplxblur=20.0 / qblur=0.5 / vbv_maxrate=31250 / vbv_bufsize=31250 / nal_hrd=none / filler=0 / ip_ratio=1.40 / aq=3:1.00
    Encoded date                : UTC 2018-02-17 23:53:08
    Tagged date                 : UTC 2018-02-17 23:53:08
    Codec configuration box     : avcC
    
    Audio
    ID                          : 2
    Format                      : AAC LC
    Format/Info                 : Advanced Audio Codec Low Complexity
    Codec ID                    : mp4a-40-2
    Duration                    : 1 h 29 min
    Bit rate mode               : Constant
    Bit rate                    : 224 kb/s
    Channel(s)                  : 6 channels
    Channel layout              : C L R Ls Rs LFE
    Sampling rate               : 48.0 kHz
    Frame rate                  : 46.875 FPS (1024 SPF)
    Compression mode            : Lossy
    Stream size                 : 144 MiB (8%)
    Language                    : English
    Default                     : Yes
    Alternate group             : 1
    Encoded date                : UTC 2018-02-17 23:53:08
    Tagged date                 : UTC 2018-02-17 23:53:08
    Code:
    General
    Complete name               : NON_ENG_FILM.avi
    Format                      : AVI
    Format/Info                 : Audio Video Interleave
    File size                   : 1.63 GiB
    Duration                    : 1 h 22 min
    Overall bit rate            : 2 823 kb/s
    
    Video
    ID                          : 0
    Format                      : AVC
    Format/Info                 : Advanced Video Codec
    Format profile              : High@L3.1
    Format settings             : CABAC / 2 Ref Frames
    Format settings, CABAC      : Yes
    Format settings, Reference  : 2 frames
    Codec ID                    : H264
    Duration                    : 1 h 22 min
    Bit rate                    : 2 423 kb/s
    Width                       : 1 920 pixels
    Height                      : 1 080 pixels
    Display aspect ratio        : 16:9
    Frame rate                  : 50.000 FPS
    Color space                 : YUV
    Chroma subsampling          : 4:2:0
    Bit depth                   : 8 bits
    Scan type                   : Progressive
    Bits/(Pixel*Frame)          : 0.023
    Stream size                 : 1.40 GiB (86%)
    Writing library             : x264 core 125 r2208 d9d2288
    Encoding settings           : cabac=1 / ref=2 / deblock=0:0:0 / analyse=0x3:0x113 / me=dia / subme=7 / psy=1 / psy_rd=1.00:0.00 / mixed_ref=0 / me_range=16 / chroma_me=0 / trellis=1 / 8x8dct=1 / cqm=0 / deadzone=21,11 / fast_pskip=1 / chroma_qp_offset=-2 / threads=6 / lookahead_threads=1 / sliced_threads=0 / nr=0 / decimate=0 / interlaced=0 / bluray_compat=0 / constrained_intra=0 / bframes=2 / b_pyramid=0 / b_adapt=0 / b_bias=0 / direct=0 / weightb=0 / open_gop=0 / weightp=0 / keyint=500 / keyint_min=100 / scenecut=40 / intra_refresh=0 / rc=crf / mbtree=0 / crf=26.0 / qcomp=0.60 / qpmin=0 / qpmax=69 / qpstep=4 / ip_ratio=1.40 / pb_ratio=1.30 / aq=1:1.00
    
    Audio
    ID                          : 1
    Format                      : AC-3
    Format/Info                 : Audio Coding 3
    Commercial name             : Dolby Digital
    Format settings             : Dolby Surround
    Codec ID                    : 2000
    Duration                    : 1 h 22 min
    Source duration             : 1 h 22 min
    Bit rate mode               : Constant
    Bit rate                    : 384 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                 : 227 MiB (14%)
    Alignment                   : Aligned on interleaves
    Interleave, duration        : 32  ms (1.60 video frames)
    Service kind                : Complete Main
    Last edited by BenBen21; 24th Nov 2022 at 08:04.
    Quote Quote  
  2. Interleaved has no meaning here.
    Upload the AC3 stream of NON_ENG_FILM.avi somewhere.
    Convert the AAC stream from ENG_FILM.mp4 to AC3 Stereo 128kbs and upload the new AC3 stream somewhere too.
    Then post both links here.
    Then we will have a look at it.
    Quote Quote  
  3. Member Ennio's Avatar
    Join Date
    May 2005
    Location
    Netherlands
    Search Comp PM
    At first sight, I suspect video's framerate value 23976/1000. Can't tell if it's flawed container- or videostream framerate. Try to remux with MKVToolNix with setting "Default duration/FPS" to 24000/1001p. Be sure to check the "Fix bitstream timing info".
    Quote Quote  
  4. Originally Posted by Ennio View Post
    At first sight, I suspect video's framerate value 23976/1000. Can't tell if it's flawed container- or videostream framerate. Try to remux with MKVToolNix with setting "Default duration/FPS" to 24000/1001p. Be sure to check the "Fix bitstream timing info".
    Done, I get this:

    Code:
    General
    Complete name               : NON_ENG_FILM.mkv
    Format                      : Matroska
    Format version              : Version 4
    File size                   : 1.62 GiB
    Duration                    : 2 h 52 min
    Overall bit rate            : 1 348 kb/s
    Encoded date                : UTC 2022-11-24 14:09:11
    Writing application         : mkvmerge v71.0.0 ('Altitude') 64-bit
    Writing library             : libebml v1.4.4 + libmatroska v1.7.1
    
    Video
    ID                          : 1
    Format                      : AVC
    Format/Info                 : Advanced Video Codec
    Format profile              : High@L3.1
    Format settings             : CABAC / 2 Ref Frames
    Format settings, CABAC      : Yes
    Format settings, Reference  : 2 frames
    Codec ID                    : V_MPEG4/ISO/AVC
    Duration                    : 2 h 52 min
    Bit rate                    : 1 162 kb/s
    Width                       : 1 920 pixels
    Height                      : 1 080 pixels
    Display aspect ratio        : 16:9
    Frame rate mode             : Constant
    Frame rate                  : 11.988 (11988/1000) FPS
    Original frame rate         : 23.976 (24000/1001) FPS
    Color space                 : YUV
    Chroma subsampling          : 4:2:0
    Bit depth                   : 8 bits
    Scan type                   : Progressive
    Bits/(Pixel*Frame)          : 0.047
    Stream size                 : 1.40 GiB (86%)
    Writing library             : x264 core 125 r2208 d9d2288
    Encoding settings           : cabac=1 / ref=2 / deblock=0:0:0 / analyse=0x3:0x113 / me=dia / subme=7 / psy=1 / psy_rd=1.00:0.00 / mixed_ref=0 / me_range=16 / chroma_me=0 / trellis=1 / 8x8dct=1 / cqm=0 / deadzone=21,11 / fast_pskip=1 / chroma_qp_offset=-2 / threads=6 / lookahead_threads=1 / sliced_threads=0 / nr=0 / decimate=0 / interlaced=0 / bluray_compat=0 / constrained_intra=0 / bframes=2 / b_pyramid=0 / b_adapt=0 / b_bias=0 / direct=0 / weightb=0 / open_gop=0 / weightp=0 / keyint=500 / keyint_min=100 / scenecut=40 / intra_refresh=0 / rc=crf / mbtree=0 / crf=26.0 / qcomp=0.60 / qpmin=0 / qpmax=69 / qpstep=4 / ip_ratio=1.40 / pb_ratio=1.30 / aq=1:1.00
    Default                     : Yes
    Forced                      : No
    
    Audio
    ID                          : 2
    Format                      : AC-3
    Format/Info                 : Audio Coding 3
    Commercial name             : Dolby Digital
    Format settings             : Dolby Surround
    Codec ID                    : A_AC3
    Duration                    : 1 h 22 min
    Bit rate mode               : Constant
    Bit rate                    : 384 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                 : 227 MiB (14%)
    Service kind                : Complete Main
    Default                     : Yes
    Forced                      : No

    Originally Posted by ProWo View Post
    Convert the AAC stream from ENG_FILM.mp4 to AC3 Stereo 128kbs
    I opened it with Audacity and then

    File > Export > Export Audio > Save as file AC3(128kbs)

    but i have the following warning: "your tracks will be mixed down and exported as one mono file".

    Is this ok or should i use a different method for the conversion?
    Quote Quote  
  5. Originally Posted by BenBen21 View Post
    Originally Posted by ProWo View Post
    Convert the AAC stream from ENG_FILM.mp4 to AC3 Stereo 128kbs
    I opened it with Audacity and then
    File > Export > Export Audio > Save as file AC3(128kbs)
    but i have the following warning: "your tracks will be mixed down and exported as one mono file".
    Is this ok or should i use a different method for the conversion?
    Use clever FFmpeg-GUI.
    Load your ENG_FILM.mp4, click main, click convert Audiostream, select the AAC 5.1 Stream, click go to the encoder, then set all like in the picture below, signed in red. Leave all other settings as they are.
    Click Convert. Done. In your target folder you'll find the new created AC3 file.

    Image
    [Attachment 67796 - Click to enlarge]
    Last edited by ProWo; 24th Nov 2022 at 12:51.
    Quote Quote  
  6. Nice GUI!

    Here the two files:
    https://ufile.io/f/a783j
    Quote Quote  
  7. Member
    Join Date
    Mar 2008
    Location
    United States
    Search Comp PM
    Originally Posted by BenBen21 View Post

    File > Export > Export Audio > Save as file AC3(128kbs)

    but i have the following warning: "your tracks will be mixed down and exported as one mono file".

    Is this ok or should i use a different method for the conversion?
    Regarding Audacity,
    Edit/Preferences/Import-Export/Use advanced mixing options
    Quote Quote  
  8. Originally Posted by davexnet View Post
    Regarding Audacity,
    Edit/Preferences/Import-Export/Use advanced mixing options
    Perfect, thanks!
    Quote Quote  
  9. @ BenBen21

    Here is your file: https://ufile.io/swhc7yt2
    There is a small gap of 4 seconds without sound, from 09:35 to 09:39, as there was no sound here.
    But except for that, it should work.
    Quote Quote  
  10. Thank you very much, it is perfectly synchronized!

    I don't want to sound ungrateful or too fussy, but I have the impression that the audio quality has decreased, in particular it seems to me that the voices are characterized by a more low-pitched sound. Is it possible?
    Obviously with this consideration I'm not asking you for a new job, you've already done so much to help me! More than anything I'd be curious to know what the differences between the two audio tracks actually are: just those 4 missing seconds plus a different tempo (which translates into a linear asynchrony)? Or is there something else too? And if so what is and which are the ways to identify its causes? Surely you and other users of this forum have a much greater competence and experience than mine, but I hypothesize there is a more or less automated way to find these differences, on the other hand I would feel guilty knowing that you were forced to listen the whole tracks to find them!
    Quote Quote  
  11. Since the movie is 23.976fps and the audio is 25(50)fps, the complete Italian audio stream had to be adjusted.
    I intentionally adjusted the pitch as well, since it is wrong in the vast majority of cases. You can tell that the adjusted pitch fits by the music. The previous pitch was obviously wrong.
    The rest is a comparison of the peaks of both audio tracks, in your case without video.
    I use Mpeg Video Wizard DVD for this.
    Quote Quote  
  12. Originally Posted by ProWo View Post
    I intentionally adjusted the pitch as well, since it is wrong in the vast majority of cases. You can tell that the adjusted pitch fits by the music. The previous pitch was obviously wrong.
    I don't doubt it, it's just that in my opinion the original track sounded better overall, also because in the new track the voices are quite altered.

    Originally Posted by ProWo View Post
    The rest is a comparison of the peaks of both audio tracks, in your case without video.
    I use Mpeg Video Wizard DVD for this.
    Is this a "manual" comparison and not an automated one, right? Anyway I will try it.
    Out of curiosity, besides those 4 missing seconds and the different tempo, do you remember if there were other differences between the two ITA and ENG tracks?

    Originally Posted by ProWo View Post
    Since the movie is 23.976fps and the audio is 25(50)fps, the complete Italian audio stream had to be adjusted.
    What exactly does "25(50)fps" mean?
    One question: would it be possible to mux all with MKVToolNix by changing the fps of the ENG video and splitting the ITA audio track into several parts with relative delays?

    Sorry if I bother you, but I would like to learn in order to be autonomous the next time I have a problem like this!
    Quote Quote  
  13. I couldn't download Mpeg Video Wizard DVD, so I decided to give Audacity another go after the information you provided me. This time, to correctly calculate the "percent change" parameter relating to the "change tempo" effect, I identified two instants prior to the 4 missing seconds you mentioned, thus obtaining a value of -4.096%. After applying the "change tempo" effect, I filled that 4-second hole with the English track and eliminated a musical break that marked the end of the first half about halfway through the film. Finally I merged audio and video with MKVToolNix and to my surprise everything was perfectly in sync!

    Thanks for the inputs, I'm glad I managed it in the end!


    P.S.
    I renew the following questions: would it be possible to mux all with MKVToolNix by changing the fps of the ENG video and splitting the ITA audio track into several parts with relative delays? What should be the fps value to enter? What exactly does "25(50)fps" mean?
    Quote Quote  
  14. Originally Posted by BenBen21 View Post
    I couldn't download Mpeg Video Wizard DVD
    https://www.filecroco.com/download-mpeg-video-wizard-dvd/download/

    Originally Posted by BenBen21 View Post
    What exactly does "25(50)fps" mean?
    The relative video is 50 fps (that means 25 fps doubled, in this case the video and audio lenght doesn't change).
    So the audiostream from a 25fps video and the same 50fps video remains the same.
    Your audio was from a PAL Video (Europe], therefore 25 fps (or 50 fps in your case).
    The HD Video was 23.976 fps, so the factor to adjust the PAL Audio to the HD Video = 0.959040.
    Quote Quote  
  15. Originally Posted by ProWo View Post
    Originally Posted by BenBen21 View Post
    I couldn't download Mpeg Video Wizard DVD
    https://www.filecroco.com/download-mpeg-video-wizard-dvd/download/
    Thanks, I will try it.

    Originally Posted by ProWo View Post
    The relative video is 50 fps (that means 25 fps doubled, in this case the video and audio lenght doesn't change).
    So the audiostream from a 25fps video and the same 50fps video remains the same.
    Your audio was from a PAL Video (Europe], therefore 25 fps (or 50 fps in your case).
    These are issues that I should study in deep, but more or less I think I understood.


    Originally Posted by ProWo View Post
    The HD Video was 23.976 fps, so the factor to adjust the PAL Audio to the HD Video = 0.959040.
    I suppose 0.95904 comes from 23.976/25, but I don't understand where I should use this value. For example, with regard to the "change tempo" effect of Audacity, I found a value of the "percent change" parameter equal to -4.096.


    Originally Posted by BenBen21 View Post
    would it be possible to mux all with MKVToolNix by changing the fps of the ENG video and splitting the ITA audio track into several parts with relative delays? What should be the fps value to enter?
    In my intentions this would be a way to synchronize everything without recoding the ITA audio track or the ENG video track. In that case, from what I understand, the fps of the HD video on MKVToolNix should be set to 25 (and not 50), right? And the synchronization operation by dividing the ITA audio track into several parts with relative delays should at least in theory work, or am I missing something?
    Quote Quote  
  16. Originally Posted by BenBen21 View Post
    In my intentions this would be a way to synchronize everything without recoding the ITA audio track or the ENG video track. In that case, from what I understand, the fps of the HD video on MKVToolNix should be set to 25 (and not 50), right? And the synchronization operation by dividing the ITA audio track into several parts with relative delays should at least in theory work, or am I missing something?
    This is theoretically a possibility, but in reality there are problems with it.
    For example, not all software players can handle it.
    For example, my TV player does not play it.
    Quote Quote  
  17. Originally Posted by BenBen21 View Post
    In my intentions this would be a way to synchronize everything without recoding the ITA audio track or the ENG video track. In that case, from what I understand, the fps of the HD video on MKVToolNix should be set to 25 (and not 50), right? And the synchronization operation by dividing the ITA audio track into several parts with relative delays should at least in theory work, or am I missing something?
    Yes, that would work. When changing frame rate with mkvtoolnix, don't forget to use "fix bitstream timing information" option.
    Quote Quote  
  18. Originally Posted by ProWo View Post
    This is theoretically a possibility, but in reality there are problems with it.
    For example, not all software players can handle it.
    For example, my TV player does not play it.
    Ok, I understand.


    Originally Posted by Luke M View Post
    Originally Posted by BenBen21 View Post
    In my intentions this would be a way to synchronize everything without recoding the ITA audio track or the ENG video track. In that case, from what I understand, the fps of the HD video on MKVToolNix should be set to 25 (and not 50), right? And the synchronization operation by dividing the ITA audio track into several parts with relative delays should at least in theory work, or am I missing something?
    Yes, that would work. When changing frame rate with mkvtoolnix, don't forget to use "fix bitstream timing information" option.
    Perfect, I'll try.

    As far as the MKVToolNix option you mentioned is concerned, since before this topic I had never used or considered it, can I ask you exactly what it is for and why is it so important to use it?
    Quote Quote  
  19. Originally Posted by BenBen21 View Post
    As far as the MKVToolNix option you mentioned is concerned, since before this topic I had never used or considered it, can I ask you exactly what it is for and why is it so important to use it?
    It updates the AVC video stream to be consistent with the mkv container. Otherwise the mkv and the video stream would have different frame rates, with unpredictable results depending on the player.
    Quote Quote  
  20. Originally Posted by Luke M View Post
    It updates the AVC video stream to be consistent with the mkv container. Otherwise the mkv and the video stream would have different frame rates, with unpredictable results depending on the player.
    As already said I'm not particularly expert, but I think I understand what you mean, in practice with some players it could happen that the video is reproduced with the "wrong" frame rate.
    But I have to say that in many years, even though I've never used that option, I've never had any problems with the generated mkv files. The only thing I notice when I change the fps of the video track, is that MediaInfo provides two distinct values: "frame rate" and "original frame rate"; and I suppose the player should normally refer to the first of the two.
    Quote Quote  
  21. Member Ennio's Avatar
    Join Date
    May 2005
    Location
    Netherlands
    Search Comp PM
    Maybe it's handy to know that MKVToolNix only supports "Fix bitstream timing info" for AVC streams (at least, last time I checked). You can use ffmpeg for rewriting timestamps in a HEVC stream.
    Quote Quote  



Similar Threads