After an evaluation, GNOME has moved from Bugzilla to GitLab. Learn more about GitLab.
No new issues can be reported in GNOME Bugzilla anymore.
To report an issue in a GNOME project, go to GNOME GitLab.
Do not go to GNOME Gitlab for: Bluefish, Doxygen, GnuCash, GStreamer, java-gnome, LDTP, NetworkManager, Tomboy.
Bug 313970 - ffdec_mpeg4 detects wrong framerate with some files
ffdec_mpeg4 detects wrong framerate with some files
Status: RESOLVED FIXED
Product: GStreamer
Classification: Platform
Component: gst-libav
0.8.6
Other Linux
: Normal critical
: 0.8.7
Assigned To: GStreamer Maintainers
GStreamer Maintainers
: 314971 317040 317370 318634 (view as bug list)
Depends on:
Blocks:
 
 
Reported: 2005-08-19 17:24 UTC by Arwed v. Merkatz
Modified: 2005-10-12 07:47 UTC
See Also:
GNOME target: ---
GNOME version: ---


Attachments
test file producing the broken behaviour (800.00 KB, video/x-msvideo)
2005-08-19 17:29 UTC, Arwed v. Merkatz
  Details
first try (3.72 KB, patch)
2005-09-27 19:02 UTC, Luca Ognibene
none Details | Review
second patch (6.53 KB, patch)
2005-10-01 12:52 UTC, Luca Ognibene
none Details | Review

Description Arwed v. Merkatz 2005-08-19 17:24:26 UTC
For some files ffdec_mpeg4 in gst-ffmpeg 0.8.6 tries to set a framerate of 30000
and thus fails to link to the videosink.
[gst-0.8] arwed@Otherland:~/Movies$ gst-launch-0.8 playbin uri=file://test.avi 
RUNNING pipeline ...
Waiting for the state change... ERROR (0x8069958 - 312353:20:50.685226000)     
       GST_PADS( 7609) gstpad.c(2562):gst_pad_set_explicit_caps:<ffdec_mpeg40>
failed to negotiate (try_set_caps with "video/x-raw-yuv, width=(int)352,
height=(int)256, framerate=(double)30000, format=(fourcc)I420,
pixel-aspect-ratio=(fraction)1/1" returned REFUSED)
ERROR: from element /internal_thread/decoder/ffdec_mpeg40: Internal GStreamer
error: pad problem.  File a bug.

Downgrading gst-ffmpeg to 0.8.5 fixes that problem, upgrading to cvs of
2005-08-19 doesn't.
Comment 1 Arwed v. Merkatz 2005-08-19 17:29:56 UTC
Created attachment 50993 [details]
test file producing the broken behaviour
Comment 2 Jürg Billeter 2005-08-23 00:57:24 UTC
Got exactly the same problem. It may have something to do with variable bit rate
movies where time_base is used for precision instead of frame rate. Precision
seems to be measured in frames/millisecond in ffmpeg while framerate is measured
in frames/second. The code in gstffmpegcodecmap.c doesn't seem to differentiate
between variable and constant framerate.

Both, the attached test case and my test video, are DivX 5 movies. They play
fine with gst-ffmpeg 0.8.5, ffplay, xvidcore.
Comment 3 Dominic Lachowicz 2005-08-31 19:03:53 UTC
*** Bug 314971 has been marked as a duplicate of this bug. ***
Comment 4 Luca Ognibene 2005-09-17 12:26:03 UTC
Well, i've looked at the problem.
ffmpeg reports the video as having 30000fps (i've also tried with current cvs).
In ffmpeg.c:3097 there is this check:

 if (enc->time_base.den != rfps || enc->time_base.num != rfps_base) { 
    fprintf(stderr,"\nSeems that stream %d comes from film source:
    ...
 }
 
where enc->time_base is the "framerate" information found by the decoder and
rfps the information found by the demuxer.
Then:

 /* update the current frame rate to match the stream frame rate */
            frame_rate      = rfps;
            frame_rate_base = rfps_base;
so ffmpeg always use the framerate information found by the demuxer.

If you try:
gst-launch-0.8 filesrc location="ffmpeg3000fps.avi" ! avidemux ! fakesink -v
you can see that the framerate is found correctly(framerate=(double)29.9699999).

So... what can we do? ffdec should set the framerate property only when there
isn't one already? Ronald, any idea?
Comment 5 Luca Ognibene 2005-09-24 10:34:54 UTC
More news in this thread:
http://mplayerhq.hu/pipermail/ffmpeg-devel/2005-September/003874.html
Comment 6 Luca Ognibene 2005-09-27 18:10:21 UTC
*** Bug 317040 has been marked as a duplicate of this bug. ***
Comment 7 Luca Ognibene 2005-09-27 19:02:35 UTC
Created attachment 52741 [details] [review]
first try

This patch uses the demuxer framerate if avaible. Otherwise it'll use ffmpeg's
one. I've done some tests and it seems to work fine.. please review :)
Comment 8 Ronald Bultje 2005-09-27 20:27:19 UTC
Looks good, thanks. I'll do a new release shortly, I messed up 0.8.6 a bit, I'm
affraid... Or maybe having bugs is just normal. :).
Comment 9 Luca Ognibene 2005-10-01 12:52:36 UTC
Created attachment 52909 [details] [review]
second patch

This patch fixes the previous patch (oops) and fix also #317596. yeah, it's
normal to make bugs ;)
I'll work better on this patch later (i hope..)
Comment 10 Luca Ognibene 2005-10-02 13:10:27 UTC
*** Bug 317370 has been marked as a duplicate of this bug. ***
Comment 11 Luca Ognibene 2005-10-02 13:28:03 UTC
Fixed. I've applied the second patch. Please help me testing :)
Comment 12 oll 2005-10-03 11:49:52 UTC
This patch solves all my bugs !! (slow mpeg and some other unable to read !!)

Thank you very much !!
Comment 13 Luca Ognibene 2005-10-12 07:47:02 UTC
*** Bug 318634 has been marked as a duplicate of this bug. ***