0

I am trying to copy just the audio from a quicktime.

>"C:\Program Files\ffmpeg\bin\ffmpeg.exe" -y -i a.mov -vn -acodec pcm_s16le a.wav

Here is my output. Sorry for the formatting.

ffmpeg version N-66673-gf0d1b3a Copyright (c) 2000-2014 the FFmpeg developers
  built on Oct  6 2014 22:10:42 with gcc 4.9.1 (GCC)
  configuration: --enable-gpl --enable-version3 --disable-w32threads --enable-avisynth --enable-bzlib --enable-fontconfig --enable-frei0r --enable-gnutls --enable-iconv --enable-libass --enable-libbluray --enable-libbs2b --enable-libcaca --enable-libfreetype --enable-libgme --enable-libgsm --enable-libilbc --enable-libmodplug --enable-libmp3lame --enable-libopencore-amrnb --enable-libopencore-amrwb --enable-libopenjpeg --enable-libopus --enable-librtmp --enable-libschroedinger --enable-libsoxr --enable-libspeex --enable-libtheora --enable-libtwolame --enable-libvidstab --enable-libvo-aacenc --enable-libvo-amrwbenc --enable-libvorbis
 --enable-libvpx --enable-libwavpack --enable-libwebp --enable-libx264 --enable-libx265 --enable-libxavs --enable-libxvid --enable-zlib
  libavutil      54.  9.100 / 54.  9.100
  libavcodec     56.  3.101 / 56.  3.101
  libavformat    56.  7.104 / 56.  7.104
  libavdevice    56.  1.100 / 56.  1.100
  libavfilter     5.  1.102 /  5.  1.102
  libswscale      3.  1.100 /  3.  1.100
  libswresample   1.  1.100 /  1.  1.100
  libpostproc    53.  1.100 / 53.  1.100
Input #0, mov,mp4,m4a,3gp,3g2,mj2, from 'a.mov':
  Metadata:
    major_brand     : qt
    minor_version   : 512
    compatible_brands: qt
    encoder         : Lavf56.7.104
  Duration: 00:00:02.44, start: 0.021333, bitrate: 761 kb/s
    Stream #0:0(eng): Video: h264 (High) (avc1 / 0x31637661), yuv420p, 1280x720,
 628 kb/s, 24 fps, 24 tbr, 12288 tbn, 48 tbc (default)
    Metadata:
      handler_name    : DataHandler
      encoder         : Lavc56.3.101 libx264
    Stream #0:1(eng): Audio: aac (mp4a / 0x6134706D), 48000 Hz, stereo, fltp, 129 kb/s (default)
    Metadata:
      handler_name    : DataHandler
Output #0, wav, to 'a.wav':
  Metadata:
    major_brand     : qt
    minor_version   : 512
    compatible_brands: qt
    ISFT            : Lavf56.7.104
    Stream #0:0(eng): Audio: pcm_s16le ([1][0][0][0] / 0x0001), 48000 Hz, stereo
, s16, 1536 kb/s (default)
    Metadata:
      handler_name    : DataHandler
      encoder         : Lavc56.3.101 pcm_s16le
Stream mapping:
  Stream #0:1 -> #0:0 (aac (native) -> pcm_s16le (native))
Press [q] to stop, [?] for help
size=     460kB time=00:00:02.45 bitrate=1536.3kbits/s
video:0kB audio:460kB subtitle:0kB other streams:0kB global headers:0kB muxing o
verhead: 0.016559%

A wav file is generated. However, if you bring the wav file and the original quicktime into Pro Tools, you can see that the wav file does not match the timing in the original quicktime. The audio in the wav file is about a frame and a half late.

I tried setting the bit rate and frequency manually.

"C:\Program Files\ffmpeg\bin\ffmpeg.exe" -y -i a.mov -b:a 87k -ar 48000 -acodec pcm_s16le -vn a.wav



"C:\Program Files\ffmpeg\bin\ffmpeg.exe" -y -i a.mov -ar 48000 -acodec pcm_s16le -vn a_did_not_set_bitrate.wav

Neither command made a difference. Has anyone encountered this issue before? Any ideas on how to solve it?

Edit:

Just noticed something odd in the output. Early on the duration was set to:

Duration: 00:00:02.44

After the wav was generated, the time was recorded as:

time=00:00:02.45

Was extra time added to the wav file?

Addition 4/26/16:

Interesting.

