Opened 3 weeks ago

Last modified 2 weeks ago

#6793 new defect

Timecode of mp4 file from Sony FDR-AX100 camera not recognized

Reported by: tvolkert Owned by:
Priority: normal Component: avformat
Version: git-master Keywords: mov timecode
Cc: Blocked By:
Blocking: Reproduced by developer: no
Analyzed by developer: no

Description

Steps to reproduce

$ ffprobe -show_format -show_streams C0001.MP4
ffprobe version N-88289-g783535a4cd Copyright (c) 2007-2017 the FFmpeg developers
  built with Apple LLVM version 9.0.0 (clang-900.0.38)
  configuration: 
  libavutil      56.  0.100 / 56.  0.100
  libavcodec     58.  1.100 / 58.  1.100
  libavformat    58.  0.102 / 58.  0.102
  libavdevice    58.  0.100 / 58.  0.100
  libavfilter     7.  0.101 /  7.  0.101
  libswscale      5.  0.101 /  5.  0.101
  libswresample   3.  0.100 /  3.  0.100
Input #0, mov,mp4,m4a,3gp,3g2,mj2, from 'C0001.MP4':
  Metadata:
    major_brand     : XAVC
    minor_version   : 16785407
    compatible_brands: XAVCmp42iso2
    creation_time   : 2017-02-12T01:31:28.000000Z
  Duration: 00:00:49.05, start: 0.000000, bitrate: 97074 kb/s
    Stream #0:0(und): Video: h264 (High) (avc1 / 0x31637661), yuv420p(tv, bt709/bt709/iec61966-2-4), 3840x2160 [SAR 1:1 DAR 16:9], 95289 kb/s, 29.97 fps, 29.97 tbr, 30k tbn, 59.94 tbc (default)
    Metadata:
      creation_time   : 2017-02-12T01:31:28.000000Z
      handler_name    : Video Media Handler
      encoder         : AVC Coding
    Stream #0:1(und): Audio: pcm_s16be (twos / 0x736F7774), 48000 Hz, 2 channels, s16, 1536 kb/s (default)
    Metadata:
      creation_time   : 2017-02-12T01:31:28.000000Z
      handler_name    : Sound Media Handler
    Stream #0:2(und): Data: none (rtmd / 0x646D7472), 245 kb/s (default)
    Metadata:
      creation_time   : 2017-02-12T01:31:28.000000Z
      handler_name    : Timed Metadata Media Handler
      timecode        : 83:01:01;02
