This bug report issue is referenced in #221300: 2008 Video 5.x-1.x dev Feedbacks + issues referencing

0- Settings:

> admin/build/modules/ : Video sub-modules: upload, url, image and multidownload.

> admin/settings/video

> > General behavior

    * Choose default video type : Upload video
    * NO Display download menu tab
    * YES Display download link
    * YES Display playtime
    * YES Display filesize

> > Video resolutions

    * Default width : < Emptied >
    * Resolution 1 name : thumbpreview
    * Resolution 1 value : 120x120
    * Resolution 2 name : video_module_default_width
    * Resolution 2 value : 400x400
    * < No other resolution set. >

> admin/settings/video/upload

> > Allowed extensions : mov,flv,wmv,avi,swf,flv,mpeg,mpg,rm,3gp,mp4,mp3

> > Pattern for the file prefix : < Emptied >

> admin/settings/video/image : published / unpromoted

What happened

1- I first submitted a video node without a video uploaded and without a title. Multiple download disabled (default). I got the following errors:

- The Title is obligatory.
- You have not provided any video file. Please upload one.
If you uploaded a video but the system did not received it, please check that it is smaller than 256 Mo.

> Nothing strange here. But...

1.1- By the way, I would just like to stress on the fact that "version 2007" allowed 2GB uploads (at least in the text), which is half a DVD size but still 8 times what's allowed now.

    1.1.1 What's the reason? Default timeouts settings? Which ones?
    1.1.2 Will this restriction be broken up sometime? How-to, if any turn-around is possible?

2- The errors still showed up on node/add page after submitting again and during the upload.
> The video uploaded is in the supported .mov format and weights 238,6 Mo.
> It has been uploaded both in the file AND the newly created video folders.
> video/tmp is empty.

3- The upload finished, I got both info and error messages, without any other content:

3.1 Infos:

Your folder /tmp/video has been created.
Your Video has been created.

> This is OK.

3.2 Errors:

user warning: Unknown column 'vtype' in 'field list' query: INSERT INTO video (vid, nid, vtype, vidfile, size, videox, videoy, video_bitrate, audio_bitrate, audio_sampling_rate, audio_channels, playtime_seconds, disable_multidownload, download_folder, use_play_folder, custom_field_1, custom_field_2, custom_field_3, custom_field_4, custom_field_5, custom_field_6, serialized_data) VALUES (59, 16, 'upload', '', 0, 800, 600, 0, 0, 0, '', 0, 1, '', 0, '', '', '', '', '', '', 'a:2:{s:3:\"iid\";i:15;s:9:\"video_fid\";i:39;}') in /Shared Items/iDoc/drupalpp/includes/database.mysql.inc on line 172.
warning: Division by zero in /Shared Items/iDoc/drupalpp/modules/video/video.module on line 1294.

> I can't help you with this unless you ask me what more to tell you.

4- Then I clicked on "View" to view what would be in my node. Nothing appeared but the remaining error message:

    warning: Division by zero in /Shared Items/iDoc/drupalpp/modules/video/video.module on line 1294.

> followed by the authoring infos and the rest of the content.

Comments

SeaBass-1’s picture

I only get warning: Division by zero in /modules/video/video.module on line 1294. when using ffmpeg helper to automatically detect resolution.

1291     function _video_scale_video(&$node) {
1292       $def_width = (int) variable_get("video_resolution_width", 400);
1293  
1294       $height = $def_width * ($node->videoy / $node->videox); // do you remember proportions?? :-)
1295
1296       $height = round($height);
1297       // add one if odd
1298       if($height % 2) {
1299         $height++;
1300       }
1301       $node->video_scaled_x = $def_width;
1302       $node->video_scaled_y = $height;
1303     }

I am not sure if $node->videox on line 1294 comes up blank because of ffmpeg or else. I have also noticed that when disabeling resolution helper and using the predefined sizes, it always defaults back to 4:3 and 400x300. In essence I think something is screwed up in calculating resized height.

--SeaBass--

fax8’s picture

