I have hundreds of uploaded video files as wmv files and now want to change them to flv.
Admittedly it will be a long process doing this, but my immediate problem is working out a way of switching the files once I have uploaded them.
The way I thought would work was by renaming the file through gallery to .flv then uploading the video directly into the gallery save location i.e. data/albums/[album saved location]
My assumption was that this would replace the file and automatically play as a flv, but there appears to be a command I am missing for it to use the embedded flash player as Gallery still loads the wmv player.
Posts: 6136
When you upload the wmv its being detected as video/x-ms-wmv not video/x-flv.
It is also being assigned the default video renderer not the flashvideo renderer.
Re-uploading does not change either of these values.
You can however try the transcode module to transcode directly on your server.
This will re-assign the proper renderer.
You will need a fairly hearty ffmpeg binary compiled with video/x-ms-wmv and video/x-flv support.
If you would like to try out transcode you can sign up for a free account on my site and upload/edit a movie in your free 100MB useralbum.
-s
FlashYourWeb and Your Gallery with The E2 XML Media Player for Gallery2
Posts: 7
I have added the modules to my Gallery site and they work great! Fantastic piece of software.
The quality is a little rough as the wmv's were created at 170kbps and I want the flv's to be 240kbps - is it possible to replace the transcoded flv with a better copy? Or is this process being done as the movie is played?
Posts: 6136
170kbs is very low, there is no data to add to the stream, so upping the datarate is pointless.
Personally I'd never start with windows media in the first place, it does not play well with others.
If you have the source videos there are many ways to transcode to higher datarates as flv or mp4 the before you upload.
-s
FlashYourWeb and Your Gallery with The E2 XML Media Player for Gallery2
Posts: 7
I agree whole heartedly, and only made them this way because they wouldn't stream as a wmv - these web movies go back three years and now I am updating them.
The next step is to increase the data rates - but I'd prefer them replace them all together with flv's. Is there a code line I can change for Gallery to use the flashvideo renderer and not the default renderer?
Posts: 6136
untested but you can try:
/gallery2/modules/core/classes/GalleryMovieItem.class line ~261:
remove video/x-ms-wmv from that group and down around line ~289 add your new case just above default:
case 'video/x-ms-wmv': GalleryCoreApi::requireOnce('modules/flashvideo/classes/FlashVideoRenderer.class'); return FlashVideoRenderer::render('HTML', $this, $this, $params); default: return $fallback;-s
FlashYourWeb and Your Gallery with The E2 XML Media Player for Gallery2
Posts: 7
Entered the code as per your instructions. It resulted in the browser displaying a page of code instead of Gallery.
Posts: 6136
flashvideo renderer also checks mimetype.
In short no.
-s
FlashYourWeb and Your Gallery with The E2 XML Media Player for Gallery2
Posts: 7
I have tried I changing the original file from a .wmv to .flv in gallery (through the edit movie properties) and then uploading an flv movie to replace it - thereby also allowing me to increase the bitrate and audio quality.
This plays as a .wmv (or rather doesn't play haha) - is this because the default needs to be set to the flashvideo renderer? How can I do this?
Posts: 6136
You'd need to edit the database.
Why not simply upload the new flv as a new item, and delete the corresponding wmv version?
-s
FlashYourWeb and Your Gallery with The E2 XML Media Player for Gallery2
Posts: 7
How would I edit the database? I've got the time to do it because all the wmv's will be replaced anyway.
Don't want to upload a new item as I want to keep the view count for each movie - the new flv would start at zero... but if this is the way i have to do it I will haha
Posts: 6136
Ok, lets try this.
rename the attached to changeRenderer.php and upload to your gallery2 directory.
You can now browse to yoursite.com/gallery2/changeRenderer.php?g2_itemId=23 <- where 23 is an album's g2_itemId that contains some of the wmv(s)
It will load all of the album's children and if they are video/x-ms-wmv then it will change the renderer to FlashVideoRenderer
-s
FlashYourWeb and Your Gallery with The E2 XML Media Player for Gallery2
Posts: 7
The following message was returned after entering the URL:
Error loading initialItem:Error (ERROR_MISSING_OBJECT) : Entity with id [11077] is a [GalleryMovieItem] and does not extend the required entity type [GalleryAlbumItem].
* in modules/core/classes/helpers/GalleryEntityHelper_simple.class at line 129 (GalleryCoreApi::error)
* in modules/core/classes/GalleryCoreApi.class at line 2361 (GalleryEntityHelper_simple::loadEntitiesById)
* in changeRenderer.php at line 17 (GalleryCoreApi::loadEntitiesById)
* in changeRenderer.php at line 68
Error finding child item ids:Error (ERROR_BAD_PARAMETER)
* in modules/core/classes/helpers/GalleryChildEntityHelper_simple.class at line 147 (GalleryCoreApi::error)
* in modules/core/classes/helpers/GalleryChildEntityHelper_simple.class at line 80 (GalleryChildEntityHelper_simple::_fetchChildItemIds)
* in modules/core/classes/GalleryCoreApi.class at line 2450 (GalleryChildEntityHelper_simple::fetchChildItemIds)
* in changeRenderer.php at line 22 (GalleryCoreApi::fetchChildItemIds)
* in changeRenderer.php at line 68
Error loading childItems:Error (ERROR_BAD_PARAMETER)
* in modules/core/classes/helpers/GalleryEntityHelper_simple.class at line 39 (GalleryCoreApi::error)
* in modules/core/classes/GalleryCoreApi.class at line 2361 (GalleryEntityHelper_simple::loadEntitiesById)
* in changeRenderer.php at line 26 (GalleryCoreApi::loadEntitiesById)
* in changeRenderer.php at line 68
Posts: 6136
The g2_itemId has to be an album that contains some of the wmv(s)
It's ok though, I was thinking we need to change the mimeType anyways so I added a line for that.
Please make sure you backup your database - I forgot to mention that above.
see new attached.
-s
FlashYourWeb and Your Gallery with The E2 XML Media Player for Gallery2