且构网

分享程序员开发的那些事...
且构网 - 分享程序员编程开发的那些事

将时间码保留在ffmpeg中?

更新时间:2022-10-16 23:08:28

ffmpeg的最新版本默认保留时间码。我刚测试过:

  ffmpeg -i A152C001_131008UZ.MXF -an -vcodec prores -profile:v 0 testtc.mov 
ffmpeg version 2.0.1-tessus版权所有(c)2000-2013 FFmpeg开发人员
建于2013年8月10日21:25:56 with llvm-gcc 4.2.1(LLVM build 2336.1.00)
配置:--prefix = / Users / tessus / data / ext / ffmpeg / sw --as = yasm --extra-version = tessus --disable-shared --enable-static --disable-ffplay - gpl --enable-pthreads --enable-postproc --enable-libmp3lame --enable-libtheora --enable-libvorbis --enable-libx264 --enable-libxvid --enable-libspeex --enable-bzlib --enable- zlib --enable-libopencore-amrnb --enable-libopencore-amrwb --enable-libxavs --enable-version3 --enable-libvo-aacenc --enable-libvo-amrwbenc --enable-libvpx --enable-libgsm - -enable-libopus --enable-fontconfig --enable-libfreetype --enable-libass --enable-libbluray --enable-filters --enable-runtime-cpudetect
libavutil 52. 38.100 / 52. 38.100
libavcodec 55. 18.102 / 55. 18.102
libavformat 55. 12.100 / 55. 12.100
libavdevice 55. 3.100 / 55. 3.100
libavfilter 3. 79.101 / 3. 79.101
libswscale 2. 3.100 / 2. 3.100
libswresample 0. 17.102 / 0. 17.102
libpostproc 52. 3.100 / 52. 3.100
...
输入#0,mxf,从'A152C001_131008UZ.MXF':
元数据:
...
时间代码:18:56:52:22
...
输出#0,mov 'testtc.mov':
元数据:
...
时间代码:18:56:52:22
...
$ p>

并且结果Quicktime具有正确的时间码(如QT7所示)。



http://www.evermeet.cx/ffmpeg/ 获取了我的Mac OS X二进制文件ffmpeg



ffmbc 适用于Mac OS X,通过 homebrew brew install ffmbc )。但是,默认情况下不保留时间码。您需要使用 -timecode hh:mm:ss:ff 选项指定它。



homebrew,你也可以用它来安装ffmpeg。


Im running a script that makes proress 422 proxies for editing in ffmpeg, but the timecode on the files seems to get lost or nulled out.

the parameters im using:

ffmpeg -i file.mov -vcodec prores -profile:v 0 -an file.mov

is there any way of preserving the timecode from the raw files?

I've also come over ffmbc wich seems be more suited for this, but it's for linux only. Any way this can be compiled for osx?

I'm on osx 10.8.4

Thanks in advanced!

Recent versions of ffmpeg do preserve the timecode by default. I just tested it:

ffmpeg -i A152C001_131008UZ.MXF -an -vcodec prores -profile:v 0 testtc.mov
ffmpeg version 2.0.1-tessus Copyright (c) 2000-2013 the FFmpeg developers
  built on Aug 10 2013 21:25:56 with llvm-gcc 4.2.1 (LLVM build 2336.1.00)
  configuration: --prefix=/Users/tessus/data/ext/ffmpeg/sw --as=yasm --extra-version=tessus --disable-shared --enable-static --disable-ffplay --enable-gpl --enable-pthreads --enable-postproc --enable-libmp3lame --enable-libtheora --enable-libvorbis --enable-libx264 --enable-libxvid --enable-libspeex --enable-bzlib --enable-zlib --enable-libopencore-amrnb --enable-libopencore-amrwb --enable-libxavs --enable-version3 --enable-libvo-aacenc --enable-libvo-amrwbenc --enable-libvpx --enable-libgsm --enable-libopus --enable-fontconfig --enable-libfreetype --enable-libass --enable-libbluray --enable-filters --enable-runtime-cpudetect
  libavutil      52. 38.100 / 52. 38.100
  libavcodec     55. 18.102 / 55. 18.102
  libavformat    55. 12.100 / 55. 12.100
  libavdevice    55.  3.100 / 55.  3.100
  libavfilter     3. 79.101 /  3. 79.101
  libswscale      2.  3.100 /  2.  3.100
  libswresample   0. 17.102 /  0. 17.102
  libpostproc    52.  3.100 / 52.  3.100
...
Input #0, mxf, from 'A152C001_131008UZ.MXF':
  Metadata:
...
    timecode        : 18:56:52:22
...
Output #0, mov, to 'testtc.mov':
  Metadata:
...
    timecode        : 18:56:52:22
...

And the resulting Quicktime does have the correct timecode (as shown by QT7).

I got my Mac OS X binary of ffmpeg from http://www.evermeet.cx/ffmpeg/

And ffmbc is available for Mac OS X through homebrew (brew install ffmbc). However, it does not preserve the timecode by default. You need to specify it with the -timecode hh:mm:ss:ff option.

If you do install homebrew, you can also use it to install ffmpeg.