Unsupported codec with id 0 for input stream 2
[STREAM]
index=0
codec_name=h264
codec_long_name=H.264 / AVC / MPEG-4 AVC / MPEG-4 part 10
profile=High
codec_type=video
codec_time_base=1001/60000
codec_tag_string=avc1
codec_tag=0x31637661
width=3840
height=2160
coded_width=3840
coded_height=2160
has_b_frames=1
sample_aspect_ratio=1:1
display_aspect_ratio=16:9
pix_fmt=yuv420p
level=51
color_range=tv
color_space=bt709
color_transfer=iec61966-2-4
color_primaries=bt709
chroma_location=left
field_order=unknown
timecode=N/A
refs=1
is_avc=true
nal_length_size=4
id=N/A
r_frame_rate=30000/1001
avg_frame_rate=30000/1001
time_base=1/30000
start_pts=2002
start_time=0.066733
duration_ts=1471470
duration=49.049000
bit_rate=95289969
max_bit_rate=N/A
bits_per_raw_sample=8
nb_frames=1470
nb_read_frames=N/A
nb_read_packets=N/A
DISPOSITION:default=1
DISPOSITION:dub=0
DISPOSITION:original=0
DISPOSITION:comment=0
DISPOSITION:lyrics=0
DISPOSITION:karaoke=0
DISPOSITION:forced=0
DISPOSITION:hearing_impaired=0
DISPOSITION:visual_impaired=0
DISPOSITION:clean_effects=0
DISPOSITION:attached_pic=0
DISPOSITION:timed_thumbnails=0
TAG:creation_time=2017-02-12T01:31:28.000000Z
TAG:language=und
TAG:handler_name=Video Media Handler
TAG:encoder=AVC Coding
[/STREAM]
[STREAM]
index=1
codec_name=pcm_s16be
codec_long_name=PCM signed 16-bit big-endian
profile=unknown
codec_type=audio
codec_time_base=1/48000
codec_tag_string=twos
codec_tag=0x736f7774
sample_fmt=s16
sample_rate=48000
channels=2
channel_layout=unknown
bits_per_sample=16
id=N/A
r_frame_rate=0/0
avg_frame_rate=0/0
time_base=1/48000
start_pts=0
start_time=0.000000
duration_ts=2354352
duration=49.049000
bit_rate=1536000
max_bit_rate=N/A
bits_per_raw_sample=N/A
nb_frames=2354352
nb_read_frames=N/A
nb_read_packets=N/A
DISPOSITION:default=1
DISPOSITION:dub=0
DISPOSITION:original=0
DISPOSITION:comment=0
DISPOSITION:lyrics=0
DISPOSITION:karaoke=0
DISPOSITION:forced=0
DISPOSITION:hearing_impaired=0
DISPOSITION:visual_impaired=0
DISPOSITION:clean_effects=0
DISPOSITION:attached_pic=0
DISPOSITION:timed_thumbnails=0
TAG:creation_time=2017-02-12T01:31:28.000000Z
TAG:language=und
TAG:handler_name=Sound Media Handler
[/STREAM]
[STREAM]
index=2
codec_name=unknown
codec_long_name=unknown
profile=unknown
codec_type=data
codec_tag_string=rtmd
codec_tag=0x646d7472
id=N/A
r_frame_rate=0/0
avg_frame_rate=0/0
time_base=1/30000
start_pts=0
start_time=0.000000
duration_ts=1471470
duration=49.049000
bit_rate=245514
max_bit_rate=N/A
bits_per_raw_sample=N/A
nb_frames=1470
nb_read_frames=N/A
nb_read_packets=N/A
DISPOSITION:default=1
DISPOSITION:dub=0
DISPOSITION:original=0
DISPOSITION:comment=0
DISPOSITION:lyrics=0
DISPOSITION:karaoke=0
DISPOSITION:forced=0
DISPOSITION:hearing_impaired=0
DISPOSITION:visual_impaired=0
DISPOSITION:clean_effects=0
DISPOSITION:attached_pic=0
DISPOSITION:timed_thumbnails=0
TAG:creation_time=2017-02-12T01:31:28.000000Z
TAG:language=und
TAG:handler_name=Timed Metadata Media Handler
TAG:timecode=83:01:01;02
[/STREAM]
[FORMAT]
filename=C0001.MP4
nb_streams=3
nb_programs=0
format_name=mov,mp4,m4a,3gp,3g2,mj2
format_long_name=QuickTime / MOV
start_time=0.000000
duration=49.049000
size=595175729
bit_rate=97074473
probe_score=100
TAG:major_brand=XAVC
TAG:minor_version=16785407
TAG:compatible_brands=XAVCmp42iso2
TAG:creation_time=2017-02-12T01:31:28.000000Z
[/FORMAT]

Sample file

http://50.19.4.114/bugs/ffmpeg/C0001.MP4 (caution: 568M)

Other info

This looks like https://trac.ffmpeg.org/ticket/5645, except that I've built from master (git://source.ffmpeg.org/ffmpeg.git) and see d693392 in my Git rev history, so I should already have that fix. Here's my revision of ffprobe (ffmpeg shows the same):

