First, I'm having two problems in 6.x similar to something that went on in 4.x/5.x (http://drupal.org/node/109626), so I'm a little concerned over progress in this very beneficial module.

1. Second Drupal cron run after video upload deletes encoded video
2. The pointer in the node to the converted video file gets deleted by simply opening and saving the node after it's been encoded

When video is uploaded to the server for ffmpeg_helper conversion (I have both the use drual cron and autoconvert [x] checked), the video is converted on the first cron run, then the .flv file gets deleted on the second Cron run. In the interim, the video plays fine, which makes you think this module is working. Turn your back, and it's broken.

It took me a few days to trace this seriously buggy behavior two these two separate issues.

How are people living with this, or not seeing this?

Comments

gatsu_1981’s picture

It happened to me pretty much the same thing.
Drupal 6 is installed, pretty much everything is working, except the video module.

I had uploaded 15 files (60+ megs), all in WMV (I still can't get FLV + Flow Player to work at all).
No FFMPEG for me, I took care of converting --> WMV before uploading.
Everything seemed ok for a day or so.
But today I went to check something... Video wasn't playing.
"Video type not supported". Hell yeah...

Fired up my FTP... the video_uploaded folder, is completely empty.
I even phoned up my hosting provider!

Please fix this, it is a serious issue, it makes this module almost unusable.

gatsu_1981’s picture

Another case, I think it's the same as us.

http://video.heidisoft.com/forum/video-type-not-supported

"I have had a .wmv file on my site for a few days. It had about 20 successfull views. Starting on Saturday I noticed that i get a "Video Type not Supported" error when trying to view it. I have upgraded to the latest video module 6.x-2.1-beta1 and still have the problem"

hypertext200’s picture

Assigned: Unassigned » hypertext200

Thanks for reporting issue, I will work on this to fix it very soon. :)

gatsu_1981’s picture

Symptoms:

mysql table "file" have not content referring to uploaded videos
"video" and "video_upload" still have video content, I think that "video type not supported" it's really a "video file reference not found" error type.
maybe it first disappear from the "file" table, then during some cronjob the actual file get deleted for cleanup.

Edit:

I'm not VERY sure about that (but it really seems so).
But it looks like that every video older than 24 hours get deleted after a cronjob.
I have now installed supercron and deactivated video_upload cron section.

Tomorrow I will post if my video are still alive or not :(

gatsu_1981’s picture

I ran the www.site.com/cron.php.
It deleted every video file on my folder.

I commented the entire video_upload_cron() function on the video_upload module.
I really don't know what to do, please fix this as it will make the video upload module useless :(

gatsu_1981’s picture

*** SORRY, DOUBLE POST ***

gatsu_1981’s picture

StatusFileSize
new38.35 KB

Update:

Bug tracked down.

In my case, the variable "status" inside the table "file" is not properly set to 1, but keeps the value "0" (temporary).
So the video get removed by cron because it looks like not published.
I have tried it just now to upload two files, one published, and another pushed to home page.
Neither one got the "1" status, both got "0" status, so in a few hours they will get deleted by cron.

Quick & dirty patch for fixing the status of a just uploaded video:

db_query("UPDATE {files} SET status = '1' WHERE filename LIKE 'video%' ");

I added this after the comment on the line 495, just after :

// update the file db entry and fix the status

glen201’s picture

Version: 6.x-2.1-beta1 » 6.x-2.x-dev

@gatsu_1981 - good work finding this obvious error. The developers of this module are missing some Drupal basics, and some good logic coding, along with regression testing best practices. Unfortunate, for such a powerful (and complex) module.

I couldn't find where you made this fix, so I put it into the video_render.php file which is where the entry in the files table is made anyway. They left out the status entry when creating the file (they also left the date code out, but that's for another day).

Line 136 in video_render.php of Video 6.x-2.x-dev should now read:

db_query("INSERT INTO {files} (fid, uid, filename, filepath, filemime, filesize, status) VALUES (%d, %d, '%s', '%s', '%s', %d, %d)", $file->fid, $job->uid, $file->filename, $file->filepath, $file->filemime, $file->filesize, 1);

Another problem: when you try to replace the video file, if you don't select Auto regenerate thumbnail (when using ffmpeg) you can stand on your head, and the file will just upload to /tmp and never move from there. This code is totally bug ridden. As it stands, if you DL it and install it, the code it puts in to run the flash player is several versions behind and incompatible, although people have offered the developers fixes.

