I know this is answered somewhere but the search feature here doesn't seem to like 3 letter phrases like "avi" so to search for it manually will just take too long. I am trying to get Gallery 3 to allow all video types, I also want them converted to .mp4 so that they will play in Flowplayer.
So far I have installed ffmpeg on my linux server but the "transcode" mod can't seem to find it even though I can use it for other scripts that require ffmpeg. To be exact it can find it but it won't load any audio codecs. The easy way around was to grab the pre-compiled version from FlashYourWeb, upload that to a folder in gallery3 and point transcode to it. Now Transcode seems to find it and finally gives me one audio codec to use. The main ffmpeg installed on my server has heaps of audio encoders it can use such as aac etc. Ok so that's not really a problem at this point.
Next I added the "videos" module and added extra extensions to the admin dashboard "advanced settings" > "videos" array. Cool so that's done.
Now the problem is when [i]I try to upload a video, all that shows up in the upload form is mp4s, no .avi files at all even though they are in that folder. So I found a post that says I need to edit items.php. The problem is which one, the one in modules>gallery>models or the one in modules>video>models? I see in modules>video>models that at line 791 at has
Quote:
if ($this->is_movie() && !preg_match("/^(flv|mp4|m4v|" . implode("|", unserialize(module::get_var("videos", "allowed_extensions"))) . ")$/i", $ext)) {
which seems to want to include the array of advanced>settings that I configured earlier. So why doesnt the upload form pick up the fact there are .avi files in the folder I am trying to add from? "Server add" and "Videos add" do not detect .avi either when [i]I try to use those to add files. Also does this items.php override or add to the one in modules>gallery?
Help!
Posts: 16
The video module is a modified serverAdd. It dont change the upload dialog. You have to use the videoAdd dialog.
Anyway.
1.) The video module will not work with mp4 resize videos. It only works with flv. I have a modified version for mp4 resized videos. Say if you want to try it.
2.) The video module will not use ffmpeg. You have to encode your mp4 video manualy. I can give you my ffmpeg option if you like.
Posts: 7939
I showed another way but it involves hacking core files.
But the result is better http://www.flashyourweb.com/gallery3/FYW-Demo/Video/Hugo
-s
FlashYourWeb and Your Gallery with The E2 XML Media Player for Gallery2
Posts: 33
Thanks for the reply guys. I did a complete reinstall of gallery and made a little more progress. The "video add" feature now lets me choose all video types that I add to settings>advanced. I used the "transcode" module along with the ffmpeg precompile from FlashYourWeb as well and tried a test folder with several different file types. It partially worked, as in when I tried to view a file there was a massive gap for where FlowPlayer was supposed to be, but there was no player at all. So next thing I did was delete the album and tried again, this time there was no gap/placeholder for FlowPlayer at all, just a "download" link. I hadn't done anything except for delete the folder and reupload the files through "add videos".
So what changed when I deleted the folder? It seems there were resizes made because the timestamp on the albums folder and resizes folder were exactly the same, so something definitely happened in there. The second time I tried to upload looks like it deleted all the resize videos and then failed to make new ones.
The reason I want mp4s is they have better compression than the old flv files and also stand alone as html5 videos.
This is some of the transcode modules log files after doing the second round of uploading
So this is becoming a bit of a hassle and is getting quite technical to debug for me. The part where it says configuration: --prefix=/home/corde5co/bin/ffmpeg has got me baffled, what is that even pointing to? There is no path like that on my server.
Maybe I should just give both your methods a try.
To little_skunk, when you say in point 1) that the "video add" doesn't work with .mp4 what do you mean? I added .mp4 to the settings>advanced>videos array and when I tried a test upload folder it accepted the video and uploaded it the first time around without a problem. Also with point 2) you say I have to convert the files manually, then what is the "transcode" module good for? It seemed to have worked the first time, just not after I deleted the folder and tried again. What failed seemed to be FlowPlayer. I'm sure I can get the transcode to output .mp4 by simply changing the call to the ffmpeg command and make the filetype outputted a .mp4 file instead of .flv I have done this before with another script and it's not very hard. Wouldn't FlowPlayer just accept the resized/transcoded .mp4 file instead of a resized .flv file?
To suprsidr your method looks neat for sure, the only problem I have is making people install a browser extension to play certain files like .avi. I counted three different players although one seems to be a html5 native browser player, the other flowplayer and then an extension for the other one. Not that this is a real issue but these files wouldn't all play on devices like ipad etc would they? especially the player requiring a browser extension. Or what about on android phones? That's the reason I wanted .mp4 outputted videos but if it is too hard I will give your method a go.
Anyway I'll wait for your responses to my questions before I go any further with this. Thanks again for your help.
Posts: 33
One last update on this before I go to bed and tackle it again tomorrow. I just did a third reinstall of gallery3 on my server and tried again with ffmpeg precompile, transcode and videos modules. I went into "/var/modules/transcode/" via ftp and found the following log files -
transcode.log
1330683606.log
The 1330683606.log contained the following -
This is the bit that is worrying, miscompiled Libavcodec -
but anyway I thought i'd examine the contents of folder 19 and sure enough there is a flv file there called 1024x576.flv. But there are no other .flv files at all created.
I downloaded the .flv through my ftp client and played it, it works fine.
So now I have more questions, why weren't the rest of the files converted? Would it be because of the miscompiled ffmpeg? If so then where can I get one that isn't miscompiled? FFmpeg seems to have chosen folder 19 to compile even though there are 18 files before it that were added, 12 of which were added in a folder before I added the folder that contains that particular vid. Does transcode module put the ffmpeg converting commands in a queue of some sort? Also why isn't FlowPlayer picking up the fact that there is a 1024x576.flv in folder 19 to be used instead of nothing at all showing up on the corresponding videos page except for a "Click Here to Download Video." link? Shouldn't there be something in the resizes folder as well, such as file like File_Name.avi.flv?
Update: I manually copied the file 1024x576.flv to the correct resizes folder for the 2nd folder I uploaded with the filename File_Name.avi.flv and hey presto, the big blank placeholder is there waiting for flowplayer to load it... but no FlowPlayer shows up at all. So I have a bad ffmpeg compile and a bad version of FlowPlayer.
I know for sure the blank is a placeholder for FlowPlayer because I right click on the browser page and examine source code and sure enough there is the following in the html code -
Any ideas?
Posts: 33
I added one more folder with 2 videos in it, it gave me another log file that said it made a video for the last video in the folder.
Now i'm thinking that the transcode module is not queuing multiple video conversions, it kills all previous calls to ffmpeg and only does the last video because it was the last thing called. That as well as it doesn't move the finished file to the resizes folder, and also the FlowPlayer won't work even though the flowplayer.swf files have 777 chmod permissions and are located in the folder that the html source is looking in. Strange stuff indeed
Posts: 16
video add will search for the allowed extensions and copy them into the album folder. The flowplayer will play the mp4 video. The problem is the filesize for the flowplayer or the quality for download. Better upload the original video in full quality and a resized version as flowplayer preview.
Maybe you are right. I dont know. The point is that the video add funktion will copy the existing resized flv video. Would be bad if transcode will overwrite it.
If you want to have only a resized mp4 video as downloadlink and for the flowplayer -> mp4 video in album folder -> flowplayer will play it.
If you want to have a avi downloadlink -> mp4 video in resize folder -> flowplayer will ignore it. But thats no problem. I can give you the needed modifications.
Posts: 33
yes that's what I want to happen. If you could give me the modifications that would be great, thanks.
Posts: 16
modules\videos\views\movieplayer.html.php
modules\videos\controllers\file_proxy.php
This will only show the flowplayer for mp4 videos in resize folder.
modules\videos\controllers\videos.php
copy video.extension.mp4 as well if it exists. I gues you dont need that cause you want to use transcode.
modules\videos\helpers\videos_event.php
If you rename, delete or move the video, the mp4 resize will do the same.
Good luck :D
Posts: 33
Thanks little_skunk I am going to give your modifications a try now, I'll let you know how I go.
Posts: 33
I replaced my movieplayer.html.php and file_proxy.php with your versions and manually transcoded an .avi file into a .mp4 file and uploaded it to the correct resizes directory. I then viewed the page and the FlowPlayer works. I also made a .flv file for a different video and FlowPlayer played that as well. yey! Your awesome, thanks for the help with that.
The only problem I did have was that I had to go to the .avi file in Gallery3 and select EDIT, then manually set the video dimensions. For some reason the height was set at "30355844" and width at "0". I guess if I could get transcode to do the converting for me tinstead of the manual transcode I did then the height and width would have been set correctly, is that right?
I don't get what these instructions are about, and why there are two copies of videos.php_.txt in the attachments you provide. It must have been an upload error and i'm guessing these other instructions just aren't needed(?)
Anyway thanks for the help little_skunk, very much appreciated.
Posts: 16
Sorry my fault.
Posts: 33
Oh ok, I just replaced video_event.php with your version. I suppose that handles the moving of the files does it? Anyway the FlowPlayer works with your modifications so everything is good now. Thanks again.
The only problem I have is figuring out why the transcode module is not moving the converted files correctly. I don't suppose you have an idea on that? It is the last of my problems to work out.
Posts: 33
Is FlowPlayer supposed to look in the /var/modules/transcode/flv/ folders as well as the /var/resizes/album_name/ folders for a .flv file? because it only seems to work if it finds an .flv in resizes even though there are transcoded files in /var/modules/transcode/flv/ :/
Posts: 33
Well all this time I was using "videos add" instead of "server add". I didn't realize I needed both modules activated for the resized files to be put in the correct folder. So now that is solved.
How about this problem then, the resized .flv videos all need me to manually edit the video dimensions of each file using the "video dimensions" module. This is going to take forever considering I have a few thousand of them.
Why is the video dimensions defaulting at ridiculous values, like height = 302384732 and width = 0?
Also the videos play at a very fast speed through FlowPlayer, if I download the .flv files and view them in a video player on my computer they play fine except the audio is fast