$ ffprobe -version
ffprobe version N-88289-g783535a4cd Copyright (c) 2007-2017 the FFmpeg developers
built with Apple LLVM version 9.0.0 (clang-900.0.38)
configuration: 
libavutil      56.  0.100 / 56.  0.100
libavcodec     58.  1.100 / 58.  1.100
libavformat    58.  0.102 / 58.  0.102
libavdevice    58.  0.100 / 58.  0.100
libavfilter     7.  0.101 /  7.  0.101
libswscale      5.  0.101 /  5.  0.101
libswresample   3.  0.100 /  3.  0.100

Change History (6)

comment:1 in reply to: ↑ description Changed 3 weeks ago by cehoyos

  • Cc cehoyos removed
  • Keywords mov timecode added

Replying to tvolkert:

TAG:timecode=83:01:01;02

Is this wrong?

comment:2 Changed 3 weeks ago by tvolkert

I don't know since I don't even know what data that stream holds...

However, I assume the file is valid, since it's unmodified from the camera. The file also plays fine, fwiw

comment:3 Changed 3 weeks ago by tvolkert

Incidentally, I noticed that I get this exact same error on a movie that was cut from two clips from these model video cameras -- edited and exported via FinalCutPro? X (which had no problem with the clips)

$ ffprobe -show_format -show_streams clip.mov
ffprobe version N-88289-g783535a4cd Copyright (c) 2007-2017 the FFmpeg developers
  built with Apple LLVM version 9.0.0 (clang-900.0.38)
  configuration: 
  libavutil      56.  0.100 / 56.  0.100
  libavcodec     58.  1.100 / 58.  1.100
  libavformat    58.  0.102 / 58.  0.102
  libavdevice    58.  0.100 / 58.  0.100
  libavfilter     7.  0.101 /  7.  0.101
  libswscale      5.  0.101 /  5.  0.101
  libswresample   3.  0.100 /  3.  0.100
Input #0, mov,mp4,m4a,3gp,3g2,mj2, from 'clip.mov':
  Metadata:
    major_brand     : qt  
    minor_version   : 0
    compatible_brands: qt  
    creation_time   : 2017-02-21T06:52:10.000000Z
    com.apple.quicktime.keywords: <redacted>
    com.apple.quicktime.description: <redacted>
    com.apple.quicktime.author: <redacted>
    com.apple.quicktime.displayname: <redacted>
    com.apple.quicktime.title: <redacted>
  Duration: 00:02:32.15, start: 0.000000, bitrate: 62561 kb/s
    Stream #0:0(und): Video: h264 (High) (avc1 / 0x31637661), yuv420p(tv, bt709, progressive), 3840x2160 [SAR 1:1 DAR 16:9], 62266 kb/s, 29.97 fps, 29.97 tbr, 30k tbn, 50 tbc (default)
    Metadata:
      creation_time   : 2017-02-21T06:52:11.000000Z
      handler_name    : Core Media Data Handler
      encoder         : H.264
      timecode        : 00:00:00:00
    Stream #0:1(und): Audio: aac (LC) (mp4a / 0x6134706D), 48000 Hz, stereo, fltp, 125 kb/s (default)
    Metadata:
      creation_time   : 2017-02-21T06:52:11.000000Z
      handler_name    : Core Media Data Handler
    Stream #0:2(und): Data: none (tmcd / 0x64636D74) (default)
    Metadata:
      creation_time   : 2017-02-21T06:52:11.000000Z
      handler_name    : Core Media Data Handler
      timecode        : 00:00:00:00
