Kdenlive   bug tracker Home page

View Issue Details Jump to Notes ] Issue History ] Print ]
IDProjectCategoryView StatusDate SubmittedLast Update
0001351KdenliveUser Interfacepublic2009-12-22 22:512010-01-12 21:05
Reporterakirk 
Assigned To 
PrioritynormalSeverityminorReproducibilityalways
StatusnewResolutionopen 
Platformn/aOSn/aOS Versionn/a
Product VersionRecent git 
Target VersionFixed in Version 
Summary0001351: Clip monitor mis-functionings.
DescriptionI'm putting this in one report, thinking that all are related, and possibly related to 0001350 as well.
1) Clip -flashes- 1-2 frames before end and then rewinds. After the rewind, the Play button is correctly reset.
2) Set a zone. Still flashes at end of zone. Doesn't rewind clip unless unless zone end is last frame.
3) Play clip. Stop somewhere. Press rewind. Seeks to start of clip, but doesn't reset the 'Play' button, and unnecessarily uses processor to output frame 0 over and over. (another 'paint' solution?).
4) Set zone with start on frame 0, end < last frame. Play zone. use Monitor->goto->gotoclipstart. all ok.
5) Play clip. Before end press Shift-l. Still rewinds at end, but no processor usage.
Steps To Reproducefile included with 0001350 makes above easy to test.
Additional InformationPlease update mantis to allow Ubuntu 9.10!!
TagsNo tags attached.
Build/Install MethodManual build from SVN
Attached Files

- Relationships

-  Notes
(0004461)
akirk (reporter)
2010-01-03 08:18

Fix for clip-rewind problem:

renderer.c
static void consumer_frame_show(mlt_consumer, Render * self, mlt_frame frame_ptr)
{
    // detect if the producer has finished playing. Is there a better way to do it?
    if (self->m_isBlocked) return;
    Mlt::Frame frame(frame_ptr);
#ifdef Q_WS_MAC
    self->showFrame(frame);
#endif
    self->emitFrameNumber(mlt_frame_get_position(frame_ptr));
    if ( (frame.get_double("_speed") == 0.0) || ((mlt_frame_get_position(frame_ptr)==0 ) && (frame.get_double("_speed") < 0.0)) ) { // fixes rewind termination
        kDebug() << " AKAK " << mlt_frame_get_position(frame_ptr) << " end.";
        self->emitConsumerStopped();
    } else {
        kDebug() << " AKAK " << mlt_frame_get_position(frame_ptr); // this will show that -end-of-clip-missing-frame(s) problem.
    }
}
(0004463)
akirk (reporter)
2010-01-03 08:29
edited on: 2010-01-03 08:31

and:

monitor.cpp
void Monitor::rendererStopped(int pos)
{
  /* if (m_currentClip != NULL && m_playAction->isChecked()) {
        // Clip monitor
        if (pos >= m_length - 1) {
            slotStart();
            return;
        }
    } */
    m_ruler->slotNewValue(pos);
    checkOverlay();
    if (m_frametimecode) m_timePos->setText(QString::number(pos));
    else m_timePos->setText(m_monitorManager->timecode().getTimecodeFromFrames(pos));
    m_playAction->setChecked(false); // rendering has stopped, we do want these two actions taken
    m_playAction->setIcon(m_playIcon); // it's necessary on a 'rewind'
    m_monitorManager->stopActiveMonitor(); // AKAK stops the processor usage when rewind ends.
}

(0004468)
j-b-m (administrator)
2010-01-03 14:35

Thanks for your patches. I just committed a fix based on them (svn rev. 4195)
(0004479)
akirk (reporter)
2010-01-03 22:09