>"C:\Program Files\ffmpeg\bin\ffprobe.exe" -select_streams a -read_intervals %+#1 -show_entries packet=pts_time a.mov
ffprobe version N-66673-gf0d1b3a Copyright (c) 2007-2014 the FFmpeg developers
  built on Oct  6 2014 22:10:42 with gcc 4.9.1 (GCC)
  configuration: --enable-gpl --enable-version3 --disable-w32threads --enable-av
isynth --enable-bzlib --enable-fontconfig --enable-frei0r --enable-gnutls --enab
le-iconv --enable-libass --enable-libbluray --enable-libbs2b --enable-libcaca --
enable-libfreetype --enable-libgme --enable-libgsm --enable-libilbc --enable-lib
modplug --enable-libmp3lame --enable-libopencore-amrnb --enable-libopencore-amrw
b --enable-libopenjpeg --enable-libopus --enable-librtmp --enable-libschroedinge
r --enable-libsoxr --enable-libspeex --enable-libtheora --enable-libtwolame --en
able-libvidstab --enable-libvo-aacenc --enable-libvo-amrwbenc --enable-libvorbis
 --enable-libvpx --enable-libwavpack --enable-libwebp --enable-libx264 --enable-
libx265 --enable-libxavs --enable-libxvid --enable-zlib
  libavutil      54.  9.100 / 54.  9.100
  libavcodec     56.  3.101 / 56.  3.101
  libavformat    56.  7.104 / 56.  7.104
  libavdevice    56.  1.100 / 56.  1.100
  libavfilter     5.  1.102 /  5.  1.102
  libswscale      3.  1.100 /  3.  1.100
  libswresample   1.  1.100 /  1.  1.100
  libpostproc    53.  1.100 / 53.  1.100
Input #0, mov,mp4,m4a,3gp,3g2,mj2, from 'a.mov':
  Metadata:
    major_brand     : qt
    minor_version   : 512
    compatible_brands: qt
    encoder         : Lavf56.7.104
  Duration: 00:00:02.44, start: 0.021333, bitrate: 761 kb/s
    Stream #0:0(eng): Video: h264 (High) (avc1 / 0x31637661), yuv420p, 1280x720,
 628 kb/s, 24 fps, 24 tbr, 12288 tbn, 48 tbc (default)
    Metadata:
      handler_name    : DataHandler
      encoder         : Lavc56.3.101 libx264
    Stream #0:1(eng): Audio: aac (mp4a / 0x6134706D), 48000 Hz, stereo, fltp, 12
9 kb/s (default)
    Metadata:
      handler_name    : DataHandler
[PACKET]
pts_time=-0.021333
[/PACKET]

Trying to break this command down.

"C:\Program Files\ffmpeg\bin\ffprobe.exe" -select_streams a -read_intervals %+#1 -show_entries packet=pts_time a.mov

From what I can tell, it means to read one packet from the audio streams and show the PTS Time, which I think refers to a presentation timestamp.

Does this mean that the audio is starting before the video? Perhaps, it is starting 0.021333 seconds before the video.

Addition 4/27/16:

Running the same command with v for -select_streams yields:

[PACKET]
pts_time=0.000000
[/PACKET]
  • Run the same ffprobe command but with v for select_streams – Gyan Apr 27 '16 at 7:43
1

The issue is is because your QuickTime file contains a trim within it which FFMPEG ignores unless you explicitly perform the trim on the input file via the -ss option.

You can see your QuickTime file actually starts 0.021333 ms into the file by the "start: 0.021333" in this line:

 Duration: 00:00:02.44, start: 0.021333, bitrate: 761 kb/s

In order to fix this, please try the following command:

"C:\Program Files\ffmpeg\bin\ffmpeg.exe" -y -ss 0.021333 -i a.mov -vn -acodec pcm_s16le a.wav

Please note that the -ss option must be before the input file (-i) for this to work properly.

In my program I call FFProbe, get the offset and then apply it to the FFMPEG command to ensure I do not have sync problems. I believe what you are looking for is "start_time" in FFProbe.

Good luck!

|improve this answer|||||
0

Try this:

First, extract audio to raw container

ffmpeg.exe -y -i a.mov -vn -acodec copy a.aac

If you can use this in Pro Tools, you are done. Else,

ffmpeg.exe -y -i a.aac -acodec pcm_s16le a.wav
|improve this answer|||||
  • Looks like Pro Tools cannot read the aac file. The wav file I generated still has the same issue. Thanks though! – Christopher Spears Apr 21 '16 at 21:05

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.