void Monitor::slotExtractCurrentFrame()
{
- QImage frame = render->extractFrame(render->seekFramePosition());
+ QImage frame;
+ // check if we are using a proxy
+ if (m_currentClip && !m_currentClip->getProperty("proxy").isEmpty() && m_currentClip->getProperty("proxy") != "-") {
+ // using proxy, use original clip url to get frame
+ frame = render->extractFrame(render->seekFramePosition(), m_currentClip->fileURL().path());
+ }
+ else frame = render->extractFrame(render->seekFramePosition());
KFileDialog *fs = new KFileDialog(KUrl(), "image/png", this);
fs->setOperationMode(KFileDialog::Saving);
fs->setMode(KFile::File);
return m_mltProfile->height();
}
-QImage Render::extractFrame(int frame_position, int width, int height)
+QImage Render::extractFrame(int frame_position, QString path, int width, int height)
{
if (width == -1) {
width = renderWidth();
height = renderHeight();
} else if (width % 2 == 1) width++;
- if (!m_mltProducer) {
+ if (!path.isEmpty()) {
+ Mlt::Producer *producer = new Mlt::Producer(*m_mltProfile, path.toUtf8().constData());
+ if (producer) {
+ if (producer->is_valid()) {
+ QImage img = KThumb::getFrame(producer, frame_position, width, height);
+ delete producer;
+ return img;
+ }
+ else delete producer;
+ }
+ }
+
+ if (!m_mltProducer || !path.isEmpty()) {
QImage pix(width, height, QImage::Format_RGB32);
pix.fill(Qt::black);
return pix;
void stop(const GenTime & startTime);
int volume() const;
- QImage extractFrame(int frame_position, int width = -1, int height = -1);
+ QImage extractFrame(int frame_position, QString path = QString(), int width = -1, int height = -1);
/** @brief Plays the scene starting from a specific time.
* @param startTime time to start playing the scene from */
p.end();
m_frameImage->setPixmap(bg);
} else {
- m_frameImage->setPixmap(QPixmap::fromImage(m_render->extractFrame((int) m_render->seekPosition().frames(m_render->fps()), m_frameWidth / 2, m_frameHeight / 2)));
+ m_frameImage->setPixmap(QPixmap::fromImage(m_render->extractFrame((int) m_render->seekPosition().frames(m_render->fps()), QString(), m_frameWidth / 2, m_frameHeight / 2)));
}
}