VideoHelp Forum
+ Reply to Thread
Results 1 to 6 of 6
Thread
  1. hi, I try to explain the situation:

    I'm doing a mux, the video source is a webdl, the audio source is a dvd.
    The webdl has the same, but switched, two intro.
    So I'm trying to edit the audio in order to match the webdl intro sequence.
    After having switched the two intro in the script, I've also adjusted the video by adding and removing frames where was needed.
    Then I made a stackvertical script that shows both videos are in sync. The audio too is in sync with the DVD.

    At this point I load the DVD script into MeGUI and I encode the audio only.
    After having muxed the webdl with the MeGUI edited audio, the result is that the first intro is in sync with its audio by adding a small delay,
    but the secondary intro and the movie are no longer in sync with their audio, like they are in the stackvertical script,
    the difference is about 14 frames in the secondary intro and about 54 frames in the film part.

    So, before I try to approach this thing in a different way, can you tell me if my DVD script is wrong in some way?

    https://www.dropbox.com/sh/3j95z5oxmyrjlrd/AAAPa_q0yfLwgy66ZVpi4giHa?dl=0
    Last edited by maudit; 20th Apr 2022 at 09:02.
    Quote Quote  
  2. Where are the extra frames located in the DVD version? At the end ? 157650 - 157435 = 215 frames. Check your frame alignment at several points

    Try aligned splice "++" instead of unaligned splice "+" when using audio

    Final=WB++Pandora++Film

    http://avisynth.nl/index.php/Splice

    AlignedSplice
    Ajusts the audio (cuts off sound or inserts silence as necessary) to ensure that the sound remains synchronized with the video.

    UnalignedSplice
    Simply concatenates the sound without regard to synchronization with the video.
    Quote Quote  
  3. Originally Posted by poisondeathray View Post
    Where are the extra frames located in the DVD version? At the end ? 157650 - 157435 = 215 frames. Check your frame alignment at several points
    Not sure what frames are you referring to, those two intros are inverted but they have not the same length, furthermore the DVD could have some extra frames at the end, but it does not matter, all the dvd and webdl intro and movie frames are in sync.
    so I had to cut the ending WB intro #WB=Trim(AD,455,805).Loop(0,320,350),
    and add frames at the beginning of the film #Film=Trim(AD,806,0).Loop(27,0,0)
    in this way the 2 videos are identical.
    and also the audio of the waveform in the stackvertical script is perfectly aligned with the DVD audio.
    but no way, when I mux the edit audio, the audio is no longer in sync.
    there should be something wrong in the script, that I can't locate.




    Try aligned splice "++" instead of unaligned splice "+" when using audio

    Final=WB++Pandora++Film

    http://avisynth.nl/index.php/Splice

    AlignedSplice
    Ajusts the audio (cuts off sound or inserts silence as necessary) to ensure that the sound remains synchronized with the video.

    UnalignedSplice
    Simply concatenates the sound without regard to synchronization with the video.

    thanks for this info, I didn't know it, anyway it does not change anything in this case.





    @poisondeathray

    edited: nevermind dude, I made a stupid error, I was too much concentrate on avspmod and
    didn't realize I forgot to change the webdl FPS in toolnix.
    now is all the audio is in sync according the stackvertical script. I'm sorry.
    ..at least I learned something new about aligned splice "++".. thx!


    I also changed the script a bit in order to add less loops as possible, all trims are always done in I-frames.
    Code:
    Video=FFVideoSource("C:\Users\antip\Desktop\White Oleander (Kosminsky, 2002)\title_t00_track1_[eng].mkv", fpsnum=25, fpsden=1, threads=1)
    Audio=FFAudioSource("C:\Users\antip\Desktop\White Oleander (Kosminsky, 2002)\makemkv\title_t00.mkv")
    
    AD=AudioDub(Video,Audio)
    
    Pandora=Trim(AD,0,454).Loop(0,0,4)
    WB=Trim(AD,455,779)
    Film=Trim(AD,780,0)
    Final=WB++Pandora++Film
    
    return Final.Spline36Resize(702,394).Waveform(window=8, zoom=128, under=true)

    ..anyway as I'm here in toolnix I would like to take this opportunity to ask you:
    what about the "Fix Bitsrtream timing info", when to flag? when to left it deflagged?

    https://www.dropbox.com/s/ovovxrdv6nf823w/toolnix.png?dl=0
    Last edited by maudit; 20th Apr 2022 at 21:15.
    Quote Quote  
  4. I basically used your original script for the loops, it worked ok for me

    If the video frames are aligned, and you're using the DVD audio from the DVD script (and re-encoding), there should be no delay. But you mentioned a delay...

    I added video from web, audio from DVD in the script. Vdub is identical for the waveform of combined version, compared to DVD version compared to your screenshot around frame 350 and it's still matching at the end. You can open 2 instances of vdub2, check a DVD script vs. combined script , to rule out a script or local avs issue on your end. Check middle and end too. When I encode the combined script directly (eg with ffmpeg) it's still in sync If both scripts match, but you still get sync issue after encoding and muxing, then there is some issue with megui encoding audio or video or muxing

    Also , If you're downscaling from HD, you should use colormatrix or similar to convert to 709->601 SD colors

    I always use "flush ends" so audio and video are the same length. I always either cut the video or audio , or add frames or blankaudio to the ends. Right now your Audio and video lengths do no match . You think it's left aligned, at the beginning but it might not be when certain a muxer or player plays it. You can use info() in script to see the audio & video duration. I used Trim(0,3216) because the last web frame was 3217 . It might not make a difference, depending on what muxer, what splitter, what decoder, what player you use. When you have flush ends, there is less room for error

    Code:
    FFVideoSource("WO sample WEB-DL.mkv",fpsnum=24000,fpsden=1001,threads=1)
    AssumeFPS(25)
    Spline36Resize(702,394)
    ColorMatrix(mode="Rec.709->Rec.601", clamp=0)
    web=last #3313
    
    Aud=FFAudioSource("wo sample title_t00.mkv")
    Vid=FFVideoSource("wo sample title_t00.mkv",fpsnum=25, fpsden=1, threads=1)
    
    AD=AudioDub(Vid,Aud)
    
    Pandora=Trim(AD,0,454)
    WB=Trim(AD,455,805).Loop(0,320,350)
    Film=Trim(AD,806,0).Loop(27,0,0)
    
    WB++Pandora+Film
    Spline36Resize(702,394)
    dvd=last #3217
    
    AudioDub(web, dvd)
    Trim(0,3216)
    Quote Quote  
  5. thank you poison, but read above, I had edit the message yesterday, it was a stupid mistake. sry

    about the resize line, and colormatrix thanks for the info, I will study about it, but I only use the resize for the scripts preview,
    not for encoding, I do not encode anything, I just mux the webdl with the ita audio.

    also thanks about the "flush end" suggestion, I'll take a look at it.


    what about the "Fix Bitstream" checkbox? should i use it in muxes like this?
    Quote Quote  
  6. Originally Posted by maudit View Post

    what about the "Fix Bitstream" checkbox? should i use it in muxes like this?
    If you're re-encoding with avisynth, no

    If you're using mkvmerge to change the fps, maybe - because it can help in some cases with some players

    Here is official information from the mkvmerge author ("mbunkus" is the author)
    https://www.reddit.com/r/mkvtoolnix/comments/ep59ue/what_fix_bitstream_timing_info_opt...n_really_does/

    > What "fix bitstream timing info" option really does?

    Certain codecs (h.264/AVC & h.265/HEVC in this case) contain information about how long to display each frame (= the frame rate to use) at the bitstream level (in the so-called "sequence parameter set" which also contains information such as the pixel dimensions). mkvmerge will use that information for calculating the timestamps of each frame at the Matroska level if no other information about the frame rate is available.

    Now in certain cases users might want to change that frame rate. If they do, mkvmerge will by default only change the timestamps at the container/Matroska level but leave the information in the SPS unchanged. This can cause problems with players if they look into the bitstream, e.g. for calibrating the display or whatever.

    When you enable this option, mkvmerge will write the new frame rate into all SPS in the bitstream, thus potentially improving compatibility with some players. As it is a destructive operation it isn't on by default.

    > Should I enable it?

    Only if you change the frame rate and encounter playback issues.

    > And what this warning means "Warning in line 1006: the start timestamp is smaller than that of the previous entry, all entries form this file will be sorted by their start time"

    This can happen with text subtitle files. In an SRT text subtitle file each entry has a start time & an end time. Normally the entries in the file are sorted by their start time, but they don't have to be. However, they must be sorted by their start time when putting them into a Matroska file. mkvmerge will therefore sort the entries if they aren't sorted yet — and emit that warning.

    You can safely ignore the warning. I've never had a report of this causing any issue during playback. I should probably remove the warning as the user cannot really do anything about this anyway.
    Quote Quote  



Similar Threads

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