VideoHelp Forum

+ Reply to Thread
Results 1 to 14 of 14
Thread
  1. Hi, and however ...

    I have this source

    https://www.dropbox.com/s/xpf07u7uc0kctwr/example.mp4?dl=0

    need to generate a .wav file from this source using:

    Code:
    ffmpeg.exe -y -i example.mp4 -c:a pcm_s16le test.wav
    so I get this .wav file

    https://www.dropbox.com/s/z7em0o1318qvi36/test.wav?dl=0

    I try to put in timeline using edius and premiere the source file example.mp4 and in the audio track the result of ffmpeg test.wav

    Image
    [Attachment 66279 - Click to enlarge]


    Image
    [Attachment 66280 - Click to enlarge]


    The source is a italian speeck however there is a litte non-sync audio between the source and the .wav? Why? thanks
    Quote Quote  
  2. Because in your source file there is an audio delay.
    You can check this with:
    ffmpeg -i example.mp4
    Last edited by ProWo; 13th Aug 2022 at 09:07.
    Quote Quote  
  3. I have do:

    Code:
    ffmpeg - i example.mp4
    but it returns

    Code:
    [NULL @ 000002074030de40] Unable to find a suitable output format for 'pipe:'
    pipe:: Invalid argument
    however is there a way to repair the delay and get a correct .wav from the .mp4 source?
    Quote Quote  
  4. You did it wrong
    Repeat
    ffmpeg -i example.mp4
    Quote Quote  
  5. Code:
    C:\>ffmpeg -i example.mp4
    ffmpeg version 5.0.1-full_build-www.gyan.dev Copyright (c) 2000-2022 the FFmpeg developers
      built with gcc 11.2.0 (Rev7, Built by MSYS2 project)
      configuration: --enable-gpl --enable-version3 --enable-static --disable-w32threads --disable-autodetect --enable-fontconfig --enable-iconv --enable-gnutls --enable-libxml2 --enable-gmp --enable-bzlib --enable-lzma --enable-libsnappy --enable-zlib --enable-librist --enable-libsrt --enable-libssh --enable-libzmq --enable-avisynth --enable-libbluray --enable-libcaca --enable-sdl2 --enable-libdav1d --enable-libdavs2 --enable-libuavs3d --enable-libzvbi --enable-librav1e --enable-libsvtav1 --enable-libwebp --enable-libx264 --enable-libx265 --enable-libxavs2 --enable-libxvid --enable-libaom --enable-libopenjpeg --enable-libvpx --enable-mediafoundation --enable-libass --enable-frei0r --enable-libfreetype --enable-libfribidi --enable-liblensfun --enable-libvidstab --enable-libvmaf --enable-libzimg --enable-amf --enable-cuda-llvm --enable-cuvid --enable-ffnvcodec --enable-nvdec --enable-nvenc --enable-d3d11va --enable-dxva2 --enable-libmfx --enable-libshaderc --enable-vulkan --enable-libplacebo --enable-opencl --enable-libcdio --enable-libgme --enable-libmodplug --enable-libopenmpt --enable-libopencore-amrwb --enable-libmp3lame --enable-libshine --enable-libtheora --enable-libtwolame --enable-libvo-amrwbenc --enable-libilbc --enable-libgsm --enable-libopencore-amrnb --enable-libopus --enable-libspeex --enable-libvorbis --enable-ladspa --enable-libbs2b --enable-libflite --enable-libmysofa --enable-librubberband --enable-libsoxr --enable-chromaprint
      libavutil      57. 17.100 / 57. 17.100
      libavcodec     59. 18.100 / 59. 18.100
      libavformat    59. 16.100 / 59. 16.100
      libavdevice    59.  4.100 / 59.  4.100
      libavfilter     8. 24.100 /  8. 24.100
      libswscale      6.  4.100 /  6.  4.100
      libswresample   4.  3.100 /  4.  3.100
      libpostproc    56.  3.100 / 56.  3.100
    Input #0, mov,mp4,m4a,3gp,3g2,mj2, from 'example.mp4':
      Metadata:
        major_brand     : mp42
        minor_version   : 0
        compatible_brands: mp42mp41
        creation_time   : 2021-11-10T09:29:26.000000Z
      Duration: 00:01:09.35, start: 0.000000, bitrate: 10531 kb/s
      Stream #0:0[0x1](eng): Audio: aac (LC) (mp4a / 0x6134706D), 48000 Hz, stereo, fltp, 125 kb/s (default)
        Metadata:
          creation_time   : 2021-11-10T09:29:26.000000Z
          handler_name    : #Mainconcept MP4 Sound Media Handler
          vendor_id       : [0][0][0][0]
      Stream #0:1[0x2](eng): Audio: aac (LC) (mp4a / 0x6134706D), 48000 Hz, stereo, fltp, 125 kb/s (default)
        Metadata:
          creation_time   : 2021-11-10T09:29:26.000000Z
          handler_name    : #Mainconcept MP4 Sound Media Handler
          vendor_id       : [0][0][0][0]
      Stream #0:2[0x3](eng): Audio: aac (LC) (mp4a / 0x6134706D), 48000 Hz, stereo, fltp, 125 kb/s (default)
        Metadata:
          creation_time   : 2021-11-10T09:29:26.000000Z
          handler_name    : #Mainconcept MP4 Sound Media Handler
          vendor_id       : [0][0][0][0]
      Stream #0:3[0x4](eng): Audio: aac (LC) (mp4a / 0x6134706D), 48000 Hz, stereo, fltp, 125 kb/s (default)
        Metadata:
          creation_time   : 2021-11-10T09:29:26.000000Z
          handler_name    : #Mainconcept MP4 Sound Media Handler
          vendor_id       : [0][0][0][0]
      Stream #0:4[0x5](eng): Video: h264 (High) (avc1 / 0x31637661), yuv420p(tv, bt709), 1920x1080 [SAR 1:1 DAR 16:9], 10025 kb/s, 25 fps, 25 tbr, 25k tbn (default)
        Metadata:
          creation_time   : 2021-11-10T09:29:27.000000Z
          handler_name    : ?Mainconcept Video Media Handler
          vendor_id       : [0][0][0][0]
          encoder         : AVC Coding
    At least one output file must be specified
    
    C:\>
    ah ok, and where is the delay?
    Quote Quote  
  6. I checked a file that has a delay & ffmpeg -i example.mp4 did not show it.
    I use MediaInfo for this information.
    Quote Quote  
  7. Is your audiostream an aac?
    If so, load your video into clever Ffmpeg-GUI, click convert audiostream, select your audiostream, click go to the encoder, select pcm as encoder and click convert.
    The resulting wav file should be in synch.
    Quote Quote  
  8. I downloaded & looked at both files.
    MediaInfo shows no delay in either file.

    You have 4 audio tracks in the example.mp4 file.
    All 4 are .acc .

    I believe you need to add a map command to your ffmpeg code.

    I'm new to Clever but I would give it a try first.

    Try using this code first:
    Code:
    ffmpeg -i input(00).mp4 -map 0:a:0 output(00).m4a
    Then this one:
    Code:
    ffmpeg -i input(00).m4a output(00).wav
    If you are good with using batch files you could probably do it all at once.
    Last edited by cholla; 13th Aug 2022 at 16:03.
    Quote Quote  
  9. Member
    Join Date
    Aug 2018
    Location
    Wrocław
    Search PM
    I have the same problem.
    And I found this:
    https://trac.ffmpeg.org/ticket/2325

    Unfortunately, this looks like a bug in ffmpeg.
    Quote Quote  
  10. Originally Posted by cholla View Post
    I downloaded & looked at both files.
    MediaInfo shows no delay in either file.

    You have 4 audio tracks in the example.mp4 file.
    All 4 are .acc .

    I believe you need to add a map command to your ffmpeg code.

    I'm new to Clever but I would give it a try first.

    Try using this code first:
    Code:
    ffmpeg -i input(00).mp4 -map 0:a:0 output(00).m4a
    Then this one:
    Code:
    ffmpeg -i input(00).m4a output(00).wav
    If you are good with using batch files you could probably do it all at once.
    I have try
    Code:
    ffmpeg -i example.mp4 -map 0:a:0 output(00).m4a
    and

    Code:
    ffmpeg -i output(00).m4a output(00).wav
    and place the .wav in premiere to compare to example.mp4 but at the moment I still see the delay (however also the .m4a semms not in sync with example.mp4)

    Image
    [Attachment 66311 - Click to enlarge]
    Quote Quote  
  11. @ marcorocchini ,
    I don't have a software that shows the timeline type graphs edius and premiere do.
    I also don't speak Italian but I found a part of the video where a man was talking & the lipsync looked OK to me.

    The video I created with the video extracted from your original video & the .wav file I created form the extracted .m4a.
    There is a 00:00:00.013 difference in the video & audio.
    HTML Code:
      Duration: 00:01:09.33, start: 0.000000, bitrate: 11564 kb/s
        Stream #0:0(eng): Video: h264 (High), yuv420p(tv, bt709), 1920x1080 [SAR 1:1 DAR 16:9], 25 fps, 25 tbr, 1k tbn, 50 tbc (default)
        Metadata:
          HANDLER_NAME    : ?Mainconcept Video Media Handler
          DURATION        : 00:01:09.320000000
        Stream #0:1: Audio: pcm_s16le, 48000 Hz, 2 channels, s16, 1536 kb/s (default)
        Metadata:
          DURATION        : 00:01:09.333000000
    This is the video I created;
    Try it in edius and premiere to see what the graphs show.
    I did use -vsync -1 in the code to maybe make the sync be better.

    I also took a look at the example.mp4 with AVStoDVD.
    Its' Title Info(detailed shows this:
    For the video: Time: 00:01:09.320
    For the Audio: Time: 00:01:09.355
    This means the origin is not in sync.
    Image Attached Files
    Last edited by cholla; 14th Aug 2022 at 11:02.
    Quote Quote  
  12. Member Cornucopia's Avatar
    Join Date
    Oct 2001
    Location
    Deep in the Heart of Texas
    Search PM
    00:00:00.013 is nothing to get bent out of shape about.

    The framerate of the video is 25FPS, so the duration of each frame is 1/25th of a second or 0.040. The maximum amount of delay that can happen and yet still have the audio fall alongside the same frame of video is 1/2 (50%) of that or 0.020. Your delay isn't even that bad, so it hasn't even slipped a single frame (assuming your measurements are correct).

    It's not like you are trying to sync 1 audio with another similar audio and worrying about phasing/flanging. A/V sync lowest common denominator is video framerate which is crude in comparison to audio samplerate resolution.


    Scott
    Quote Quote  
  13. @ Scott,
    I agree with you on the very small amount of time.
    It was the OP that had a problem with the sync.
    I didn't find the original AV file much longer that the audio tracks.
    I would have been OK with the original myself.
    The thread started with just wanting to extract a .wav from the av.

    I just decided to play with it & see what I could do.
    Quote Quote  
  14. is there a way to extract audio from a mp4 file using MP4box?
    Quote Quote  



Similar Threads