VideoHelp Forum
+ Reply to Thread
Results 1 to 10 of 10
Thread
  1. Hi,

    please respect for cats thanks

    However I have this source that you can download

    https://www.dropbox.com/s/193tnwcn9nd6yl8/examplePrem.MP4?dl=0

    is a MP4 file with avc1 inside and two audio tracks.

    Please load it adobe premiere and place the clip in timeline

    Next: if I do

    Code:
    ffmpeg.exe -y -i exampleprem.mp4 -vn -acodec pcm_s16le -ar 48000 outffmpeg.wav
    considering only the first audio track, place the .wav audio track below the mp4

    but

    Image
    [Attachment 66708 - Click to enlarge]


    I get the outputted .wav (the green track) file that in premiere is 1 frame too long when compared to the original .mp4

    I wonder: is there a way (possibly with ffmpeg or in commandline) to an audio .wav file (pcm_s16le) of exactly the same lenght of the original when the 2 clip are imported in adobe premiere, and get the audio sync? thanks


    ps: I need to automate in batch processing
    Image Attached Files
    Last edited by marcorocchini; 11th Sep 2022 at 18:16.
    Quote Quote  
  2. Having tried every trick I can think of, I cannot reproduce your error. It keeps behaving correctly. No duration mismatch

    But rather than fool around with a CLI, why not just load your files into Adobe Media Encoder and batch export your wav files that way? Then you are assured the files are being interpreted the same way Premiere interprets them.
    Quote Quote  
  3. Member
    Join Date
    Feb 2006
    Location
    United States
    Search Comp PM
    Originally Posted by marcorocchini View Post
    Hi,

    please respect for cats thanks

    However I have this source that you can download

    https://www.dropbox.com/s/193tnwcn9nd6yl8/examplePrem.MP4?dl=0

    is a MP4 file with avc1 inside and two audio tracks.

    Please load it adobe premiere and place the clip in timeline

    Next: if I do

    Code:
    ffmpeg.exe -y -i exampleprem.mp4 -vn -acodec pcm_s16le -ar 48000 outffmpeg.wav
    considering only the first audio track, place the .wav audio track below the mp4

    but

    Image
    [Attachment 66708 - Click to enlarge]


    I get the outputted .wav (the green track) file that in premiere is 1 frame too long when compared to the original .mp4

    I wonder: is there a way (possibly with ffmpeg or in commandline) to an audio .wav file (pcm_s16le) of exactly the same lenght of the original when the 2 clip are imported in adobe premiere, and get the audio sync? thanks


    ps: I need to automate in batch processing
    try this here - https://lzone.de/blog/Easily-fix-async-video-with-ffmpeg
    Quote Quote  
  4. Your examplePrem.MP4 contains two ac3 audiostreams, no pcm stream there.

    Image
    [Attachment 66714 - Click to enlarge]
    Quote Quote  
  5. In attachement the outffmpeg.wav get with ffmpeg using this commandline on the original source examplePrem.MP4

    Code:
    ffmpeg.exe -y -i exampleprem.mp4 -vn -acodec pcm_s16le -ar 48000 outffmpeg.wav
    I place the clip examplePrem.MP4 in the adobe premiere timeline

    and below the .wav track outffmpeg.wav (the green track in the image)

    but the .wav seems too long of 2 frames

    Image
    [Attachment 66716 - Click to enlarge]


    So I wonder if is there a way to batch calculate the duration of the original and tells to ffmpeg that have to generate a .wav cutted with the lenght that match exactly the original, the target is to have a .wav that have the same lenght when placed in timeline
    Image Attached Files
    Last edited by marcorocchini; 12th Sep 2022 at 03:20.
    Quote Quote  
  6. ac3 and wav have exactly the same length.
    The error is therefore due to the Adobe Premiere display.

    Image
    [Attachment 66717 - Click to enlarge]
    Quote Quote  
  7. Yes, the video has 182 frames at 25 fps. That makes the length 7.280 seconds. So the real question is why is the video only 7.0 seconds long in Premiere?
    Quote Quote  
  8. Originally Posted by ProWo View Post
    ac3 and wav have exactly the same length.
    The error is therefore due to the Adobe Premiere display.

    Image
    [Attachment 66717 - Click to enlarge]
    Image
    [Attachment 66720 - Click to enlarge]


    mmmmm
    Quote Quote  
  9. Code:
    @Echo Off 
    
            ffmpeg64bitAug2019.exe -loglevel quiet -y -i exampleprem.mp4 -map 0:a:0 -vn -acodec pcm_s16le -ar 48000 outffmpeg.wav
    
            if exist InputDuration.txt del InputDuration.txt
            FFProbe64bit2014.exe -loglevel fatal -show_entries format=duration -of csv="p=0" -sexagesimal exampleprem.mp4>InputDuration.txt
            set /p InputDuration=<InputDuration.txt
            echo InputDuration is %InputDuration%
    
    
            if exist wavFFmpegDuration.txt del wavFFmpegDuration.txt
            FFProbe64bit2014.exe -loglevel fatal -show_entries format=duration -of csv="p=0" -sexagesimal outffmpeg.wav>wavFFmpegDuration.txt
            set /p wavFFmpegDuration=<wavFFmpegDuration.txt
            echo wavFFmpegDuration is %wavFFmpegDuration%
    
    
            if exist InputDuration.txt del InputDuration.txt
    echo.
            if exist wavFFmpegDuration.txt del wavFFmpegDuration.txt
    
    
    pause
    Code:
    InputDuration is 0:00:07.291000
    wavFFmpegDuration is 0:00:07.290667
    oh my ***

    however ffprobe's duration is not exactly the same. So I wonder, is there a way - in batch - to do so that both the files in premiere have the same lenght?
    Quote Quote  
  10. Originally Posted by marcorocchini View Post
    Code:
    InputDuration is 0:00:07.291000
    wavFFmpegDuration is 0:00:07.290667
    Do you think really to note a 0.333 ms (milliseconds) difference?
    Quote Quote  



Similar Threads

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