Facebook  Twitter 

SMFHacks.com

+-

SMFHacks.com

+- User Information

Welcome, Guest.
Please login or register.
 
 
 
Forgot your password?

+- Forum Stats

Members
Total Members: 4253
Latest: Ineedsmfhelp
New This Month: 1
New This Week: 0
New Today: 0
Stats
Total Posts: 43242
Total Topics: 7516
Most Online Today: 92
Most Online Ever: 2482
(April 09, 2011, 07:02:45 pm)
Users Online
Members: 0
Guests: 101
Total: 101

Author Topic: If FFMPEG is installed...  (Read 11571 times)

0 Members and 1 Guest are viewing this topic.

Offline shuban

  • Hero Member
  • *****
  • Posts: 665
    • View Profile
    • Biology Forums
If FFMPEG is installed...
« on: August 29, 2014, 12:24:56 am »
If this plugin is installed, will it convert all video types into an image thumbnail, including flash swf videos?

How about linked videos?

In addition, could you please add an option in search to search videos only?

Offline SMFHacks

  • Administrator
  • Hero Member
  • *****
  • Posts: 16428
    • View Profile
Re: If FFMPEG is installed...
« Reply #1 on: August 29, 2014, 09:10:08 am »
Any Uploaded video will attempt to grab screenshot/frame of the video.   Not sure if ffmpeg supports flash but I know it supports mp4, mpeg, avi, wmv, rm files
Linked videos I do not believe a screenshot frame is taken.

Search will look into adding that option.
Get your Forum Ranked! at https://www.forumrankings.net - find out how your forum compares with others!

Like What I do? Support me at https://www.patreon.com/vbgamer45/

Offline shuban

  • Hero Member
  • *****
  • Posts: 665
    • View Profile
    • Biology Forums
Re: If FFMPEG is installed...
« Reply #2 on: August 29, 2014, 12:53:47 pm »
It's unfortunate because the Avea gallery mod is somehow able to capture even youtube videos and flash files located outside the server.

Offline SMFHacks

  • Administrator
  • Hero Member
  • *****
  • Posts: 16428
    • View Profile
Re: If FFMPEG is installed...
« Reply #3 on: August 29, 2014, 01:00:04 pm »
Maybe one day I don't see how you can do with linked videos. You would need to download the video to extract frame.
Youtube vidoes we support auto embening
Get your Forum Ranked! at https://www.forumrankings.net - find out how your forum compares with others!

Like What I do? Support me at https://www.patreon.com/vbgamer45/

Offline shuban

  • Hero Member
  • *****
  • Posts: 665
    • View Profile
    • Biology Forums
Re: If FFMPEG is installed...
« Reply #4 on: August 29, 2014, 01:02:09 pm »
the link to ForumRankings.net is broken in the announcement

good idea by the way

Offline SMFHacks

  • Administrator
  • Hero Member
  • *****
  • Posts: 16428
    • View Profile
Re: If FFMPEG is installed...
« Reply #5 on: August 29, 2014, 01:04:41 pm »
Thanks fixed. Yeah was an idea was tossing around back and forth for a while. Decided to build it last week.
Posted on SMF.org so far no response..
I might have to starting crawling sites but requires more/keep accurate.
Get your Forum Ranked! at https://www.forumrankings.net - find out how your forum compares with others!

Like What I do? Support me at https://www.patreon.com/vbgamer45/

Offline shuban

  • Hero Member
  • *****
  • Posts: 665
    • View Profile
    • Biology Forums
Re: If FFMPEG is installed...
« Reply #6 on: August 29, 2014, 01:15:59 pm »
Thanks fixed. Yeah was an idea was tossing around back and forth for a while. Decided to build it last week.
Posted on SMF.org so far no response..
I might have to starting crawling sites but requires more/keep accurate.

It's an excellent idea with lots of potential. Don't give up on it, give it some time. I just added my site.

Quick q, do I need to keep that verification file uploaded forever or can I delete it? I deleted it, in fact.

Offline SMFHacks

  • Administrator
  • Hero Member
  • *****
  • Posts: 16428
    • View Profile
Re: If FFMPEG is installed...
« Reply #7 on: August 29, 2014, 01:21:27 pm »
Keep it if you can. It just displays the total topics/posts/members in a  secure way only accessed via a key that is linked to your account I ping it once a day at night just to grab the stats and use that information to adjust the stats.
Get your Forum Ranked! at https://www.forumrankings.net - find out how your forum compares with others!

Like What I do? Support me at https://www.patreon.com/vbgamer45/

Offline shuban

  • Hero Member
  • *****
  • Posts: 665
    • View Profile
    • Biology Forums
Re: If FFMPEG is installed...
« Reply #8 on: August 29, 2014, 01:27:34 pm »
Keep it if you can. It just displays the total topics/posts/members in a  secure way only accessed via a key that is linked to your account I ping it once a day at night just to grab the stats and use that information to adjust the stats.

So, if I delete it, it won't be able to update those stats?

Offline SMFHacks

  • Administrator
  • Hero Member
  • *****
  • Posts: 16428
    • View Profile
Re: If FFMPEG is installed...
« Reply #9 on: August 29, 2014, 02:00:18 pm »
Yeah the stats won't update it will be stuck at the current rankings
Get your Forum Ranked! at https://www.forumrankings.net - find out how your forum compares with others!

Like What I do? Support me at https://www.patreon.com/vbgamer45/

Offline shuban

  • Hero Member
  • *****
  • Posts: 665
    • View Profile
    • Biology Forums
Re: If FFMPEG is installed...
« Reply #10 on: August 29, 2014, 02:05:11 pm »
Yeah the stats won't update it will be stuck at the current rankings

In that case, I added it back. This might bother some future users though...

Offline SMFHacks

  • Administrator
  • Hero Member
  • *****
  • Posts: 16428
    • View Profile
Re: If FFMPEG is installed...
« Reply #11 on: August 29, 2014, 02:23:21 pm »
Yeah the only way around that would be to scape the site just not really reliable and would use more resource since it would have fetch the entire page which uses more queries.
Get your Forum Ranked! at https://www.forumrankings.net - find out how your forum compares with others!

Like What I do? Support me at https://www.patreon.com/vbgamer45/

Offline shuban

  • Hero Member
  • *****
  • Posts: 665
    • View Profile
    • Biology Forums
Re: If FFMPEG is installed...
« Reply #12 on: September 03, 2014, 08:50:10 pm »
I found out how Aeva media gallery obtains a thumbnail from linked videos. Hopefully it can be incorporated into SMF Gallery Pro instead of FFMPEG plugin.

If you download the Aeva media package and open Aeva-Embed.php, you'll find the following functions:

Code: [Select]
function aeva_embed_video($message, $id_media = 0, $id_preview = 0)
{
global $context, $sites, $sourcedir, $modSettings;

$msg = '<a href="' . preg_replace(array('~\[url=([^]]*)][^[]*\[/url]~', '~\[url]([^[]*)\[/url]~'), '$1', $message) . '"></a>';

$context['aeva_mg_hack'] = true;
$msg = parse_bbc(substr($message, 0, 4) == 'http' ? $msg : $message);
unset($context['aeva_mg_hack']);
return substr($msg, 0, 7) == '<a href' && function_exists('aeva_foxy_img_link') ? aeva_foxy_img_link($msg, $id_media, $id_preview) : $msg;
}

function aeva_check_embed_link($link)
{
global $context, $sites, $boardurl, $sourcedir, $modSettings;

if (!isset($modSettings['aeva_enable']))
return false;

$link2 = aeva_onposting($link);
$link3 = aeva_main(preg_replace(array('~\[url=([^]]*)]([^[]*)\[/url]~', '~\[url]([^[]*)\[/url]~'), array('<a href="$1">$2</a>', '<a href="$1">$1</a>'), $link2));
if (strpos($link3, '<embed ') !== false || strpos($link3, 'swfobject.embedSWF(') !== false)
return $link2;

// Parse the boardurl to grab the domain we're on.
$x = @parse_url($boardurl);
$x['scheme'] = !empty($x['scheme']) ? $x['scheme'] : 'http';
$x['host'] = !empty($x['host']) ? $x['host'] : NULL;

if (!empty($x['host']))
if (preg_match('`' . preg_quote($x['scheme'], '`') . '://(?:[a-z0-9-]{1,32}\.){0,3}' . preg_quote($x['host'], '`') . '/`i', $link, $void))
return true;
unset($x);

if (empty($sites))
{
@include_once($sourcedir . '/Aeva-Sites.php');
if (empty($sites))
{
@include_once($sourcedir . '/Subs-Aeva-Sites.php');
if (file_exists($sourcedir . '/Aeva-Sites-Custom.php'))
@include_once($sourcedir . '/Aeva-Sites-Custom.php');
}
}

$link = preg_replace(array('~\[url=([^]]*)][^[]*\[/url]~', '~\[url]([^[]*)\[/url]~'), '$1', $link);
foreach ($sites as $arr)
if (preg_match('`^' . (isset($arr['pattern']) ? $arr['pattern'] : $arr['embed-pattern']) . '`i' . ($context['utf8'] ? 'u' : ''), $link))
return true;

if (function_exists('aeva_foxy_remote_image'))
return aeva_foxy_remote_image($link);

return false;
}

