Page 1 of 2 12 LastLast
Results 1 to 10 of 15

Thread: audio sync not OK after audio conversion by VRD

  1. #1

    Default audio sync not OK after audio conversion by VRD

    edit: jump to the VRD test results outlining the VTD issue http://www.videoredo.net/msgBoard/sh...608#post124608

    Hello. Moved to this thread since I'm using the latest VRD version 5. from http://www.videoredo.net/msgBoard/sh...601#post124601

    I'm sure it's me, but ...

    I'm having trouble with audio sync with .mp4 files produced from qsf, when then editing using other tools such as ffmpeg and mp4box.
    The QSF'd .mp4 file plays fine though ... are delays and whatnot in the ".mp4 header" info ? If so how do I find them (mediainfo can't see them) ?

    For playback device compatibility reasons I need to convert .TS files with AC3 or MP2 etc audio into a .mp4 containing a single MP3 standard audio format (and adjust loudness to a common standard at the same time).
    Devices = WDTVs of older generation, and chromecast 1 and Ultru.
    At the moment I'm using ffmpeg's loudnorm audio filter and ignoring any "delay" and then noticing the out of sync in playback with MPC-HC.

    I reckon I'll re-try VRD with QSF and a profile which has audio Normalization (to 0db) and Automatic Compression to AAC 256k no-change-samplerate audio and see what happens.
    And hope that WDTV/Chromecast can play them
    And hope this doesn't happen ("VRD QSF with the custom profile throws the audio out of sync" http://www.videoredo.net/msgBoard/sh...552#post121552 )

    PS workflow is
    Code:
    REM QSF .TS file to .MP4 file
    REM "C:\ffmpeg\0-latest-x64\bin\ffmpeg.exe" -nostdin -y -hide_banner -threads 0 -i "T:\TEST\sample.has.1824ms.delay.mp4" -nostats -vn -af loudnorm=I=-16:TP=0.0:LRA=11:print_format=json -nostats -f null - 
    
    "C:\ffmpeg\0-latest-x64\bin\ffmpeg.exe" -i "T:\TEST\sample.has.1824ms.delay.mp4" -threads 0 -an -map_metadata -1 -c:v copy -y "T:\TEST\sample.has.1824ms.delay-temp.h264" 
    "C:\ffmpeg\0-latest-x64\bin\ffmpeg.exe" -i "T:\TEST\sample.has.1824ms.delay.mp4" -threads 0 -vn -map_metadata -1 -af loudnorm=I=-16:TP=0.0:LRA=11:measured_I=-24.67:measured_LRA=4.70:measured_TP=-3.45:measured_thresh=-35.03:offset=0.06:linear=true:print_format=summary -c:a libmp3lame -ab 256k -ar 48000 -y "T:\TEST\sample.has.1824ms.delay-temp.mp3"  
    "C:\ffmpeg\0-latest-x64\bin\ffmpeg.exe" -i "T:\TEST\sample.has.1824ms.delay.mp4" -threads 0 -vn -map_metadata -1 -c:a libmp3lame -ab 256k  -y "T:\TEST\sample.has.1824ms.delay-temp.mp3.noARchange.mp3"  
    
    "C:\mp4box\MP4Box.exe" -add "T:\TEST\sample.has.1824ms.delay-temp.h264" -add "T:\TEST\sample.has.1824ms.delay-temp.mp3":lang=eng:delay=-1824 -isma -new "T:\TEST\Converted\sample.has.1824ms.delay.mp3.MP4.ARchange.delay.-1824.mp4" 
    "C:\mp4box\MP4Box.exe" -add "T:\TEST\sample.has.1824ms.delay-temp.h264" -add "T:\TEST\sample.has.1824ms.delay-temp.mp3":lang=eng -isma -new "T:\TEST\Converted\sample.has.1824ms.delay.mp3.MP4.ARchange.nodelay.mp4" 
    "C:\mp4box\MP4Box.exe" -add "T:\TEST\sample.has.1824ms.delay-temp.h264" -add "T:\TEST\sample.has.1824ms.delay-temp.mp3.noARchange.mp3":lang=eng:delay=-1824 -isma -new "T:\TEST\Converted\sample.has.1824ms.delay.mp3.MP4.noARchange.delay.-1824.mp4" 
    "C:\mp4box\MP4Box.exe" -add "T:\TEST\sample.has.1824ms.delay-temp.h264" -add "T:\TEST\sample.has.1824ms.delay-temp.mp3.noARchange.mp3":lang=eng -isma -new "T:\TEST\Converted\sample.has.1824ms.delay.mp3.MP4.noARchange.nodelay.mp4" 
    "C:\mp4box\MP4Box.exe" -add "T:\TEST\sample.has.1824ms.delay-temp.h264" -add "T:\TEST\sample.has.1824ms.delay-temp.mp3":lang=eng:delay=1824 -isma -new "T:\TEST\Converted\sample.has.1824ms.delay.mp3.MP4.ARchange.delay.1824.mp4" 
    "C:\mp4box\MP4Box.exe" -add "T:\TEST\sample.has.1824ms.delay-temp.h264" -add "T:\TEST\sample.has.1824ms.delay-temp.mp3.noARchange.mp3":lang=eng:delay=1824 -isma -new "T:\TEST\Converted\sample.has.1824ms.delay.mp3.MP4.noARchange.delay.1824.mp4" 
    
    pause
    exit
    Last edited by hydra3333; January 9th, 2017 at 05:23 AM. Reason: changed title to reflect findings

  2. #2

    Default

    Quote Originally Posted by hydra3333 View Post
    I reckon I'll re-try VRD with QSF and a profile which has audio Normalization (to 0db) and Automatic Compression to AAC 256k no-change-samplerate audio and see what happens.
    And hope that WDTV/Chromecast can play them
    And hope this doesn't happen ("VRD QSF with the custom profile throws the audio out of sync" http://www.videoredo.net/msgBoard/sh...552#post121552 )
    Oh well, I has hoping to hard. Drat !

    Using a new profile which has audio conversion with Normalization (to 0db) and Automatic Compression to AAC 256k no-change-samplerate audio, the resulting mp4 from qsf has audio out of sync

    With the same .TS input file, a similar profile with no-change-to-audio (mentioned in a previous post) the resulting mp4 from qsf has audio close to in sync.

    I can't seem to win - VRD won't convert it, nor will tools which use the "good" .mp4 provided by a QSF.

    Suggestions welcomed.
    Last edited by hydra3333; January 8th, 2017 at 08:06 AM.

  3. #3

    Default

    Ah.
    After determining the audio "-ve" delay in the original .TS source file with mediainfo,
    if I use an .mp4 container file from ffmpeg like this as input to mp4box
    Code:
    "C:\ffmpeg\0-latest-x64\bin\ffmpeg.exe" -i "T:\TEST\sample.has.1824ms.delay.mp4" -threads 0 -an -map_metadata -1 -c:v copy -y "T:\TEST\sample.has.1824ms.delay.h264.via-mp4.mp4"
    instead of a raw h264 file from ffmpeg like this
    Code:
    "C:\ffmpeg\0-latest-x64\bin\ffmpeg.exe" -i "T:\TEST\sample.has.1824ms.delay.mp4" -threads 0 -an -map_metadata -1 -c:v copy -y "T:\TEST\sample.has.1824ms.delay-temp.h264"
    then after muxing with mp4box, it's close to working and the audio seem out by only a slight amount.
    Corrected the small amount with a plain guess of +150ms like this (-1874+150=-1674):
    Code:
    "C:\mp4box\MP4Box.exe" -add "T:\TEST\sample.has.1824ms.delay.h264.via-mp4.mp4" -add "T:\TEST\sample.has.1824ms.delay.ts.mp3":lang=eng:delay=-1674 -isma -new "T:\TEST\sample.has.1824ms.delay.ts.mp3.ARchange.delay.-1674.mp4"
    Go figure.

    Does VRD use ffmpeg and maybe suffer a similar type of underpinning issue resulting in the out of sync audio when doing conversions ?
    Just a thought.


    Since audio delays can and do vary wildly across TS file captures over time, the detection and correction has to be automated to be useful for my workflow if I am to be converting/normalizing/compressing audio using VRD.

    Suggestions still very much welcomed.
    Last edited by hydra3333; January 8th, 2017 at 07:54 AM.

  4. #4

    Default

    Just confirmed it with a 15 sec sample .TS file, using VRD and separately using ffmpeg.

    VRD fails by making audio out of sync WHEN DOING AN AUDIO CONVERSION.
    VRD works and audio is in sync when no audio conversion is done.

    ffmpeg with .h264 intermediary file fails.
    ffmpeg with a .mp4 intermediary file it works (no, .h264 with 0 delay doesn't work).

    The original .TS file plays in sync in MPC-HC.

    Could upload the sample .TS file if you're interested.
    edit: here's the link to 15mb .TS file which has an 1824ms delay https://drive.google.com/open?id=0B5...XE1aEJUNHVwOFU

    qsf logfile when audio conversion is done: VideoReDo-5_1_3_746_2017-01-08.zip
    Last edited by hydra3333; January 9th, 2017 at 08:56 PM. Reason: added logfile attachment

  5. #5

    Default

    Hi

    Just wondered if there was any news on the audio-desync-when-converting-audio issue ?

    Do I need to report a fault or something ?

    Thanks

  6. #6

    Default

    There are some video errors in that file which are causing the sync to need to be adjusted, but it should still work. Not sure why it doesn't. Try running the original file through QSF without recoding the audio. Is the audio still in sync? If so open the fixed file and save that to convert the audio. Does that work?

    The one step QSF should work though. Can you send us a sample file so we can reproduce the issue?
    Dan Haddix
    Developer

  7. #7

    Default

    OK.
    Here's a link to the sample: https://drive.google.com/open?id=0B5...XE1aEJUNHVwOFU
    I'll try the steps tomorrow.

  8. #8
    Join Date
    Jan 2015
    Location
    Melbourne, Australia
    Posts
    64

    Default

    Hi folks,

    I have just realised that, whenever I force an audio recode (with a stock H.264 profile set to AAC 2-channel stereo), the output AAC stream will begin with at least one blank audio frame, inserted before the audio starts.

    The number of blank frames increases with the number of audio streams. I counted 7 blanks in an example, before I disallowed Multiple Audio Streams.

    If I re-encode the file for any reason, the blank audio frames will multiply.

    In my tests, each audio frame was 21.3 mS, and this delay persisted through the whole file.

    I'm currently running version 5.3.4.748, but I can see the symptom in my earlier files too.

    Hope this somehow helps.

    TobyW

  9. #9

    Default

    I know what's causing that. It's a side effect of our AAC decoder. The way the AAC decoder works is that it ingests data on one cycle and then doesn't spit out that data until the next cycle. But our processing is linear so we can't allow that. So instead we insert a silent frame at the start of the decode and then just shift every frame by one there after. Under normal circumstances you'd never notice. But if you do repeated audio recodes it will keep inserting new frames for each one, so it will slowly drift out. But an AAC frame (48Khz) is only 22ms long so you're not going to even notice for at least a few cycles. (takes about 200ms offset before a human can notice a sync issue)
    Dan Haddix
    Developer

  10. #10
    Join Date
    Jan 2015
    Location
    Melbourne, Australia
    Posts
    64

    Default

    Thanks for that explanation, Dan. You've given me a starting point for digging deeper, but it looks like a can of worms (not of VRD's making).

    Think I will go and tackle something easier, like down-mixing from 5.1 to 2.0 with a strong normalised output level despite the presence of rogue spikes. Or easier still, just rid my garden of snails :-)

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •