[FFmpeg-user] Extracting starting timecode info using ffmpeg/ffprobe
Kieran O Leary
kieran.o.leary at gmail.com
Wed Sep 2 00:43:14 CEST 2015
I am trying to create h264 low res proxies that have a burnt in
timecode which derives from the source video's timecode. I'm making a
bash script that stores the value and uses it as the starting timecode
for the drawtext filter. Can anyone recommend a way for ffprobe or
ffmpeg to always return a timecode start value? I'm guessing that I'm
calling the wrong command?
>From some googling, I've had occasional success with the following command:
ffprobe.exe -show_entries format_tags=timecode -of
default=noprint_wrappers=1 inputfile
I've found that I had to use "format_tags=timecode" as
"format=timecode" would not return a value (only mentioning this as
the ffprobe tips page uses the latter in its examples).
Some videos produce a timecode value, some don't, even though my test
videos show a timecode in ffprobe/mediainfo regardless. I was using -v
error as recommended by the ffprobe tips page.
Full output of a file that shows a timecode value, followed by one
that does not return a value.
ffmpeg-20150901-git-b54e03c-win64-static\ffmpeg-20150901-git-b54e03c-win64-static\bin\ffprobe.exe
-show_entries format_tags=timecode -of default=noprint_wrappers=1
DHC36.v210.pcm.mov
ffprobe version N-74751-gb54e03c Copyright (c) 2007-2015 the FFmpeg developers
built with gcc 4.9.3 (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-libdcadec
--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-lzma --enable-decklink --enable-zlib
libavutil 54. 31.100 / 54. 31.100
libavcodec 56. 59.100 / 56. 59.100
libavformat 56. 40.101 / 56. 40.101
libavdevice 56. 4.100 / 56. 4.100
libavfilter 5. 40.100 / 5. 40.100
libswscale 3. 1.101 / 3. 1.101
libswresample 1. 2.101 / 1. 2.101
libpostproc 53. 3.100 / 53. 3.100
Input #0, mov,mp4,m4a,3gp,3g2,mj2, from 'DHC36.v210.pcm.mov':
Metadata:
creation_time : 2010-05-25 22:46:56
timecode : 00:30:40:13
Duration: 00:00:09.91, start: 0.040375, bitrate: 230674 kb/s
Stream #0:0(eng): Video: v210 (v210 / 0x30313276),
yuv422p10le(bt470bg/smpte240m/unknown), 720x486, 222820 kb/s, 29.85
fps, 29.97 tbr, 2997 tbn, 2997 tbc (default)
Metadata:
creation_time : 2010-05-25 22:47:06
handler_name : Apple Alias Data Handler
encoder : Uncompressed 10 bit
timecode : 00:30:40:13
Stream #0:1(eng): Subtitle: eia_608 (c608 / 0x38303663), 640x480,
4 kb/s (default)
Metadata:
creation_time : 2010-05-25 22:47:06
handler_name : Apple Alias Data Handler
Stream #0:2(eng): Audio: pcm_s24le (in24 / 0x34326E69), 48000 Hz,
mono, s32 (24 bit), 1152 kb/s (default)
Metadata:
creation_time : 2010-05-25 22:47:06
handler_name : Apple Alias Data Handler
Stream #0:3(eng): Audio: pcm_s24le (in24 / 0x34326E69), 48000 Hz,
mono, s32 (24 bit), 1152 kb/s (default)
Metadata:
creation_time : 2010-05-25 22:47:06
handler_name : Apple Alias Data Handler
Stream #0:4(eng): Audio: pcm_s24le (in24 / 0x34326E69), 48000 Hz,
mono, s32 (24 bit), 1152 kb/s (default)
Metadata:
creation_time : 2010-05-25 22:47:06
handler_name : Apple Alias Data Handler
Stream #0:5(eng): Audio: pcm_s24le (in24 / 0x34326E69), 48000 Hz,
mono, s32 (24 bit), 1152 kb/s (default)
Metadata:
creation_time : 2010-05-25 22:47:06
handler_name : Apple Alias Data Handler
Stream #0:6(eng): Data: none (tmcd / 0x64636D74), 0 kb/s (default)
Metadata:
creation_time : 2010-05-25 22:47:06
handler_name : Apple Alias Data Handler
reel_name : DHC0034_1984.0040_pmaster
timecode : 00:30:40:13
Unsupported codec with id 0 for input stream 6
TAG:timecode=00:30:40:13
Video that does not declare a timecode even though I can see timecode
values in the ffprobe readout:
ffmpeg-20150901-git-b54e03c-win64-static\ffmpeg-20150901-git-b54e03c-win64-static\bin\ffprobe.exe
-show_entries format_tags=timecode -of default=noprint_wrappers=1
ffv1.mkv
ffprobe version N-74751-gb54e03c Copyright (c) 2007-2015 the FFmpeg developers
built with gcc 4.9.3 (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-libdcadec
--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-lzma --enable-decklink --enable-zlib
libavutil 54. 31.100 / 54. 31.100
libavcodec 56. 59.100 / 56. 59.100
libavformat 56. 40.101 / 56. 40.101
libavdevice 56. 4.100 / 56. 4.100
libavfilter 5. 40.100 / 5. 40.100
libswscale 3. 1.101 / 3. 1.101
libswresample 1. 2.101 / 1. 2.101
libpostproc 53. 3.100 / 53. 3.100
Input #0, matroska,webm, from 'ffv1.mkv':
Metadata:
COMPATIBLE_BRANDS: qt
MAJOR_BRAND : qt
MINOR_VERSION : 512
ENCODER : Lavf56.40.101
Duration: 00:00:57.64, start: 0.000000, bitrate: 23305 kb/s
Stream #0:0(eng): Video: h264 (High), yuv420p, 1920x1080, SAR 1:1
DAR 16:9, 25 fps, 25 tbr, 1k tbn, 50 tbc (default)
Metadata:
LANGUAGE : eng
HANDLER_NAME : DataHandler
TIMECODE : 10:00:00:00
ENCODER : Lavc56.57.100 libx264
DURATION : 00:00:57.640000000
Stream #0:1(eng): Audio: pcm_s24le, 48000 Hz, 2 channels, s32 (24
bit), 2304 kb/s (default)
Metadata:
LANGUAGE : eng
HANDLER_NAME : DataHandler
DURATION : 00:00:56.160000000
More information about the ffmpeg-user
mailing list