// Generates thumbnail for site if possible
function aeva_generate_embed_thumb($link, $id_album, $id_file = 0, $folder = '')
{
global $embed_album, $embed_folder, $context, $force_id;

$link = preg_replace(array('~\[url=([^]]*)]([^[]*)\[/url]~', '~\[url]([^[]*)\[/url]~'), array('$1', '$1'), $link);
$thumbs = array(
'YouTube' => array(
'func' => 'youtubeCreateThumb',
'pattern' => 'http://(?:video\.google\.(?:com|com?\.[a-z]{2}|[a-z]{2})/[^"]*?)?(?:(?:www|[a-z]{2})\.)?youtube\.com/[^"#[]*?(?:&|&amp;|/|\?|;|\%3F|\%2F)(?:video_id=|v(?:/|=|\%3D|\%2F))([\w-]{11})',
),
'Dailymotion' => array(
'func' => 'dailymotionCreateThumb',
'pattern' => 'http://(?:www\.)?dailymotion\.(?:com|alice\.it)/(?:[^"]*?video|swf)/([a-z0-9]{1,18})',
),
'GoogleVideo' => array(
'func' => 'googleCreateThumb',
'pattern' => 'http://video\.google\.(com|com?\.[a-z]{2}|[a-z]{2})/(?:videoplay|url|googleplayer\.swf)\?[^"]*?docid=([\w-]{1,20})',
),
'MetaCafe' => array(
'func' => 'metacafeCreateThumb',
'pattern' => 'http://(?:www\.)?metacafe\.com/(?:watch|fplayer)/([\w-]{1,20})/',
),
'Vimeo' => array(
'func' => 'vimeoCreateThumb',
'pattern' => 'http://(?:www\.)?vimeo\.com/(\d{1,12})',
),
);

foreach ($thumbs as $ids => $arr)
if (preg_match('`^' . $arr['pattern'] . '.*?$`i' . ($context['utf8'] ? 'u' : ''), $link))
$id = $ids;

$embed_folder = $folder;
$embed_album = $id_album;
$force_id = $id_file;

// Create the thumbnail
return empty($id) ? 0 : $thumbs[$id]['func']($link, '`' . $thumbs[$id]['pattern'] . '`i');
}

// Retrieves Youtube thumbnail. Geek pawaa!
function youtubeCreateThumb($link, $regexp)
{
return preg_match($regexp, $link, $dt) ? aeva_download_thumb('http://img.youtube.com/vi/' . $dt[1] . '/default.jpg', $dt[1]) : 0;
}

function dailymotionCreateThumb($link, $regexp)
{
return preg_match($regexp, $link, $dt) ? aeva_download_thumb('http://www.dailymotion.com/thumbnail/320x240/video/' . $dt[1], $dt[1]) : 0;
}

function googleCreateThumb($link, $regexp)
{
return preg_match($regexp, $link, $dt) ? aeva_download_thumb_via('http://video.google.com/videofeed?docid=' . $dt[2], $dt[2], '<media:thumbnail url="([^"]+)') : 0;
}

function metacafeCreateThumb($link, $regexp)
{
return preg_match($regexp, $link, $dt) ? aeva_download_thumb('http://www.metacafe.com/thumb/' . $dt[1] . '.jpg', $dt[1]) : 0;
}

function vimeoCreateThumb($link, $regexp)
{
return preg_match($regexp, $link, $dt) ? aeva_download_thumb_via('http://vimeo.com/api/clip/' . $dt[1] .'.xml', $dt[1], '<thumbnail_medium>([^<]+)') : 0;
}

function aeva_url_exists($url)
{
$a_url = parse_url($url);
if (!isset($a_url['scheme']))
return false;
$temp = '';
$fid = fsockopen($a_url['host'], !isset($a_url['port']) ? 80 : $a_url['port'], $temp, $temp, 8);
if (!$fid)
return false;
fputs($fid, 'HEAD ' . $a_url['path'] . (isset($a_url['query']) ? '?' . $a_url['query'] : '') . ' HTTP/1.0' . "\r\n" . 'Host: ' . $a_url['host'] . "\r\n\r\n");
$head = fread($fid, 1024);
fclose($fid);
return preg_match('~^HTTP/.+\s+[23][0-9][0-9]~i', $head) == 1;
}

function aeva_download_thumb_via($via_url, $name, $regexp)
{
$via_page = '';
if (aeva_url_exists($via_url))
aeva_download_to_string($via_url, $via_page);
return preg_match('`' . $regexp . '`i', $via_page, $thumb_url) ? aeva_download_thumb(str_replace('&amp;', '&', $thumb_url[1]), $name) : 0;
}

