VideoHelp Forum
+ Reply to Thread
Results 1 to 16 of 16
Thread
  1. Hello.
    I'm actually editing a video with the following audio:

    General
    Unique ID : 146431909469954788957713225133516599047 (0x6E29C28A85FAB244E13827FF2F772F07)
    Complete name : C:\Users\me\Downloads\Video 1.mkv
    Format : Matroska
    Format version : Version 4
    File size : 317 MiB
    Duration : 24 min 36 s
    Overall bit rate : 1 799 kb/s
    Movie name : Video 1
    Encoded date : UTC 2020-09-09 02:44:04
    Writing application : mkvmerge v45.0.0 ('Heaven in Pennies') 64-bit
    Writing library : libebml v1.3.10 + libmatroska v1.5.2 / Lavf58.48.100


    Video
    ID : 1
    Format : HEVC
    Format/Info : High Efficiency Video Coding
    Format profile : Main 10@L5@Main
    Codec ID : V_MPEGH/ISO/HEVC
    Duration : 24 min 31 s
    Bit rate : 1 162 kb/s
    Width : 1 920 pixels
    Height : 1 080 pixels
    Display aspect ratio : 16:9
    Frame rate mode : Variable
    Frame rate : 23.938 FPS
    Original frame rate : 23.976 (24000/1001) FPS
    Color space : YUV
    Chroma subsampling : 4:2:0
    Bit depth : 10 bits
    Bits/(Pixel*Frame) : 0.023
    Stream size : 204 MiB (64%)
    Language : Japanese
    Default : Yes
    Forced : No
    Color range : Limited

    Audio #1
    ID : 2
    Format : AAC LC SBR PS
    Format/Info : Advanced Audio Codec Low Complexity with Spectral Band Replication and Parametric Stereo
    Commercial name : HE-AACv2
    Format settings : NBC
    Codec ID : A_AAC-29
    Duration : 24 min 31 s
    Bit rate : 96.0 kb/s
    Channel(s) : 1 channel
    Channel(s)_Original : 2 channels
    ChannelLayout_Original : C
    Sampling rate : 48.0 kHz
    Frame rate : 23.438 FPS (2048 SPF)
    Compression mode : Lossy
    Stream size : 16.8 MiB (5%)
    Title : Brazilian Portuguese
    Writing library : Lavc58.94.100 libfdk_aac
    Language : Portuguese
    Default : No
    Forced : No
    However, the final part of that video have no audio in Portuguese, so I got another video with the missing part. This is the other video:

    General
    Complete name : C:\Users\me\Downloads\Video 2.mp4
    Format : MPEG-4
    Format profile : Base Media / Version 2
    Codec ID : mp42 (isom/mp42)
    File size : 76.4 MiB
    Duration : 24 min 28 s
    Overall bit rate mode : Variable
    Overall bit rate : 437 kb/s
    Encoded date : UTC 2019-08-12 23:48:21
    Tagged date : UTC 2019-08-12 23:48:21
    Writing application : Google
    gsst : 0
    gstd : 1468685

    Video
    ID : 1
    Format : AVC
    Format/Info : Advanced Video Codec
    Format profile : Baseline@L3
    Format settings : 1 Ref Frames
    Format settings, CABAC : No
    Format settings, Reference frames : 1 frame
    Codec ID : avc1
    Codec ID/Info : Advanced Video Coding
    Duration : 24 min 28 s
    Bit rate : 338 kb/s
    Width : 640 pixels
    Height : 360 pixels
    Display aspect ratio : 16:9
    Frame rate mode : Constant
    Frame rate : 29.970 (30000/1001) FPS
    Color space : YUV
    Chroma subsampling : 4:2:0
    Bit depth : 8 bits
    Scan type : Progressive
    Bits/(Pixel*Frame) : 0.049
    Stream size : 59.2 MiB (77%)
    Title : ISO Media file produced by Google Inc. Created on: 08/12/2019.
    Writing library : x264 core 155 r2901 7d0ff22
    Encoded date : UTC 2019-08-12 23:48:21
    Tagged date : UTC 2019-08-12 23:48:21
    Color range : Limited
    Color primaries : BT.709
    Transfer characteristics : BT.709
    Matrix coefficients : BT.709
    Codec configuration box : avcC

    Audio
    ID : 2
    Format : AAC LC
    Format/Info : Advanced Audio Codec Low Complexity
    Codec ID : mp4a-40-2
    Duration : 24 min 28 s
    Bit rate mode : Variable
    Bit rate : 96.0 kb/s
    Channel(s) : 2 channels
    Channel layout : L R
    Sampling rate : 44.1 kHz
    Frame rate : 43.066 FPS (1024 SPF)
    Compression mode : Lossy
    Stream size : 16.8 MiB (22%)
    Title : ISO Media file produced by Google Inc. Created on: 08/12/2019.
    Encoded date : UTC 2019-08-12 23:48:21
    Tagged date : UTC 2019-08-12 23:48:21

    In order to not lose any quality, I'm exporting both as .wav and editing Audio 1 with the missing parts that Audio 2 contains, since Audio 1 has a much better quality.
    However, it seems I can't manage to compress it back with the exact same settings that Audio 1 had before being edited, and it seems to have caused some unpleasant consequences, for example: the resulting audio is no longer synced with Video 1. The missing audio part inserted was only the last 20~25 seconds of the video and was precisely edited, so it's not an editing mistake.

    I'm using MKVCleaver to extract the Audio 1 from Video 1 and MKVToolNix to insert the resulting audio to the final video file (Video 1 with missing parts of Audio 1).
    I tried to use XMedia Recode, Format Factory and Audacity (which I'm using to export as .wav files) to encode the resulting audio back to .aac, but they all have the same problem (plus Audacity can't convert to .aac extension). Maybe I just don't know the right settings. I just want the resulting audio to have the maximum similarity with Audio 1 with no losses (but also no unnecessary large files, since the extracted Audio 1 has only 17 MB and it's very good), so I can keep the fidelity of the original project.

    1. What should I do?
    2. Which program is better for that?
    3. Is there any way to know the exact settings I should use to re-encode an audio in case I need to do it again in the future with a different audio format?


    Thank you in advance.
    Last edited by Clever Sleazoid; 10th Oct 2021 at 05:06. Reason: added more info
    Quote Quote  
  2. I'm out today, will help you tomorrow.
    Quote Quote  
  3. Some questions:
    When listening, is the pitch (not volume) of audio 1 higher or lower than audio 2?
    Is audio 1 in sync for the whole video 1 and is audio 1 audible until the end of video 1 (although not in Portuguese)?
    Upload Video1.mkv and Audio2 (the extracted aac stream) somewhere and post the links here.
    Last edited by ProWo; 11th Oct 2021 at 04:41. Reason: Added question
    Quote Quote  
  4. Originally Posted by ProWo View Post
    When listening, is the pitch (not volume) of audio 1 higher or lower than audio 2?
    How can I see it?
    Originally Posted by ProWo View Post
    Is audio 1 in sync for the whole video 1 and is audio 1 audible until the end of video 1 (although not in Portuguese)?
    Yes and yes.
    Originally Posted by ProWo View Post
    Upload Video1.mkv and Audio2 (the extracted aac stream) somewhere and post the links here.
    I'm not sure if it's a good idea... the video has copyright. I can do it if it's not against the rules or something.
    Quote Quote  
  5. Originally Posted by Clever Sleazoid View Post
    Originally Posted by ProWo View Post
    When listening, is the pitch (not volume) of audio 1 higher or lower than audio 2?
    How can I see it?
    You can HEAR it only, by listening.
    Quote Quote  
  6. Originally Posted by Clever Sleazoid View Post
    I'm not sure if it's a good idea... the video has copyright. I can do it if it's not against the rules or something.
    Then upload original audio1.aac and audio2.aac only
    Quote Quote  
  7. Originally Posted by ProWo View Post
    You can HEAR it only, by listening.
    You made clear that pitch was different from volume. I could tell you that Audio 2 is higher, I guess, but you can hear it by yourself below.

    Originally Posted by ProWo View Post
    Originally Posted by Clever Sleazoid View Post
    I'm not sure if it's a good idea... the video has copyright. I can do it if it's not against the rules or something.
    Then upload original audio1.aac and audio2.aac only
    Here you are. Audio 1 was extracted by MKVCleaver. Audio 2 was extracted by XMedia Recode (direct stream copy).

    Audio 2 has the last 32 seconds in Brazilian Portuguese. Audio 1 has the last 32 seconds in Japanese. All I did was converting both to .wav (because Sony Vegas can't import Audio 1) and inserting that last scene audio from 2 to 1 (removing a bit of noise that appears in the final). And keep some silence from 1 in order to make the resulting audio have the same length as Audio 1. Though I'm not the one who encoded the project, I'm kind of used to editing existing audios (and new audios as well) and sync them to videos, but that lack of synchronization of all the already synced audio after that bit of editing is a brand-new bad news for me. So I supposed re-encoding to .aac was the problem (considering that any conversion of the original .mkv video that contains Audio 1 to any other format also makes the audio get out of sync). I have no contact with people who encoded the videos to ask anything.

    I'll still need to make the same thing with 9 other similar audios. That's why I would like to know the root cause of the problem and how to solve it.
    Image Attached Files
    Last edited by Clever Sleazoid; 11th Oct 2021 at 19:57. Reason: added detailed info
    Quote Quote  
  8. Here's the modified Audio1.
    Remux it with the video1 and see if it is in sync.

    NB
    The pitch was the same.
    Image Attached Files
    Last edited by ProWo; 12th Oct 2021 at 03:00. Reason: added info
    Quote Quote  
  9. Originally Posted by ProWo View Post
    Here's the modified Audio1.
    Remux it with the video1 and see if it is in sync.

    NB
    The pitch was the same.
    No, it isn't
    Quote Quote  
  10. The problem is aac.
    It has no internal exact timing of its own and is bound to the video.
    Without the whole video1 file, precise adjustment is not possible.
    Upload Video1 and we will see...
    Quote Quote  
  11. Originally Posted by ProWo View Post
    The problem is aac.
    It has no internal exact timing of its own and is bound to the video.
    Without the whole video1 file, precise adjustment is not possible.
    Upload Video1 and we will see...
    Here it is the untouched Video 1. Brazilian Portuguese is the second audio. I suggest the part with the woman talking from 21:58 to 22:15 to check properly the audio synchronization. Thank you for your patience.
    Quote Quote  
  12. Will be back tomorrow...
    Quote Quote  
  13. Here we go.
    There are several problems with Video1.
    The biggest one is that it is not muxed correctly.
    You can see this in the fps value of the video stream in mediainfo.
    It says 23.938fps, variable, when in fact the stream is 23.976fps, constant.
    For this reason you have to do the following:
    Extract the video stream (hevc) with MkvCleaver.
    Then run Mkvtoolnix-Gui.
    Load the extracted video stream in the upper pane, then add video1.mkv and the enclosed new audio1_POR_NEW.aac (see the photo).
    Then in the lower pane, uncheck the video stream and the Portuguese audio stream from video1.mkv.
    Then add the language tag por to the new audio1_POR_NEW.aac stream.
    Then click Start Multiplexing. Done.
    Check the new mkv, if the portuguese audio track is in sync and if the last seconds are now as wanted.
    Image Attached Thumbnails Click image for larger version

Name:	1.jpg
Views:	22
Size:	121.7 KB
ID:	61274  

    Image Attached Files
    Quote Quote  
  14. Originally Posted by ProWo View Post
    Here we go.
    There are several problems with Video1.
    The biggest one is that it is not muxed correctly.
    You can see this in the fps value of the video stream in mediainfo.
    It says 23.938fps, variable, when in fact the stream is 23.976fps, constant.
    For this reason you have to do the following:
    Extract the video stream (hevc) with MkvCleaver.
    Then run Mkvtoolnix-Gui.
    Load the extracted video stream in the upper pane, then add video1.mkv and the enclosed new audio1_POR_NEW.aac (see the photo).
    Then in the lower pane, uncheck the video stream and the Portuguese audio stream from video1.mkv.
    Then add the language tag por to the new audio1_POR_NEW.aac stream.
    Then click Start Multiplexing. Done.
    Check the new mkv, if the portuguese audio track is in sync and if the last seconds are now as wanted.
    Thank you so much. That helped a lot. Now it is synced. Seeing your file has only 17,5 MB, closer to the original size, and mine has 23 MB (see the image below), I have some questions, just for curiosity:
    1. What intermediate files did you use to edit?
    2. What program did you use to convert to those intermediate files?
    3. What program and settings did you use to convert it back to aac?

    Image
    [Attachment 61276 - Click to enlarge]
    Quote Quote  
  15. Originally Posted by Clever Sleazoid View Post
    Thank you so much. That helped a lot. Now it is synced. Seeing your file has only 17,5 MB, closer to the original size, and mine has 23 MB (see the image below), I have some questions, just for curiosity:
    1. What intermediate files did you use to edit?
    2. What program did you use to convert to those intermediate files?
    3. What program and settings did you use to convert it back to aac?
    1. pcm 16 bit (wav)
    2. clever FFmpeg-GUI
    3. clever FFmpeg-GUI (aac, 96 kb/s)
    Quote Quote  
  16. Originally Posted by ProWo View Post
    Originally Posted by Clever Sleazoid View Post
    Thank you so much. That helped a lot. Now it is synced. Seeing your file has only 17,5 MB, closer to the original size, and mine has 23 MB (see the image below), I have some questions, just for curiosity:
    1. What intermediate files did you use to edit?
    2. What program did you use to convert to those intermediate files?
    3. What program and settings did you use to convert it back to aac?
    1. pcm 16 bit (wav)
    2. clever FFmpeg-GUI
    3. clever FFmpeg-GUI (aac, 96 kb/s)
    Thank you very much for everything
    Quote Quote  



Similar Threads

Visit our sponsor! Try DVDFab and backup Blu-rays!