This module is poorly maintained, how can the community take it over?

hypertext200’s picture

Thanks for reporting issues, I will fix it with next release

gatsu_1981’s picture

@glen201
Thanks, but the fix you made is for the ffmpeg module (it was affected as well? ) .
I can't use ffmpeg because my hosting is poor :D so the fix for the actual video_upload module should be put on:

video/types/video_upload/video_upload.module

I adjusted my fix a little bit, now it doesn't apply a "1" status to every video, but only to the one just uploaded.
I think that now that query is properly written.

The fix is on line 491, just add the bold part to the query:

// update the file db entry

db_query("UPDATE {files} SET filename = '%s', filepath = '%s', filemime = '%s', status = '1' , filesize = %d WHERE fid = %d", $file->filename, $file->filepath, $file->filemime, $file->filesize, $file->fid);

hypertext200’s picture

If your using shared host, yes you can still use ffmpeg, its a simple.
See the post here http://jibwa.com/scripts-and-tricks-for-professionals/ffmpeg-on-bluehost...

glen201’s picture

Yea gatsu_1981, I was looking at it through an ffmpeg lens, but then this morning it hit me your problem exists if you just upload with no conversion file and I see you picked that up. I understand what you were fixing now and I applied the patch, thanks. Both are issues: you upload for conversion to ffmpeg, the uploaded video should be left at 0 so it goes away eventually, and the converted flv should have status 1. If you upload a video for playback through another plugin, it should get status 1 after it gets moved from temp.

The ffmpeg support has many more bugs, some reported over a year ago with fixes shared by the community with the developers. Unfortunately, that's what I am slugging through because I want a simple flash player interface to my uploaded videos. I don't think at this point they're getting fixed unless someone takes this over in the community. Otherwise, any future releases we get from the developers we're going to have to do a file by file diff and decide if we want to incorporate their code in our correctly patched versions. I see no other way until this module gets under control.

hypertext200’s picture

StatusFileSize
new1.28 KB

Thanks to #gatsu_1981. I created the patch and commit it to DRUPAL-6 branch.

hypertext200’s picture

Status: Active » Fixed
StatusFileSize
new1.2 KB

Fixed, thanks for reporting bug and helped to fix it.

Path should add to the video_render.php file.

glen201’s picture

#13 is wrong, @gatsu_1981 - it would set all uploaded videos status = 1, even if they are to be converted by ffmpeg, and it will leave a bunch of files that are source and never used (if you want that, okay). If you want the original video to be deleted once converted, which I think is the way the code should be written, use:

if(variable_get('video_ffmpeg_helper_auto_conversion', false))
$stat = 0; // ffmpeg will use this as source, so let drupal delete the file later
else
$stat = 1; // ffmpeg will not be called, this video file will play as-is
db_query("UPDATE {files} SET filename = '%s', filepath = '%s', filemime = '%s', filesize = %d, status = %d WHERE fid = %d", $file->filename, $file->filepath, $file->filemime, $file->filesize, $stat, $file->fid);

Make sense?

gatsu_1981’s picture

@glen

I think it does make sense. I didn't thought about that since my only problem was uploading the file and not having it deleted :)
So, if uploaded ok --> status = 1.
In the ffmpeg conversion case it's completely different...
If I will be able to use ffmpeg I will test your method, by a quick glance I think that it's more complete now.

I would like to help, I'm writing now a mod for the flash_ad plugin for resizing the flash ad, since my video disappearing problem is resolved now :)

hypertext200’s picture

@glen @gatsu_1981
Thanks for your effort to fix this issues in the video module, I appreciate both you help.

Status: Fixed » Closed (fixed)

Automatically closed -- issue fixed for 2 weeks with no activity.

shannon_everett’s picture

Issue tags: +video type not supported video module

How do I add the patch?

hypertext200’s picture

This patch is already shiped with the latest release

dmjossel’s picture

Version: 6.x-2.x-dev » 6.x-2.8
Status: Closed (fixed) » Active

It doesn't seem to work. I just upgraded a site from Drupal 5 (latest) to Drupal 6, including 2.6 of video.module, and all URL Videos are broken with the "video type not supported" error.

Flowplayer and flowplayer.module are properly installed and are working, but every video on the site throws this error now.

hypertext200’s picture

Status: Active » Closed (fixed)