function aeva_download_thumb($url_thumb, $name, $stack = false)
{
global $amSettings, $amFunc, $embed_album, $embed_folder, $force_id;

$dir = !empty($embed_folder) ? $embed_folder : aeva_getSuitableDir($embed_album);
$local_file = $amSettings['data_dir_path'] . '/tmp/thumb_' . $name . '.jpg';
$thumb_length = aeva_url_exists($url_thumb) ? aeva_download_to_local($url_thumb, $local_file) : 0;
if (empty($thumb_length))
return 0;
$my_file = new aeva_media_handler;
$my_file->init($local_file);
list ($width, $height) = $my_file->getSize();
if ($width == 0 || $height == 0)
{
$my_file->close();
@unlink($local_file);
return 0;
}

aeva_deleteFiles($force_id, true);

$id_preview = $stack && function_exists('aeva_foxy_remote_preview') && ($amSettings['max_preview_width'] < $width || $amSettings['max_preview_height'] < $height)
? aeva_foxy_remote_preview($my_file, $local_file, $dir, $name, $width, $height) : 0;

if ($resizedpic = $my_file->createThumbnail($local_file . '2.jpg', min($width, $amSettings['max_thumb_width']), min($height, $amSettings['max_thumb_height'])))
{
list ($twidth, $theight) = $resizedpic->getSize();
$fsize = $resizedpic->getFileSize();
$resizedpic->close();
$twidth = empty($twidth) ? $amSettings['max_thumb_width'] : $twidth;
$theight = empty($theight) ? $amSettings['max_thumb_height'] : $theight;

$id_thumb = aeva_insertFileID(
$force_id, $fsize, 'thumb_' . $name . '.jpg', $twidth, $theight,
substr($dir, strlen($amSettings['data_dir_path']) + 1), $embed_album
);
@rename($local_file . '2.jpg', $dir . '/' . aeva_getEncryptedFilename('thumb_' . $name . '.jpg', $id_thumb, true));
}
else
$id_thumb = 3;

$my_file->close();

@unlink($local_file);
return $stack ? array(true, $id_thumb, $id_preview) : $id_thumb;
}

There is a separate function to obtain a thumbnail for each major website, such as Youtube, Dailymotion, etc.

Offline SMFHacks

  • Administrator
  • Hero Member
  • *****
  • Posts: 16428
    • View Profile
Re: If FFMPEG is installed...
« Reply #13 on: September 03, 2014, 08:56:28 pm »
Either scan though lo.url in php side and just get all the entries in the table that way.

Or you can do a multiple like sql statement for each part and then check in the php code and store the results in a variable for each.
Get your Forum Ranked! at https://www.forumrankings.net - find out how your forum compares with others!

Like What I do? Support me at https://www.patreon.com/vbgamer45/

Offline shuban

  • Hero Member
  • *****
  • Posts: 665
    • View Profile
    • Biology Forums
Re: If FFMPEG is installed...
« Reply #14 on: September 04, 2014, 07:28:41 pm »
Either scan though lo.url in php side and just get all the entries in the table that way.

Or you can do a multiple like sql statement for each part and then check in the php code and store the results in a variable for each.

I'm assuming this comment was for the other thread :p

Any thoughts on adding these functions to Subs-video.php?

 

Related Topics

  Subject / Started by Replies Last post
17 Replies
15993 Views
Last post January 23, 2007, 09:20:12 am
by ksshane
2 Replies
9125 Views
Last post May 14, 2008, 07:28:49 pm
by iturner5150
6 Replies
8040 Views
Last post June 22, 2009, 01:09:31 pm
by mhogue3704
33 Replies
19721 Views
Last post March 13, 2022, 03:27:04 pm
by ozbob
7 Replies
1548 Views
Last post January 10, 2023, 05:56:21 pm
by SMFHacks

+- Recent Topics

is it possible to add support for odysee.com by SMFHacks
March 13, 2024, 10:53:28 pm

Request for admin notification by davejo
March 10, 2024, 01:31:59 am

I need help with torrent upload by Ineedsmfhelp
March 09, 2024, 10:01:13 pm

an idea for new mod (( content type with different display )) by SMFHacks
February 27, 2024, 01:36:27 pm

[Mod] RSS Feed Poster by SMFHacks
February 27, 2024, 11:57:18 am

find duplicate pictures by fvlog19
February 14, 2024, 02:22:40 pm

Error uploading video. by SMFHacks
February 08, 2024, 02:04:16 pm

Gallery icon as last added image by fvlog19
February 01, 2024, 01:04:56 pm

User Gallery Feature: move / bulk move images by SMFHacks
January 30, 2024, 05:48:25 pm

In the future it may be for smf 2.1.x? by smithloo
January 30, 2024, 12:55:34 am

Powered by EzPortal