Unsupported codec with id 0 for input stream 2
[STREAM]
index=0
codec_name=h264
codec_long_name=H.264 / AVC / MPEG-4 AVC / MPEG-4 part 10
profile=High
codec_type=video
codec_time_base=1001/60000
codec_tag_string=avc1
codec_tag=0x31637661
width=3840
height=2160
coded_width=3840
coded_height=2160
has_b_frames=0
sample_aspect_ratio=1:1
display_aspect_ratio=16:9
pix_fmt=yuv420p
level=51
color_range=tv
color_space=bt709
color_transfer=bt709
color_primaries=bt709
chroma_location=left
field_order=progressive
timecode=N/A
refs=1
is_avc=true
nal_length_size=4
id=N/A
r_frame_rate=30000/1001
avg_frame_rate=30000/1001
time_base=1/30000
start_pts=0
start_time=0.000000
duration_ts=4564560
duration=152.152000
bit_rate=62266240
max_bit_rate=N/A
bits_per_raw_sample=8
nb_frames=4560
nb_read_frames=N/A
nb_read_packets=N/A
DISPOSITION:default=1
DISPOSITION:dub=0
DISPOSITION:original=0
DISPOSITION:comment=0
DISPOSITION:lyrics=0
DISPOSITION:karaoke=0
DISPOSITION:forced=0
DISPOSITION:hearing_impaired=0
DISPOSITION:visual_impaired=0
DISPOSITION:clean_effects=0
DISPOSITION:attached_pic=0
DISPOSITION:timed_thumbnails=0
TAG:creation_time=2017-02-21T06:52:11.000000Z
TAG:language=und
TAG:handler_name=Core Media Data Handler
TAG:encoder=H.264
TAG:timecode=00:00:00:00
[/STREAM]
[STREAM]
index=1
codec_name=aac
codec_long_name=AAC (Advanced Audio Coding)
profile=LC
codec_type=audio
codec_time_base=1/48000
codec_tag_string=mp4a
codec_tag=0x6134706d
sample_fmt=fltp
sample_rate=48000
channels=2
channel_layout=stereo
bits_per_sample=0
id=N/A
r_frame_rate=0/0
avg_frame_rate=0/0
time_base=1/48000
start_pts=0
start_time=0.000000
duration_ts=7303296
duration=152.152000
bit_rate=125221
max_bit_rate=128000
bits_per_raw_sample=N/A
nb_frames=7135
nb_read_frames=N/A
nb_read_packets=N/A
DISPOSITION:default=1
DISPOSITION:dub=0
DISPOSITION:original=0
DISPOSITION:comment=0
DISPOSITION:lyrics=0
DISPOSITION:karaoke=0
DISPOSITION:forced=0
DISPOSITION:hearing_impaired=0
DISPOSITION:visual_impaired=0
DISPOSITION:clean_effects=0
DISPOSITION:attached_pic=0
DISPOSITION:timed_thumbnails=0
TAG:creation_time=2017-02-21T06:52:11.000000Z
TAG:language=und
TAG:handler_name=Core Media Data Handler
[/STREAM]
[STREAM]
index=2
codec_name=unknown
codec_long_name=unknown
profile=unknown
codec_type=data
codec_tag_string=tmcd
codec_tag=0x64636d74
id=N/A
r_frame_rate=0/0
avg_frame_rate=30/1
time_base=1/30000
start_pts=0
start_time=0.000000
duration_ts=4564560
duration=152.152000
bit_rate=N/A
max_bit_rate=N/A
bits_per_raw_sample=N/A
nb_frames=1
nb_read_frames=N/A
nb_read_packets=N/A
DISPOSITION:default=1
DISPOSITION:dub=0
DISPOSITION:original=0
DISPOSITION:comment=0
DISPOSITION:lyrics=0
DISPOSITION:karaoke=0
DISPOSITION:forced=0
DISPOSITION:hearing_impaired=0
DISPOSITION:visual_impaired=0
DISPOSITION:clean_effects=0
DISPOSITION:attached_pic=0
DISPOSITION:timed_thumbnails=0
TAG:creation_time=2017-02-21T06:52:11.000000Z
TAG:language=und
TAG:handler_name=Core Media Data Handler
TAG:timecode=00:00:00:00
[/STREAM]
[FORMAT]
filename=clip.mov
nb_streams=3
nb_programs=0
format_name=mov,mp4,m4a,3gp,3g2,mj2
format_long_name=QuickTime / MOV
start_time=0.000000
duration=152.152000
size=1189858836
bit_rate=62561587
probe_score=100
TAG:major_brand=qt  
TAG:minor_version=0
TAG:compatible_brands=qt  
TAG:creation_time=2017-02-21T06:52:10.000000Z
TAG:com.apple.quicktime.keywords=<redacted>
TAG:com.apple.quicktime.description=<redacted>
TAG:com.apple.quicktime.author=<redacted>
TAG:com.apple.quicktime.displayname=<redacted>
TAG:com.apple.quicktime.title=<redacted>
[/FORMAT]

