Thumbnail mismatch (2 different videos sharing a thumbnail)
mrfelton - April 2, 2009 - 22:10
| Project: | XSPF Playlist |
| Version: | 6.x-1.0-alpha1 |
| Component: | Code |
| Category: | bug report |
| Priority: | normal |
| Assigned: | Unassigned |
| Status: | active |
Description
I'm using this with media_mover. I have 2 videos attached to one node. Media mover has generated thumbnails for each of the video clips successfully. The XSPF playlist generated from this node has both videos in it, but they both display the thumbnail from the first video clip. I have 'Use thumbnail only for first playlist item' turned off.
Looking at the playlist directly at /node/1/xspf I can clearly see that the same thumbnail images is being used for each of the differen video clips.

#1
I've been doing a bit of digging...
For this, I'm working on a node that has two file attached using the Upload module. I have 2 Media Mover configurations - 1 to transcode the videos, and another to generate thumbnails. I have XSPF playlist set to use these media mover configurations to build the playlist and playlist thumbnails for my content type.
Firstly, there were a couple of errors that were preventing the playlist builder from being able to write to the xspf_playlist_thumb table. 2 problems:
1) There can be more than one movie attached to a node, and therefore, more than one thumbnail - therefore, the sql queries in xspf_playlist_thumb.module statements need to cater for this, as do the primary keys on the database tables.
2) There was some mistakes (presumably left over from debuging) in the code that generated one of the sql queries.
3) there was a problem in media mover which meant that only one file would be returned per node (patch also attached)
So, with the alterations in my attached patch, XSPF playlist is now correctly creating entries in the xspf_playlist_thumb table and after setting up my playlist thmbnails using the thumbnail builder and saving my node, I end up with entries like this in the xspf_playlist_thumb table:
select * from xspf_playlist_thumb;+------+----+-----+------------------------------------------------------------------------------+-------------------------------------------------------------------------------------------------------------------------+
| type | id | vid | item_path | thumbnail_path |
+------+----+-----+------------------------------------------------------------------------------+-------------------------------------------------------------------------------------------------------------------------+
| node | 1 | 1 | http://crescentmedia.6/sites/crescentmedia.6/files/video.flv | http://crescentmedia.6/sites/crescentmedia.6/files/media_mover/ffmpeg/th... |
| node | 1 | 1 | http://crescentmedia.6/sites/crescentmedia.6/files/Fusion-VIDEO-hmvvideo... | http://crescentmedia.6/sites/crescentmedia.6/files/media_mover/ffmpeg/th... |
+------+----+-----+------------------------------------------------------------------------------+-------------------------------------------------------------------------------------------------------------------------+
Great, except for the fact that these paths detailed in 'item_path' are not the same paths that are returned by media mover when the actual xml playlist is generated. When the actual playlist is generated, the item_path that is searched in the thumbnail table is the path to the media_mover converted movie (in my case, http://crescentmedia.6/sites/crescentmedia.6/files/files/media_mover/ffm...), not the path to the original attached file. This means that no match is found for the thumbnail.
in xspf_playlist_node_builder(), you call xspf_playlist_node_get_files_from_node() to get all the files that are attached to the node. However, in admin/settings/xspf_playlist/my_node_type, I told it to look to my Media Mover 'Transcode' configuration for the playlist. So shouldn't it be getting this file list from the media mover configuration that I specified, rather than from the files that are attached to the node?
I hope this makes sense - it's 1:45 and I'm too tired!
#2
Also,
you can use the 'files' table to store the path and just keep the fid it gives you, so if it gets moved by another module you can still find it.
#3
This patch didnt work for me. Earlier it was taking the thumbnail of the first video and putting in playlist for both the videos, now it is taking the second thumb and putting it for bot the videos.