Opened 13 years ago
Closed 13 years ago
#384 closed defect (invalid)
Incorrect number of frames reported with .3gp file
Reported by: | Michael Richards | Owned by: | |
---|---|---|---|
Priority: | normal | Component: | undetermined |
Version: | unspecified | Keywords: | frame count |
Cc: | Blocked By: | ||
Blocking: | Reproduced by developer: | no | |
Analyzed by developer: | no |
Description
This problem was originally encountered debugging an openCV problem. ffmpeg reports an incorrect number of frames with .3gp files. I have verified this with 2 different sources.
GSpot reports 684 frames with the attached file and I have verified this by decoding and counting all the frames. ffmpeg however reports 813 frames. In another test I had a file with 10650 frames but ffmpeg reported 21309 frames. (file is 50mb so not included).
Attachments (1)
Change History (7)
by , 13 years ago
Attachment: | VID 00004-20100701-2206.3GP added |
---|
comment:1 by , 13 years ago
comment:2 by , 13 years ago
Status: | new → open |
---|
ffmpeg also reports 684 frames (either use -vsync 0 or subtract the duplicated frames - 129 - from the number of output frames).
Could you explain what your problem is? I don't think ffmpeg is designed to count frames (although it does work fine for the file you uploaded), maybe it works with ffprobe, I haven't used it much.
For this sample, the frame duplication does not happen for every container (avi), for your other sample, fps is probably misdetected.
comment:3 by , 13 years ago
Ok, this might not be an ffmpeg problem. OpenCV uses ffmpeg to get the frame count from a file so it might be its use of ffmpeg that is incorrect. I have not figured out a way to get ffprobe to give me the frame count but adding the vsync 0 to ffprobe appears to work. Can you let me know how to determine how many duplicates there are within ffmpeg?
comment:4 by , 13 years ago
Are you sure counting frames is what you really want to do?
(I ask because I suspect this is not your actual problem, which I still don't understand.)
You find the number of duplicated frames in a stream in FFmpeg's output, the second to last line (see your original post, search for "129").
comment:5 by , 13 years ago
Ok, I think I can use that to search the source and see how ffmpeg is determining this. I assume it can be found without decoding the entire video? I'm also taking it up with the opencv people and may submit a patch once I determine how to get the frame count.
comment:6 by , 13 years ago
Resolution: | → invalid |
---|---|
Status: | open → closed |
As said, I do not believe ffmpeg is designed to count frames, but unfortunately I do not understand your use-case.
Output that shows the frame count...
D:\>"c:\Program Files (x86)\ffmpeg\bin\ffmpeg" -i "VID 00004-20100701-2206.3GP" -f null /dev/null
ffmpeg version N-31774-g6c4e9ca, Copyright (c) 2000-2011 the FFmpeg developers
-enable-frei0r --enable-libopencore-amrnb --enable-libopencore-amrwb --enable-libfreetype --enable-libgsm --enable-libmp3lame --enab
le-libopenjpeg --enable-librtmp --enable-libschroedinger --enable-libspeex --enable-libtheora --enable-libvorbis --enable-libvpx --e
nable-libx264 --enable-libxavs --enable-libxvid --enable-zlib
Input #0, mov,mp4,m4a,3gp,3g2,mj2, from 'VID 00004-20100701-2206.3GP':
bc
[buffer @ 031A08C0] w:480 h:352 pixfmt:yuv420p tb:1/1000000 sar:1/1 sws_param:
Output #0, null, to '/dev/null':
Stream mapping:
Press [q] to stop, ? for help
frame= 813 fps= 0 q=0.0 Lsize= -0kB time=00:00:27.10 bitrate= -0.0kbits/s dup=129 drop=0
video:0kB audio:852kB global headers:0kB muxing overhead -100.002522%