Bug 334924 - Video previews in information panel don't work
Summary: Video previews in information panel don't work
Status: RESOLVED FIXED
Alias: None
Product: Phonon
Classification: Frameworks and Libraries
Component: general (show other bugs)
Version: unspecified
Platform: unspecified Linux
: NOR normal
Target Milestone: ---
Assignee: Harald Sitter
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2014-05-17 06:12 UTC by Zach
Modified: 2014-10-24 06:27 UTC (History)
6 users (show)

See Also:
Latest Commit:
Version Fixed In: 4.14.3


Attachments
Both video player (with black screen) and preview image are shown (272.02 KB, image/png)
2014-10-21 08:59 UTC, Pulfer
Details
Patch from ROSA/OpenMandriva to fix video previews in Dolphin (1.30 KB, patch)
2014-10-22 11:53 UTC, Pulfer
Details

Note You need to log in before you can comment on or make changes to this bug.
Description Zach 2014-05-17 06:12:48 UTC
Video previews in the information panel show a picture from the video, but don't play a section of the video like they are supposed to.  I have tried with mplayerthumbs, ffmpegthumbs, and kffmpegthumbnailer activated in the preferences menu.  

Reproducible: Always

Steps to Reproduce:
1. Click on a video
2. Click the play button in the preview panel
3. 
Actual Results:  
Weird graphic gliches

Expected Results:  
Video plays

Kubuntu 14.04
KDE 4.13.0
Comment 1 Emmanuel Pescosta 2014-05-17 11:59:58 UTC
Thanks for the bug report!

Can you hear the sound of the video?
I can reproduce it, the image hangs but sound works fine.
Comment 2 Zach 2014-05-18 02:27:18 UTC
When I try to preview .avi files, a sound stream shows up, but I don't hear anything.  .mp4 and .mkv files do not produce a sound stream at all.
Comment 3 Frank Reininghaus 2014-06-03 08:00:16 UTC
In any case, this looks like a Phonon problem, so I'll reassign.
Comment 4 Pulfer 2014-10-21 08:57:55 UTC
This still happens with KDE 4.14.2, Phonon 4.8.0 and Phonon GStreamer 4.8.0. But sometimes videos do work. And sometimes both video player (with black screen) and preview image are shown.
Comment 5 Pulfer 2014-10-21 08:59:51 UTC
Created attachment 89227 [details]
Both video player (with black screen) and preview image are shown
Comment 6 Pulfer 2014-10-21 10:39:00 UTC
BTW, adding qSleep(20) to slotHasVideoChanged makes previews work. It's an ugly hack so it shouldn't be used in upstream code. But at least it gives some info about why video previews often don't play. And even with his hack first play gives a black screen, so perhaps there's another race somewhere.

void PhononWidget::slotHasVideoChanged(bool hasVideo)
{
    emit hasVideoChanged(hasVideo);

    qSleep(20);

    if (hasVideo) {
        if (!m_videoPlayer) {
            // Replay the media to apply path changes
            m_media->stop();
            m_videoPlayer = new EmbeddedVideoPlayer(this);
            m_topLayout->insertWidget(0, m_videoPlayer);
            Phonon::createPath(m_media, m_videoPlayer);
            m_media->play();
        }
        applyVideoSize();
        m_videoPlayer->show();
    }
}
Comment 7 Pulfer 2014-10-22 11:53:34 UTC
Created attachment 89251 [details]
Patch from ROSA/OpenMandriva to fix video previews in Dolphin

I guess I fixed this issue. See the attached patch.
Comment 8 Emmanuel Pescosta 2014-10-23 08:27:56 UTC
(In reply to Pulfer from comment #7)
> Created attachment 89251 [details]
> Patch from ROSA/OpenMandriva to fix video previews in Dolphin
> 
> I guess I fixed this issue. See the attached patch.

Thanks for the patch. I can confirm that it works! :)

So the problem was, that Phonon needs a video path to determine if the media is a video or not, right?

Can you please open a review request? Thanks
Comment 9 Emmanuel Pescosta 2014-10-23 08:46:07 UTC
Your patch should also fix the bugs 337033 and 337107
Comment 10 Pulfer 2014-10-23 09:45:01 UTC
(In reply to Emmanuel Pescosta from comment #9)
> Your patch should also fix the bugs 337033 and 337107

Good to know :-)

> Can you please open a review request? Thanks

Looks like I need to package rbtools for ROSA first, current patch is rejected by KDE review request form... I'll let you know when I have review request ready.
Comment 11 Emmanuel Pescosta 2014-10-23 09:54:07 UTC
(In reply to Pulfer from comment #10)
> Looks like I need to package rbtools for ROSA first, current patch is
> rejected by KDE review request form... I'll let you know when I have review
> request ready.

No you don't need rbtools.
You have to use the kde-baseapps upstream repo (branch KDE/4.14), because review board needs a valid index.
Comment 12 Pulfer 2014-10-23 10:12:08 UTC
(In reply to Emmanuel Pescosta from comment #11)
> No you don't need rbtools.
> You have to use the kde-baseapps upstream repo (branch KDE/4.14), because
> review board needs a valid index.

Done: https://git.reviewboard.kde.org/r/120745/
Comment 13 Emmanuel Pescosta 2014-10-24 06:27:12 UTC
Git commit 3866c88ce9f4dd509752ba08424a65570fcf4b9d by Emmanuel Pescosta, on behalf of Andrey Bondrov.
Committed on 24/10/2014 at 06:21.
Pushed by emmanuelp into branch 'KDE/4.14'.

Fix the information panel video player in Dolphin.

Patch from ROSA Linux.
Related: bug 337107, bug 337033, bug 339882
REVIEW: 120745
FIXED-IN: 4.14.3

M  +7    -9    dolphin/src/panels/information/phononwidget.cpp

http://commits.kde.org/kde-baseapps/3866c88ce9f4dd509752ba08424a65570fcf4b9d