VideoHelp Forum


Try DVDFab Video Downloader and rip Netflix video! Or Try DVDFab and copy Blu-rays! or rip iTunes movies!
+ Reply to Thread
Results 1 to 14 of 14
Thread
  1. PiNokKiO
    Join Date
    Nov 2015
    Location
    Finland
    Search Comp PM
    Hi!

    I have a project, where I have made a mash up from two different fanedits (with AviDemux). The files are .mkv and audio .ac3.
    The file (.mkv) works fine on VLC and other video software, but when I encode it (have tried AVCHDCoder and MultiAVCHD) the audio is out of sync.

    I have studied and looked for an answer but to no avail.
    I have demuxed audio and video, tried to change fps and tried different compilations, but still the audio is out of sync.
    The best combination so far has been when the video is at 23,976fps and audio (file demuxed with tsmuxer to) 25fps file.

    The video starts with audio in sync but at the end of the movie, the audio is 500ms out of sync.


    I tried eac3to (-slowdown -500), but got this as a result:

    AC3, 5.1 channels, 1:42:17, 384kbps, 48kHz
    The Nero decoder doesn't seem to work, will use libav instead.
    This bitrate isn't supported by the AC3 encoder. <ERROR>
    Decoding with libav/ffmpeg...
    Remapping channels...
    Changing FPS from 25.000 to 23.976...
    Aborted at file position 262144. <ERROR>


    I'm starting to be a little desperate with this. I would like to preserve the 5.1 in the audio, but how can I change the audio files duration by -500ms? Thanks to anyone who has the time to ponder on this.
    Quote Quote  
  2. I'm a MEGA Super Moderator Baldrick's Avatar
    Join Date
    Aug 2000
    Location
    Sweden
    Search Comp PM
    Post the details from the mkv source. Use Mediainfo, View -> Text.

    You can also try bdtoavchd.
    Quote Quote  
  3. PiNokKiO
    Join Date
    Nov 2015
    Location
    Finland
    Search Comp PM
    Here you go:

    General
    Unique ID : 5025155669758266871292874405466068947 (0x3C7CF4D9BBCF696CD869F73EB17D7D3)
    Complete name : D:\Videot\SW_EP2_HAL_Q2_PiNokKiO-edit_v2.mkv
    Format : Matroska
    Format version : Version 2
    File size : 3.84 GiB
    Duration : 1h 42mn
    Overall bit rate : 5 378 Kbps
    Writing application : Lavf54.63.104
    Writing library : Lavf54.63.104

    Video
    ID : 1
    Format : AVC
    Format/Info : Advanced Video Codec
    Format profile : High@L4.0
    Format settings, CABAC : Yes
    Format settings, ReFrames : 4 frames
    Codec ID : V_MPEG4/ISO/AVC
    Duration : 1h 42mn
    Bit rate : 4 823 Kbps
    Width : 1 920 pixels
    Height : 816 pixels
    Display aspect ratio : 2.35:1
    Frame rate : 23.976 fps
    Color space : YUV
    Chroma subsampling : 4:2:0
    Bit depth : 8 bits
    Scan type : Progressive
    Bits/(Pixel*Frame) : 0.128
    Stream size : 3.45 GiB (90%)
    Default : Yes
    Forced : No

    Audio
    ID : 2
    Format : AC-3
    Format/Info : Audio Coding 3
    Mode extension : CM (complete main)
    Format settings, Endianness : Big
    Codec ID : A_AC3
    Duration : 1h 42mn
    Bit rate mode : Constant
    Bit rate : 448 Kbps
    Channel(s) : 6 channels
    Channel positions : Front: L C R, Side: L R, LFE
    Sampling rate : 48.0 KHz
    Bit depth : 16 bits
    Compression mode : Lossy
    Stream size : 328 MiB (8%)
    Default : Yes
    Forced : No
    Quote Quote  
  4. Originally Posted by pinokkio View Post
    I tried eac3to (-slowdown -500), but got this as a result:
    Shouldn't it be (-slowdown +500ms)? I think you've specified a bitrate of 500kbps.

    Aside from that, the audio might be losing sync due to missing frames, or gaps in the audio stream, but have you tried extracting the AC3 with eac3to? The HD-DVD/Blu-Ray Stream Extractor might make it easier. This is a newer than the version VideoHelp is currently hosting. https://drive.google.com/file/d/0B3TNxvmZ9RVmVDVjb1ZKeVdEZnc/view If there's audio gaps, eac3to should fix them while extracting and that might solve the problem.

    If there's missing frames that can also cause sync issues. It depends how it's decoded/encoded as missing frames can effectively make the video variable frame rate. Usually I'd convert to a constant frame rate via Avisynth by specifying the original frame rate. ie if it's supposed to be 23.976 then you'd convert to 23.976 and that'd cause frames to be repeated if required to make up for any missing ones and generally between extracting the audio with eac3to and converting the frame rate the audio and video stay in sync. Are you familiar with Avisynth and do either of the programs you're using accept Avisynth scripts as the video input? Or they might be clever enough to convert to a constant frame rate for you if need be. I've not used either so I don't know.

    It's hard to know what's actually happening. If there's audio gaps or missing frames sometimes adjusting the audio duration or changing the frame rate can result in the audio being in sync at the end, but it still might wander in and out of sync between the beginning and end. Having to change the frame rate or audio duration from 23.976 to 25fps seems somewhat odd given it changes the duration by quite a bit, yet the source file has synced audio and video. Are you sure that's what you've done though, because I'm not sure how you'd demux audio to a 25fps file with tsmuxer as you've described.
    Last edited by hello_hello; 15th Nov 2015 at 13:53.
    Quote Quote  
  5. PiNokKiO
    Join Date
    Nov 2015
    Location
    Finland
    Search Comp PM
    Have you tried extracting the AC3 with eac3to?
    No, I could try that, but what is the command? All I could find was command "-core", and it says the audio must be DTS, and it just extracts the DTS core of a DTS-HD track.

    I believe MultiAVCHD uses Avisynth.
    Quote Quote  
  6. .
    No warranty at all (!) but "DelayCut" (free software) was sometimes able to fix my .ac3 files — without recoding —; but on constant type of desynch.:

    https://www.videohelp.com/software/delaycut
    Quote Quote  
  7. Originally Posted by pinokkio View Post
    Have you tried extracting the AC3 with eac3to?
    No, I could try that, but what is the command? All I could find was command "-core", and it says the audio must be DTS, and it just extracts the DTS core of a DTS-HD track.
    If you open an MKV with the HD Streams Extractor and it contains AC3 you should be able to choose AC3 for the "extract as" method and it'll just be extracted. I mostly use the GUI and haven't run eac3to from the command line in quite a while. If you prefer doing it that way.... well I just got MeGUI to extract some AC3 for me and copied the command line it used. That should point you in the right direction.

    "C:\Program Files\MeGUI\tools\eac3to\eac3to.exe" "E:\Video.mkv" 2:"D:\T2_Audio - English.ac3"

    I assume "2" is specified as the AC3 was the second stream in the source MKV and given it's AC3 being extracted as AC3 it will be copied, not converted.
    Quote Quote  
  8. PiNokKiO
    Join Date
    Nov 2015
    Location
    Finland
    Search Comp PM
    I have run several tests with DelayCut, by adjusting delay from the end, and choosing it to fix any errors in audio track.
    But even though the length of the audio track shortens, the audio is yet again always out of sync (after encoding).
    First tried 500ms delay, then 1000ms, then 1500ms. Results was the same.

    It seems, that next thing to do is to install Nero 7 to get it to do its work in eac3to and try if that works
    Quote Quote  
  9. PiNokKiO
    Join Date
    Nov 2015
    Location
    Finland
    Search Comp PM
    *Banging his head to the wall*

    eac3to (after installing Nero 7) says:
    "AC3, 5.1 channels, 1:42:16, 448kbps, 48kHz, dialnorm: -27db
    This audio conversion is not supported."

    After that I changed the command to -500, then it ran it through, but says:
    "The Nero decoder doesn´t seem to work, will use libav instead.
    Even though the ac3 files is fixed from problems, eac3to says it
    "Aborted at file position 262144."

    What could cause this?
    Last edited by pinokkio; 18th Nov 2015 at 09:18.
    Quote Quote  
  10. PiNokKiO
    Join Date
    Nov 2015
    Location
    Finland
    Search Comp PM
    Test #136... or something:

    Getting so desperate, that I extracted the 5.1 channel ac3 to 6 mono wav. files with BeSweet.
    Then with Wavelab (bought and paid for) time stretched every file to -500ms, and saved each one individually.
    Then by using Wav to AC3 Encoder re-encoded to 5.1 channel ac3 file.
    I'll encode it and lets see what's the result.
    Quote Quote  
  11. PiNokKiO
    Join Date
    Nov 2015
    Location
    Finland
    Search Comp PM
    Problem still present.
    The audio was out of sync about 500ms.

    Could it be that when encoding, the program stretches the audio to match the time of the video?
    Quote Quote  
  12. Try AviSynth and ffms2 >=2.22:
    Code:
    a=ffaudiosource("SW_EP2_HAL_Q2_PiNokKiO-edit_v2.mkv")
    v=ffvideosource("SW_EP2_HAL_Q2_PiNokKiO-edit_v2.mkv", fpsnum=24000, fpsden=1001)
    AudioDub(v, a)
    Encode audio (and video if you want to) from that and try again.
    Quote Quote  
  13. PiNokKiO
    Join Date
    Nov 2015
    Location
    Finland
    Search Comp PM
    Hi, sneaker.
    How should the program files, dll's, and folder be organized in relation to each other, so that the command prompt will work?
    And where the video file itself should be?

    As a side note, I tried a different approach again. I encoded the file with MultiAVCHD, but did not make it to an image.
    Instead I went to BDMV/STREAM folder and tried to change the audio of m2ts file by stretching it with mkvmergeGUI.
    Although I got the audio in sync with the mkvmerge, I could not save it as a BDAV m2ts -file. It was saved as an matroska m2ts. So that did not work either.

    So, back to square one...
    Last edited by pinokkio; 21st Nov 2015 at 16:30.
    Quote Quote  
  14. PiNokKiO
    Join Date
    Nov 2015
    Location
    Finland
    Search Comp PM
    So, all the earlier tests did not work, so I finally decided to do what should have been done earlier.

    I encoded the file, then from BDMV/STREAM folder played the m2ts -file with VLC and everytime the audio started to go off sync, I set the negative audio delay with VLC, made notes, and finally found four places in the whole movie where to set negative delay.
    Next I extracted the original 5.1 channel ac3 to 6 mono wav. files with BeSweet.
    Then with Wavelab (bought and paid for) cut small pieces from every mono audio track (1st -300ms, 2nd -150ms, 3rd -100ms, 4th -32ms.) from the same spot. Lastly I added silence to the end, so that the length matched the duration of videotrack.
    Then by using Wav to AC3 Encoder I re-encoded the six mono .wav files back to 5.1 channel ac3 file.

    Then with MultiAVCHD chose that ac3 as the audiofile for the track.
    To my surprise, it worked.

    Peace of mind at last.
    Quote Quote  



Similar Threads