[FFmpeg-user] Error extracting images from .mov with timecode

Dario diarrhio at gmail.com
Thu May 19 23:46:17 CEST 2011


Hi,

We have a .mov file which has a timecode track in it, which seems to be
causing ffmpeg lots of fits when extracting jpegs out of it. I'm using the
latest windows binary found on http://ffmpeg.zeranoe.com/builds/

I first tried extracting the jpegs out like this:

ffmpeg.exe -i inputmovie.mov -y Output\Image%06d.jpg

When running the above, I get the first frame of video duplicated about 2700
times, then I get *948* frames of the actual video.

So, I then ran ffprobe.exe to extract the timecode information out of the
video: Here is the output from ffprobe.exe:

Unsupported codec with id 0 for input stream 2
[STREAM]
index=0
codec_name=pcm_s16be
codec_long_name=PCM signed 16-bit big-endian
codec_type=audio
codec_time_base=0/1
codec_tag_string=twos
codec_tag=0x736f7774
sample_rate=48000.000000
channels=2
bits_per_sample=16
r_frame_rate=0/0
avg_frame_rate=7575/158
time_base=1/48000
start_time=0.000000
duration=39.528333
nb_frames=1897360
TAG:creation_time=2011-05-03 20:16:26
TAG:language=eng
[/STREAM]
[STREAM]
index=1
codec_name=mjpeg
codec_long_name=MJPEG (Motion JPEG)
codec_type=video
codec_time_base=1/23976
codec_tag_string=jpeg
codec_tag=0x6765706a
width=960
height=540
has_b_frames=0
sample_aspect_ratio=72:72
display_aspect_ratio=16:9
pix_fmt=yuvj420p
r_frame_rate=2997/125
avg_frame_rate=2997/125
time_base=1/23976
start_time=-0.003003
duration=39.539540
nb_frames=948
TAG:creation_time=2011-05-03 20:16:26
TAG:language=eng
[/STREAM]
[STREAM]
index=2
codec_name=unknown
codec_type=data
codec_time_base=0/1
codec_tag_string=tmcd
codec_tag=0x64636d74
r_frame_rate=0/0
avg_frame_rate=0/0
time_base=1/600
start_time=-108.695000
duration=162.286667
nb_frames=1
TAG:creation_time=2011-05-03 20:16:26
TAG:language=eng
[/STREAM]

As you can see there are *948* frames in the video (as is confirmed by
Quicktime). In addition, the start_time in the timecode stream is
-108.695000.

So, I then tried to pass the timecode start_time value as the -ss value like
so:

ffmpeg.exe -i inputmovie.mov -ss 108.695 -y Output\Image%06d.jpg

However, this only extracts *947* jpegs. I also tried passing the duration
as the -t value, but it didn't help. I am stuck either getting tons of
duplicate images or getting one frame less than the number of frames in the
video.

I also tried the -vcodec copy option instead of specifying the -ss option,
which worked wonderfully and extracted 948 frames, except that it only seems
to work on motion jpegs and no other codecs... my utility needs to work on
any type of codec ffmpeg supports.

So, I'm stuck. I'm wondering if this is a bug or if I'm just using ffmpeg
improperly. Any help would be appreciated.

Thanks,
Dario


More information about the ffmpeg-user mailing list