Opened 12 years ago
Closed 12 years ago
#1817 closed defect (fixed)
create_time contains wrong value for Canon EOS 550D movies
Reported by: | Przemek Wesołek | Owned by: | |
---|---|---|---|
Priority: | important | Component: | avformat |
Version: | git-master | Keywords: | mov creation_time regression |
Cc: | Blocked By: | ||
Blocking: | Reproduced by developer: | yes | |
Analyzed by developer: | no |
Description
When working with H.264 movies from my Canon I spotted the wrong value of timestamps. E.g. for the attached file:
$ ffprobe MVI_5302.MOV ffprobe version N-36547-gb08273c Copyright (c) 2007-2012 the FFmpeg developers built on Oct 15 2012 12:52:06 with gcc 4.6 (Ubuntu/Linaro 4.6.3-1ubuntu5) configuration: --enable-gpl --enable-libfaac --enable-libmp3lame --enable-libopencore-amrnb --enable-libopencore-amrwb --enable-librtmp --enable-libtheora --enable-libvorbis --enable-libvpx --enable-x11grab --enable-libx264 --enable-nonfree --enable-version3 libavutil 51. 76.100 / 51. 76.100 libavcodec 54. 66.100 / 54. 66.100 libavformat 54. 32.101 / 54. 32.101 libavdevice 54. 3.100 / 54. 3.100 libavfilter 3. 19.102 / 3. 19.102 libswscale 2. 1.101 / 2. 1.101 libswresample 0. 16.100 / 0. 16.100 libpostproc 52. 1.100 / 52. 1.100 Input #0, mov,mp4,m4a,3gp,3g2,mj2, from 'MVI_5302.MOV': Metadata: major_brand : qt minor_version : 537331968 compatible_brands: qt CAEP creation_time : 1942-09-10 06:13:06 Duration: 00:00:01.04, start: 0.000000, bitrate: 38744 kb/s Stream #0:0(eng): Video: h264 (Constrained Baseline) (avc1 / 0x31637661), yuvj420p, 1920x1080, 37195 kb/s, 25 fps, 25 tbr, 25k tbn, 50k tbc Metadata: creation_time : 1942-09-10 06:13:06 Stream #0:1(eng): Audio: pcm_s16le (sowt / 0x74776F73), 48000 Hz, 2 channels, s16, 1536 kb/s Metadata: creation_time : 1942-09-10 06:13:06
In other software it's OK:
$ mplayer MVI_5302.MOV MPlayer2 UNKNOWN (C) 2000-2011 MPlayer Team mplayer: could not connect to socket mplayer: No such file or directory Failed to open LIRC support. You will not be able to use your remote control. Playing MVI_5302.MOV. Detected file format: QuickTime/MPEG-4/Motion JPEG 2000 format (libavformat) [lavf] stream 0: video (h264), -vid 0 [lavf] stream 1: audio (pcm_s16le), -aid 0, -alang eng VIDEO: [H264] 1920x1088 24bpp 25.000 fps 37195.8 kbps (4540.5 kbyte/s) Clip info: major_brand: qt minor_version: 537331968 compatible_brands: qt CAEP creation_time: 2012-10-15 12:41:22
I'm pretty sure it used to work on older versions, as I was transcoding my home video for some time.
Attachments (1)
Change History (11)
by , 12 years ago
Attachment: | MVI_5304.MOV added |
---|
comment:1 by , 12 years ago
I'm sorry, the file mentioned in the description is too large to attach. Here is a smaller one with the same problem:
$ ffprobe MVI_5304.MOV ffprobe version N-36547-gb08273c Copyright (c) 2007-2012 the FFmpeg developers built on Oct 15 2012 12:52:06 with gcc 4.6 (Ubuntu/Linaro 4.6.3-1ubuntu5) configuration: --enable-gpl --enable-libfaac --enable-libmp3lame --enable-libopencore-amrnb --enable-libopencore-amrwb --enable-librtmp --enable-libtheora --enable-libvorbis --enable-libvpx --enable-x11grab --enable-libx264 --enable-nonfree --enable-version3 libavutil 51. 76.100 / 51. 76.100 libavcodec 54. 66.100 / 54. 66.100 libavformat 54. 32.101 / 54. 32.101 libavdevice 54. 3.100 / 54. 3.100 libavfilter 3. 19.102 / 3. 19.102 libswscale 2. 1.101 / 2. 1.101 libswresample 0. 16.100 / 0. 16.100 libpostproc 52. 1.100 / 52. 1.100 Input #0, mov,mp4,m4a,3gp,3g2,mj2, from 'MVI_5304.MOV': Metadata: major_brand : qt minor_version : 537331968 compatible_brands: qt CAEP creation_time : 1942-09-10 06:48:43 Duration: 00:00:01.02, start: 0.000000, bitrate: 18889 kb/s Stream #0:0(eng): Video: h264 (Constrained Baseline) (avc1 / 0x31637661), yuvj420p, 640x480, 17337 kb/s, 50 fps, 50 tbr, 50k tbn, 100k tbc Metadata: creation_time : 1942-09-10 06:48:43 Stream #0:1(eng): Audio: pcm_s16le (sowt / 0x74776F73), 48000 Hz, 2 channels, s16, 1536 kb/s Metadata: creation_time : 1942-09-10 06:48:43
comment:2 by , 12 years ago
Keywords: | mov creation_time added |
---|
comment:3 by , 12 years ago
Resolution: | → worksforme |
---|---|
Status: | new → closed |
I am unable to reproduce the problem, both the version you tested and current git head show "2012":
$ ffprobe MVI_5304.MOV ffprobe version N-45533-gb08273c Copyright (c) 2007-2012 the FFmpeg developers built on Oct 15 2012 17:40:13 with gcc 4.7 (SUSE Linux) configuration: --enable-gpl --enable-libfaac --enable-libmp3lame --enable-libopencore-amrnb --enable-libopencore-amrwb --enable-librtmp --enable-libtheora --enable-libvorbis --enable-libvpx --enable-x11grab --enable-libx264 --enable-nonfree --enable-version3 libavutil 51. 76.100 / 51. 76.100 libavcodec 54. 66.100 / 54. 66.100 libavformat 54. 32.101 / 54. 32.101 libavdevice 54. 3.100 / 54. 3.100 libavfilter 3. 19.102 / 3. 19.102 libswscale 2. 1.101 / 2. 1.101 libswresample 0. 16.100 / 0. 16.100 libpostproc 52. 1.100 / 52. 1.100 Input #0, mov,mp4,m4a,3gp,3g2,mj2, from 'MVI_5304.MOV': Metadata: major_brand : qt minor_version : 537331968 compatible_brands: qt CAEP creation_time : 2012-10-15 13:16:59 Duration: 00:00:01.02, start: 0.000000, bitrate: 18889 kb/s Stream #0:0(eng): Video: h264 (Constrained Baseline) (avc1 / 0x31637661), yuvj420p, 640x480, 17337 kb/s, 50 fps, 50 tbr, 50k tbn, 100k tbc Metadata: creation_time : 2012-10-15 13:16:59 Stream #0:1(eng): Audio: pcm_s16le (sowt / 0x74776F73), 48000 Hz, 2 channels, s16, 1536 kb/s Metadata: creation_time : 2012-10-15 13:16:59
The only thing I cannot explain is why the version information shows "N-45533-gb08273c" here, but "N-36547-gb08273c" for you. Could you try to recompile (after make distclean)?
$ ffmpeg -i MVI_5304.MOV ffmpeg version N-45552-g3f81489 Copyright (c) 2000-2012 the FFmpeg developers built on Oct 15 2012 17:46:54 with gcc 4.7 (SUSE Linux) configuration: --enable-gpl libavutil 51. 76.100 / 51. 76.100 libavcodec 54. 66.100 / 54. 66.100 libavformat 54. 32.101 / 54. 32.101 libavdevice 54. 3.100 / 54. 3.100 libavfilter 3. 19.102 / 3. 19.102 libswscale 2. 1.101 / 2. 1.101 libswresample 0. 16.100 / 0. 16.100 libpostproc 52. 1.100 / 52. 1.100 Guessed Channel Layout for Input Stream #0.1 : stereo Input #0, mov,mp4,m4a,3gp,3g2,mj2, from 'MVI_5304.MOV': Metadata: major_brand : qt minor_version : 537331968 compatible_brands: qt CAEP creation_time : 2012-10-15 13:16:59 Duration: 00:00:01.02, start: 0.000000, bitrate: 18889 kb/s Stream #0:0(eng): Video: h264 (Constrained Baseline) (avc1 / 0x31637661), yuvj420p, 640x480, 17337 kb/s, 50 fps, 50 tbr, 50k tbn, 100k tbc Metadata: creation_time : 2012-10-15 13:16:59 Stream #0:1(eng): Audio: pcm_s16le (sowt / 0x74776F73), 48000 Hz, stereo, s16, 1536 kb/s Metadata: creation_time : 2012-10-15 13:16:59 At least one output file must be specified
comment:4 by , 12 years ago
Resolution: | worksforme |
---|---|
Status: | closed → reopened |
I tried to git bisect
, but the history is horrible and git goes awry. One time it is avprobe
(which works), an other it's ffprobe
(which doesn't); git blame
on suspected libavformat/mov.c
reveal all the content replaced with commit fafd844
, which doesn't have any parents... The same for current master (8cbb8f5
). Can't get my head around it, really...
Anyway, what I could verify is that releases/0.11
works and releases/1.0
doesn't. Always building from clean git repo with:
./configure --enable-gpl --enable-libfaac --enable-libmp3lame --enable-libopencore-amrnb --enable-libopencore-amrwb --enable-librtmp --enable-libtheora --enable-libvorbis --enable-x11grab --enable-libx264 --enable-nonfree --enable-version3 make
gives for 0.11.2:
ffmpeg version 0.11.2 Copyright (c) 2000-2012 the FFmpeg developers built on Oct 15 2012 18:00:21 with gcc 4.6.3 configuration: --enable-gpl --enable-libfaac --enable-libmp3lame --enable-libopencore-amrnb --enable-libopencore-amrwb --enable-librtmp --enable-libtheora --enable-libvorbis --enable-x11grab --enable-libx264 --enable-nonfree --enable-version3 libavutil 51. 54.100 / 51. 54.100 libavcodec 54. 23.100 / 54. 23.100 libavformat 54. 6.100 / 54. 6.100 libavdevice 54. 0.100 / 54. 0.100 libavfilter 2. 77.100 / 2. 77.100 libswscale 2. 1.100 / 2. 1.100 libswresample 0. 15.100 / 0. 15.100 libpostproc 52. 0.100 / 52. 0.100 Input #0, mov,mp4,m4a,3gp,3g2,mj2, from 'MVI_5304.MOV': Metadata: major_brand : qt minor_version : 537331968 compatible_brands: qt CAEP creation_time : 2012-10-15 13:16:59 Duration: 00:00:01.02, start: 0.000000, bitrate: 18889 kb/s Stream #0:0(eng): Video: h264 (Constrained Baseline) (avc1 / 0x31637661), yuvj420p, 640x480, 17337 kb/s, 50 fps, 50 tbr, 50k tbn, 100k tbc Metadata: creation_time : 2012-10-15 13:16:59 Stream #0:1(eng): Audio: pcm_s16le (sowt / 0x74776F73), 48000 Hz, stereo, s16, 1536 kb/s Metadata: creation_time : 2012-10-15 13:16:59
and for 1.0:
ffmpeg version 1.0 Copyright (c) 2000-2012 the FFmpeg developers built on Oct 15 2012 18:16:01 with gcc 4.6 (Ubuntu/Linaro 4.6.3-1ubuntu5) configuration: --enable-gpl --enable-libfaac --enable-libmp3lame --enable-libopencore-amrnb --enable-libopencore-amrwb --enable-librtmp --enable-libtheora --enable-libvorbis --enable-x11grab --enable-libx264 --enable-nonfree --enable-version3 libavutil 51. 73.101 / 51. 73.101 libavcodec 54. 59.100 / 54. 59.100 libavformat 54. 29.104 / 54. 29.104 libavdevice 54. 2.101 / 54. 2.101 libavfilter 3. 17.100 / 3. 17.100 libswscale 2. 1.101 / 2. 1.101 libswresample 0. 15.100 / 0. 15.100 libpostproc 52. 0.100 / 52. 0.100 Guessed Channel Layout for Input Stream #0.1 : stereo Input #0, mov,mp4,m4a,3gp,3g2,mj2, from 'MVI_5304.MOV': Metadata: major_brand : qt minor_version : 537331968 compatible_brands: qt CAEP creation_time : 1942-09-10 06:48:43 Duration: 00:00:01.02, start: 0.000000, bitrate: 18889 kb/s Stream #0:0(eng): Video: h264 (Constrained Baseline) (avc1 / 0x31637661), yuvj420p, 640x480, 17337 kb/s, 50 fps, 50 tbr, 50k tbn, 100k tbc Metadata: creation_time : 1942-09-10 06:48:43 Stream #0:1(eng): Audio: pcm_s16le (sowt / 0x74776F73), 48000 Hz, stereo, s16, 1536 kb/s Metadata: creation_time : 1942-09-10 06:48:43
Can it be any problem with libraries, or all container decoding takes place in ffmpeg source exclusively?
comment:5 by , 12 years ago
Here's what fixes situation:
index bf695e7..b2594db 100644 --- a/libavformat/mov.c +++ b/libavformat/mov.c @@ -783,7 +783,6 @@ static void mov_metadata_creation_time(AVDictionary **metadata, time_t time) char buffer[32]; if (time) { struct tm *ptm; - if(time >= 2082844800) time -= 2082844800; /* seconds between 1904-01-01 and Epoch */ ptm = gmtime(&time); if (!ptm) return;
Looks like it was introduced due to #1471, in GitHub repo it's https://github.com/FFmpeg/FFmpeg/commit/23eeffcd48a15e73fb2649b712870b6d101c5471 (I can't find this commit in git://source.ffmpeg.org/ffmpeg.git).
After applying the above change the date is shown correctly:
ffmpeg version git-2012-10-15-3ca8a23 Copyright (c) 2000-2012 the FFmpeg developers built on Oct 15 2012 19:31:14 with gcc 4.6 (Ubuntu/Linaro 4.6.3-1ubuntu5) configuration: --enable-gpl --enable-libfaac --enable-libmp3lame --enable-libopencore-amrnb --enable-libopencore-amrwb --enable-librtmp --enable-libtheora --enable-libvorbis --enable-libvpx --enable-x11grab --enable-libx264 --enable-nonfree --enable-version3 libavutil 51. 76.100 / 51. 76.100 libavcodec 54. 66.100 / 54. 66.100 libavformat 54. 32.101 / 54. 32.101 libavdevice 54. 3.100 / 54. 3.100 libavfilter 3. 19.102 / 3. 19.102 libswscale 2. 1.101 / 2. 1.101 libswresample 0. 16.100 / 0. 16.100 libpostproc 52. 1.100 / 52. 1.100 Guessed Channel Layout for Input Stream #0.1 : stereo Input #0, mov,mp4,m4a,3gp,3g2,mj2, from 'MVI_5304.MOV': Metadata: major_brand : qt minor_version : 537331968 compatible_brands: qt CAEP creation_time : 2012-10-15 13:16:59 Duration: 00:00:01.02, start: 0.000000, bitrate: 18889 kb/s Stream #0:0(eng): Video: h264 (Constrained Baseline) (avc1 / 0x31637661), yuvj420p, 640x480, 17337 kb/s, 50 fps, 50 tbr, 50k tbn, 100k tbc Metadata: creation_time : 2012-10-15 13:16:59 Stream #0:1(eng): Audio: pcm_s16le (sowt / 0x74776F73), 48000 Hz, stereo, s16, 1536 kb/s Metadata: creation_time : 2012-10-15 13:16:59
comment:6 by , 12 years ago
Component: | undetermined → avformat |
---|---|
Keywords: | regression added |
Priority: | normal → important |
Reproduced by developer: | set |
Status: | reopened → open |
Regression since 23eeffcd (related to ticket #1471), only reproducible with a 32bit executable here.
follow-up: 8 comment:7 by , 12 years ago
OK, I found the direct reason for misbehavior (thanks for notifying 32-bit specificity).
The problem lies in the condition
if(time >= 2082844800)
never evaluating to true for time
values 1904-01-01-based, because they are greater than 0x80000000 and are treated as signed in this context, resulting in negative value for time
.
The solution (or rather a workaround?) is to force unsigned long
context
if(time >= 2082844800UL)
after which the bug doesn't occur.
follow-up: 9 comment:8 by , 12 years ago
Replying to pwes:
The solution (or rather a workaround?) is to force
unsigned long
context
if(time >= 2082844800UL)
Would you like to send a patch to ffmpeg-devel?
comment:9 by , 12 years ago
Replying to cehoyos:
Would you like to send a patch to ffmpeg-devel?
Sure, no problem, although I'm not into ffmpeg very much, so I hope somebody will take a look before applying. :)
comment:10 by , 12 years ago
Resolution: | → fixed |
---|---|
Status: | open → closed |
thanks for debuging and analyzing this bug, i fixed it based on that.
exemplary file