comment:4 Changed 3 weeks ago by tvolkert

In case it didn't stand out in comment:3, the timecode looks more sane in that file:

TAG:timecode=00:00:00:00

comment:5 Changed 2 weeks ago by tvolkert

Here's a smaller sample file:

http://50.19.4.114/bugs/ffmpeg/C0088.MP4 (51M)

I run into this problem with any files generated from that model camera (I've tried both my cameras). Any idea where the problem lies?

comment:6 Changed 2 weeks ago by cehoyos

Your original report was that FFmpeg does not recognize the timecode for this camera but I see a timecode:

$ ffmpeg -i C0088.MP4
ffmpeg version N-88541-g3357b68 Copyright (c) 2000-2017 the FFmpeg developers
  built with gcc 6.3.0 (GCC)
  configuration: --enable-gpl
  libavutil      56.  0.100 / 56.  0.100
  libavcodec     58.  1.100 / 58.  1.100
  libavformat    58.  0.102 / 58.  0.102
  libavdevice    58.  0.100 / 58.  0.100
  libavfilter     7.  0.101 /  7.  0.101
  libswscale      5.  0.101 /  5.  0.101
  libswresample   3.  0.101 /  3.  0.101
  libpostproc    55.  0.100 / 55.  0.100
[mov,mp4,m4a,3gp,3g2,mj2 @ 0x3a10240] st: 0 edit list: 1 Missing key frame while searching for timestamp: 1001
[mov,mp4,m4a,3gp,3g2,mj2 @ 0x3a10240] st: 0 edit list 1 Cannot find an index entry before timestamp: 1001.
Rounding edit list media time to zero.
Guessed Channel Layout for Input Stream #0.1 : stereo
Input #0, mov,mp4,m4a,3gp,3g2,mj2, from 'C0088.MP4':
  Metadata:
    major_brand     : XAVC
    minor_version   : 16785407
    compatible_brands: XAVCmp42iso2
    creation_time   : 2017-11-04T23:25:24.000000Z
  Duration: 00:00:04.50, start: 0.000000, bitrate: 95011 kb/s
    Stream #0:0(und): Video: h264 (High) (avc1 / 0x31637661), yuv420p(tv, bt709/bt709/iec61966-2-4), 3840x2160 [SAR 1:1 DAR 16:9], 93221 kb/s, 29.97 fps, 29.97 tbr, 30k tbn, 59.94 tbc (default)
    Metadata:
      creation_time   : 2017-11-04T23:25:24.000000Z
      handler_name    : Video Media Handler
      encoder         : AVC Coding
    Stream #0:1(und): Audio: pcm_s16be (twos / 0x736F7774), 48000 Hz, stereo, s16, 1536 kb/s (default)
    Metadata:
      creation_time   : 2017-11-04T23:25:24.000000Z
      handler_name    : Sound Media Handler
    Stream #0:2(und): Data: none (rtmd / 0x646D7472), 245 kb/s (default)
    Metadata:
      creation_time   : 2017-11-04T23:25:24.000000Z
      handler_name    : Timed Metadata Media Handler
      timecode        : 83:01:01;02
At least one output file must be specified

Is it wrong?
What is the correct timecode?

Note: See TracTickets for help on using tickets.