@SeaBass: please review your admin/settings/video/ffmpeg_helper settings. seems that ffmpeg isn't able to get the video informations.

@doc2: please check that you run the update.php script to update the DB fields. Seems that you are missing the vtype field in the video db table.
this means that each INSERT will fail then this can cause the division by 0 error.

Please note that we currently have a bug in the update function I wrote above.. thus you probably should wait a couple of days till bug http://drupal.org/node/220929 is fixed.

fax8’s picture

about comment 1.1 .. did you actually ever uploaded a 2 GB video?
I actually think that the routine to calculate the max upload size in the old version was broken. The new one should be more accurate as we use drupal api to calculate it (using file_upload_max_size()).

doc2@drupalfr.org’s picture

5- (A. to #2:) You were right, update is done now.

5.1- Update remarks concerning video resolutions (cf.: 0- Settings) in admin/settings/video:

    * Emptied default width left blank.
    * Overriden names and values for resolution 1: "4/3..." and 2: "16/9".

5.2- Tried a 398.94 Mo .mov file upload.

5.2.1- Had been uploaded into files/ but *not* into files/video.

    > A. to #3, partially to 1.1: Over 256 Mo uploads work... still unknown behaviours on larger than 398.94 Mo uploads yet.
    (Note on specs: I have good server performances and no trafic because it's a testing site. I think results may fluctuate depending on specs)
    > Where should they upload?
    > The video folder was practical but turnarounds such as the uploadpath.module could be more practical. Possible compatibility?

5.2.2- As you expected in #2 regarding issue 220929 :

    5.2.2.1 Player doesn't show
    5.2.2.2 Previous nodes don't get updated (I still get the current error warning: Division by zero(...))
    > I haven't tried the patch http://drupal.org/node/220929#comment-731013 yet. I (hope I'll get time to go on and) let you know then.

Thanks, Arsène

vhmauery’s picture

Status: Active » Fixed

I just committed a patch that checks for division by zero before it does it. I am not sure why videox is ever 0, but now in case it ever is, we can cope by just scaling to the default video size set in the admin settings form.

fax8’s picture

Status: Fixed » Active

@vernon: reopening as I think that there is something odd happening here. surely if he get a $node->videox value of 0.

@doc2: are the videos which create division by 0 errors on display youtube videos?

I'm thinking about how we stored youtube videos x and y on the old version. I mean.. did we store that as 0 and then simply create the correct width/height on the theme_play_* function? If it like this we should probably add a new update function to store something on the DB.

doc2@drupalfr.org’s picture

(A. to #6:) I don't have youtube videos. That's the reason why I set the default video type to "upload" in 0- Settings. Therefore

6- I *did* choose the 0- Settings by myself before I got the error, and therefore I did empty the default video width field. I thought I should show those settings to you so that you would know the difference between them and the default ones.

6.1- Reason for setting default width ("videox") to 0: I used to resize my videos "manually" because I haven't had ffmpeg working. Therefore my stock of videos is already in the good resolution and that is why I did not want any default to override it. I thought that leaving "videox" blank would disable this default width option. But I have not set it to 0.

    6.1.1 However I guess that this "0" is the result of a blank field, as long as you don't specify something else such as (simple non techny suggestions:)
    - "IF videox=0 THEN disable the width attribute" or,
    - "IF videox=0 THEN set the width attribute to current file width", if you need to keep the attribute.

6.2- In 5.1, that is to say after my update, I just wanted to show you that the DB update had not overwritten my setting choice for "videox" although it did for resolution 1 and 2.

    6.2.1 If I don't patch, may I just set the default width back to 400 to avoid this "division by 0" error? (cf. 5.2.2.2: previous nodes "don't get updated")

NOTE Please note that I won't have time to do more test on the video.module this week (18-24th, Feb) at least. I hope to be back soon (if ever I'm helpful)!

yopyop’s picture

subscribing

fax8’s picture

you might want to test the patch available at http://drupal.org/node/231790#comment-770398

hypertext200’s picture

Status: Active » Fixed

Status: Fixed » Closed (fixed)

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