looks to me that
self->pause();
doesn't work because of:
void Render::pause()
{
    if (!m_mltProducer || !m_mltConsumer)
        return;
    if (m_mltProducer->get_speed() == 0.0) return; <--- do you ever need this line?
(0004480)
j-b-m (administrator)
2010-01-03 23:05

Seems to work for me.

self->pause() is called when speed < 0

in Render::pause(), the line you mentionned:

if (m_mltProducer->get_speed() == 0.0) return;

is here to prevent executing the pause() function several times, because if speed == 0, then the renderer is already in "pause" mode...

Do you have any problems using the monitor with my patch?
(0004482)
akirk (reporter)
2010-01-04 02:03

yes,

 m_playAction->setChecked(false);
 m_playAction->setIcon(m_playIcon);

still necessary as the 'play' button not reset.

i'm still using ----------------------------------------------

static void consumer_frame_show(mlt_consumer, Render * self, mlt_frame frame_ptr)
{
    // detect if the producer has finished playing. Is there a better way to do it?
    if (self->m_isBlocked) return;
    Mlt::Frame frame(frame_ptr);
#ifdef Q_WS_MAC
    self->showFrame(frame);
#endif
    int i = mlt_frame_get_position(frame_ptr);
    self->emitFrameNumber(i);
    if (frame.get_double("_speed") == 0.0) {
      kDebug() << " AKAK stop: speed 0 pos: " << i;
      self->emitConsumerStopped();
    } else if (frame.get_double("_speed") < 0.0 && i <= 0) {
        kDebug() << " AKAK stop: speed < 0 pos: "<< i;
        //self->pause();
        self->emitConsumerStopped();
    } else kDebug() << " AKAK pos " << i; // use this to view that the next-to-last frame is always drooped == the FLASH!!
}
(0004483)
j-b-m (administrator)
2010-01-04 05:35

Should be fine now (svn rev. 4200). I kept the call to pause(), since it avoids your change in monitor.cpp:

m_monitorManager->stopActiveMonitor()

that would otherwise call pause() whenever the renderer stops.

(0004489)
akirk (reporter)
2010-01-04 23:34

@ 4201 now. Looks good. Now I'm trying to find out what that "flash" is when the next-to-last frame is always dropped when playing any clip.

How do I turn on mlt logging?
(0004490)
j-b-m (administrator)
2010-01-05 00:22

I just committed another set of changes that cleanup the MLT / Monitor communication.

I think the "flash" you are talking about might be caused by the MLT "sdl_preview" consumer that is used in Kdenlive, and that switches between the "sdl" consumer and "sdl_still" consumer when the speed changes to 0...

You can test it by playing a clip with that consumer:

melt myclip.mpeg -consumer sdl_preview
(0004512)
akirk (reporter)
2010-01-12 21:05

I see what you mean when trying it in melt, and my 'flash' is not there.
Ia it possible that when the MLT "sdl_preview" consumer switches between the "sdl" consumer and "sdl_still" consumer, AND the last few frames of the "sdl" consumer have not been consumed (not displayed - no consumer_frame_show()), that the 'lost' frames are causing that flash?
The 'flash' is not just in the image area. If you have the preview window sized wider than necessary, and it is easier to see if you set the background to yellow, you can then see the entire preview window flash to black, at about the time the frames are dropped. Note this happens when drop_frames is off, with any type of clip. I get this action on any clip (or zone) of over 25 frames. I am running the debian libsdl.

- Issue History
Date Modified Username Field Change
2009-12-22 22:51 akirk New Issue
2010-01-03 08:18 akirk Note Added: 0004461
2010-01-03 08:29 akirk Note Added: 0004463
2010-01-03 08:30 akirk Note Added: 0004464
2010-01-03 08:31 akirk Note Edited: 0004463 View Revisions
2010-01-03 08:31 akirk Note Deleted: 0004464
2010-01-03 14:35 j-b-m Note Added: 0004468
2010-01-03 14:35 j-b-m Status new => feedback
2010-01-03 22:09 akirk Note Added: 0004479
2010-01-03 22:09 akirk Status feedback => new
2010-01-03 23:05 j-b-m Note Added: 0004480
2010-01-04 02:03 akirk Note Added: 0004482
2010-01-04 05:35 j-b-m Note Added: 0004483
2010-01-04 05:35 j-b-m Status new => feedback
2010-01-04 23:34 akirk Note Added: 0004489
2010-01-04 23:34 akirk Status feedback => new
2010-01-05 00:22 j-b-m Note Added: 0004490
2010-01-12 21:05 akirk Note Added: 0004512


Copyright © 2000 - 2014 MantisBT Team
Powered by Mantis Bugtracker