Skip to content

fahad-cb/wolfmagic

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

27 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

wolfmagic

Discover, Download, Convert & Edit Videos, Photos & Music

Introduction

WolfMagic is a helper library designed to allow you to search, download, convert & edit videos, photos & music without getting involved with nitty-gritty of APIs and command line tools.

Why Use it

WolfMagic enables you to search videos from over 10 sources including YouTube, DailyMotion, Vimeo, CNN and others. You can download videos from over 30 websites, convert videos & audios from all popular formats to other formats, apply dozens of cool effects on videos & photos with one function calls.

Using WolfMagic will free you from hassle of managing code and tools yourself as we take care of that for you plus you will never feel limited again.

How to use

Installation process is quite simple. Download zip file and extract it. Now include common.php in your file and you are good to go.

All functions, usage and examples

List of functions

cmd()

pex()

is_video()

is_audio()

got_ffmpeg()

get_any_video()

is_photo()

is_type()

count_files()

perm_check()

force_perm()

born_perm()

rand_string()

build_log()

get_video_size()

media_detailer()

can_convert()

convert_video()

merge_videos()

multi_vmerge()

split_video()

multi_splits()

xSplits()

xSecSplit()

get_audio_only()

get_video_only()

resize_video()

conv_1080()

conv_720()

conv_480()

conv_360()

conv_240()

conv_all()

throw_thumb()

xSecThumbs()

xThumbs()

flip()

flip_horizental()

flip_vertical()

flip_both()

grayscale()

grayscale_at()

split_screen()

speedup_video()

slowdown_video()

video_speed()

add_watermark()

watermark_topleft()

watermark_topright()

watermark_bottomleft()

watermark_bottomright()

watermark_center()

mute_at()

add_preroll()

add_midroll()

add_postroll()

add_postpre_roll()

add_allrolls()

reverse_video()

multi_vreverse()

grid_four()

extract_waveform()

hardcode_subtitles()

conv_iconia()

audiox_merge()

convert_mp4()

convert_mov()

convert_wmv()

conv_ipad()

conv_ipad3()

conv_kindle_fire()

add_magic()

convert_photo()

add_text()

text_image()

rotate_photo()

flip_photo()

flip_photo_vertical()

flip_photo_horizental()

grayscale_photo()

navy()

fire()

green_fire()

pink_fire()

orange_fire()

black_fire()

hex_fire()

rgba()

sepia()

invert()

blur_image()

oil_paint()

charcoal()

emboss()

add_toaster()

add_gotham()

add_kelvin()

add_lomo()

add_nashville()

edge_detect()

shade()

double_channel()

make_circled()

is_youtube()

youtube_search()

youtube_search_process()

youtube_channel_search()

youtube_related()

youtube_play()

youtube_content_details()

youtube_duration()

youtube_views()

youtube_likes()

youtube_detailer()

youtube_chan_byname()

youtube_chan_byvideo()

youtube_quality()

youtube_thumbs()

is_youtube_hd()

get_youtube_id()

conv_youtube_time()

youtube_channel()

youtube_channel_process()

youtube_cat_vids()

dailymotion_search()

dailymotion_play()

dailymotion_search_process()

dailymotion_video_details()

vimeo_search()

vimeo_search_process()

vimeo_process_play()

vimeo_play()

yahoo_search()

yahoo_process_search()

valid_yahoo_site()

yahoo_valid_dur()

yahoo_valid_quality()

yahoo_mold_thumb()

scld_search()

scld_track_details()

scld_process_search()

Usage and Examples

cmd()

Execute an external program and get or skip output

$cmd Command that you would like to execute

$out False by default, return full output of command if true

Ex:

$cmd  = 'php --version';
$out = true;
cmd( $cmd, $out );

pex()

Pretty print an array

$array Array to be dumped out

$exit False by default, exits right after dumping

Ex: $array = array( 'Apple' => 'steve_jobs', 'tunepk' => 'arslan_hassan', 'windows' => 'bill_gates' ); pex( $array, true );

is_video()

Check if provided URL or path is a video. If video, returns video extension else returns false

$path { string } { video link or path }

$msg { boolean } { false by default. if set to true, displays operation messages }

Ex:

$path = '/var/www/html/sample.html';
is_video( $path, true );

is_audio()

Checks if provided link is audio. If audio, returns audio format else returns false

$url { string } { link / path to audio }

$msg { boolean } { false by default. if set to true, displays operation messages }

Ex:

$path = 'sample.mp3';
is_audio( $path, true );

got_ffmpeg()

Check if FFMPEG is installed on server

$path Specify direct path to ffmpeg

$msg { boolean } { false by default. shows errors if true }

Ex:

got_ffmpeg( false, true );

get_any_video()

Download any video from internet using YouTube-dl

$url { string } { link to video to download }

$output_path { string } { directory where to save file }

$read_data { boolean } { false by default. Shows output if true }

$msg { boolean } { false by default. Shows errors }

Ex:

$url = 'test.mp4';
$output_path = __DIR__;
get_any_video( $url, $output_path, false, true );

is_photo()

Check if a filepath or URL is a photo or not

$filepath { string } { path to file to check }

$msg { boolean } { shows errors if true }

Ex:

$filepath = 'main.jpg';
is_photo( $filepath, true );

is_type()

Checks if a provided file matches provided extension

$filepath { string } { path or link to file }

$ext { string } { file extension to match against }

Ex: $filepath = 'main.py'; is_photo( $filepath, 'py' );

count_files()

Counts file with certain extension in given directory

$path { string } { path of directory with files to count }

$ext { string } { extension to count files }

Ex:

$path = __DIR__;
$ext = 'php';
count_files( $path, $ext );

perm_check()

Checks if a directory has permissions

$filepath { string } { file to check }

Ex:

$filepath = __DIR__.'/wolf.png';
perm_check( $filepath );

force_perm()

Checks if a file has certain permissions, if not forcefully adds given permissions

$path { string } { place where file is located }

$permissions { integer } { permissions to check and force }

$msg { boolean } { shows error messages }

Ex:

$path = __DIR__.'/files';
$permissions = '0777';
force_perm( $path, $permissions, true);

born_perm()

Creates a new file (php, html, css, text etc) and gives it given permissions

$path { string } { path to create file }

$name { string } { name of file to create }

$content { mixed } { content to hold inside file }

$permissions { integer } { permissions to give to the file }

Ex:

$path = __DIR__.'/files';
$name = 'wolf_magic.me';
$content = 'it works just fine';
$permissions = '0666';
born_perm ( $path, $name, $content, $permissions );

rand_string()

Generates a random string of provided length

$length { integer } { 10 by default. length for random string }

Ex:

rand_string( 5 );

build_log()

Builds log file for a video after conversion

$filepath { string } { log file to be created }

$logData { mixed } { log data to be stored inside of file }

$oright { boolean } { false by default, replace file if true }

$msg { boolean } { false by default, prints error messages }

Ex:

$filepath = 'logdata.txt';
$logData = 'this is sample log data here';
$oright = true;
$msg = true;
build_log( $filepath, $logData, $oright, $msg );

get_video_size()

Gets size of provided video

$video_path { string } { directory path of video }

$msg { boolean } { false by default. if set to true, displays operation messages }

Ex:

$video_path = 'sample.mp4';
get_video_size( $video_path, true);

media_detailer()

Gets all possible details of a media file (video, audio, photo)

$media { string } { path to file to extract details of }

$oneOnly { boolean } { boolean } { false by default, get one specific detail }

$json { boolean } { false by default, returns json data }

$msg { boolean } { false by default, prints error messages }

Ex:

$media = 'test.mp4'l;
$oneOnly = false;
$json = false;
$msg = true;
media_detailer( $media, $oneOnly, $json, $msg );

Ex 2 [ get duration only ]: $media = 'test.mp4'l; $oneOnly = false; $json = false; $msg = true; media_detailer( $media, $oneOnly, $json, $msg );

Other possible single things you can extract are: width = width of media file height = height of media file res = resolution of video file dur = duration of media file size = file size of media file bit_rate = bitrate of media file created = creation date of media file (not all files have this info built in) codec_name = codec name of media file

can_convert()

Check what is max resolution possible conversion for a video

$height { integer } { Height of video to be checked }

Ex:

can_convert(510);

convert_video()

Convert a video from one format to another

$video_path { string } { Path to your video or direct URL to video }

$out_path { string } { Directory to save output file }

$out_format { string } { Format to convert your video to }

$msg { boolean } { False by default, displays error messages if true }

Ex:

$video_path = 'sample.mp4';
$out_path = '/var/www/html';
$out_format = 'mp4';
convert_video( $video_path, $out_path, $out_format, true );

merge_videos()

Merge two videos together and make one video

$vid1 { string } { First video }

$vid2 { string } { Second video }

$output_path { string } { Directory to save converted file to }

$format { string } { Format to convert output file to }

$msg { boolean } { False by default, displays error messages if true }

Ex:

$vid1 = 'sample.mp4';
$vid2 = 'test.mp4';
$output_path = '/var/www/html';
$format = 'mp4';
merge_videos( $vid1, $vid2, $output_path, $format, true );

multi_vmerge()

Combines two videos using FFMPEG

$videos_array { array } { array of videos to be merged }

$output_path { string } { where to save converted file }

$format { string } { file format to save as (Must be video) }

Ex:

$videos_array = array(
               'small.mp4',
               'sample.mp4',
               'test.mp4'     
          );
$output_path = __DIR__.'/files';
$format = 'wmv';
$msg = true;
multi_vmerge( $videos_array, $output_path, $format, $msg );

split_video()

Cuts a part of video as given parameters by user

$video { string } { link or path of video }

$start { integer } { point to start cutting }

$length { integer } { time from start point to end point }

$output_path { string } { where to save output video }

$msg { boolean } { false by default. if set to true, displays operation messages }

multi_splits()

xSplits()

xSecSplit()

get_audio_only()

Extracts audio from a video without downloading or converting that it

$video_path { string } { link to video }

$output_path { string } { directory path to save output audio }

$audio_format { string } { format to store extracted audio }

$bitrate { integer } { 128 by default. Effects audio quality }

$msg { boolean } { false by default. if set to true, displays operation messages }

Ex:

$video_path = 'test.mp4';
$output_path = '/var/www/html';
$audio_format = 'mp3';
$bitrate = '128';
get_audio_only( $video_path, $output_path, $audio_format = '.mp3', $bitrate = 128, true );

get_video_only()

Extracts video from a video while muting its audio completely

$video_path { string } { link to video }

$output_path { string } { place to save output video [dir path only] }

$msg { boolean } { false by default. if set to true, displays operation messages }

Ex:

$video_path = 'test.mp4';
$output_path = '/var/www/html';
get_video_only( $video_path, $output_path, false);

resize_video()

Resizez a video according to parameters provided by users

$video_path { string } { Path to your video or direct URL to video }

$out_path { string } { Directory to save output file }

$out_format { string } { Format to convert your video to }

$resize_to { string } { resizing size e.g (640x480) }

$msg { boolean } { False by default, displays error messages if true }

Ex:

$video_path = 'sample.mp4';
$output_path= '/var/www/html';
$output_format= 'mp4';
resize_video( $video_path, $output_path, $resize_to = '320x240', $output_format, true);

conv_1080()

Converts a video to 1080p video quality

$video_path { string } { Link or path to video }

$output_path { string } { Direcotry path where file is to be saved }

$output_format { string } { Format to convert videos in }

$msg { boolean } { false by default. Shows errors }

Ex:

$video_path = 'sample.mp4';
$output_path= '/var/www/html';
$output_format= 'mp4';
conv_1080( $video_path, $output_path, $output_format, true );

conv_720()

Converts a video to 720p video quality

$video_path { string } { Link or path to video }

$output_path { string } { Direcotry path where file is to be saved }

$output_format { string } { Format to convert videos in }

$msg { boolean } { false by default. Shows errors }

Ex:

$video_path = 'sample.mp4';
$output_path= '/var/www/html';
$output_format= 'mp4';
conv_720( $video_path, $output_path, $output_format, true );

conv_480()

Converts a video to 480p video quality

$video_path { string } { Link or path to video }

$output_path { string } { Direcotry path where file is to be saved }

$output_format { string } { Format to convert videos in }

$msg { boolean } { false by default. Shows errors }

Ex:

$video_path = 'sample.mp4';
$output_path= '/var/www/html';
$output_format= 'mp4';
conv_480( $video_path, $output_path, $output_format, true );

conv_360()

Converts a video to 360p video quality

$video_path { string } { Link or path to video }

$output_path { string } { Direcotry path where file is to be saved }

$output_format { string } { Format to convert videos in }

$msg { boolean } { false by default. Shows errors }

Ex:

$video_path = 'sample.mp4';
$output_path= '/var/www/html';
$output_format= 'mp4';
conv_360( $video_path, $output_path, $output_format, true );

conv_240()

Converts a video to 240p video quality

$video_path { string } { Link or path to video }

$output_path { string } { Direcotry path where file is to be saved }

$output_format { string } { Format to convert videos in }

$msg { boolean } { false by default. Shows errors }

Ex:

$video_path = 'sample.mp4';
$output_path= '/var/www/html';
$output_format= 'mp4';
conv_240( $video_path, $output_path, $output_format, true );

conv_all()

Converts a video to all video qualities

$video_path { string } { Link or path to video }

$output_path { string } { Direcotry path where file is to be saved }

$output_format { string } { Format to convert videos in }

$msg { boolean } { false by default. Shows errors }

Ex:

$video_path = 'sample.mp4';
$output_path= '/var/www/html';
$output_format= 'mp4';
conv_all( $video_path, $output_path, $output_format, true );

throw_thumb()

Generates a thumb of video at given position

$video_path { string } { path to video to get thumb from }

$thumb_path { string } { path of thumb to be saved }

$position { string } { point to capture screenshot at e.g '00:00:02' }

$size { string } { false by default, size of thumb }

$msg { boolean } { false by default, prints error messages }

Ex:

$video_path = 'sample.mp4';
$thumb_path = 'thumb.png';
$position = '00:00:02';
throw_thumb($video_path, $thumb_path, $position, false, true);

xSecThumbs()

Generates a thumb from video after each given seconds

$video_path { string } { path to video to get thumb from }

$thumbs_dir { string } { directory to save thumbs in }

$prefix { mixed } { prefix to add in thumb name }

$xsec { integer } { seconds to generate thumb after }

$ext { string } { png by default, exentsion of thumbs }

$size { string } { false by default, size of generated thumbs }

$msg { boolean } { false by default, prints error messages }

Ex:

$video_path = 'sample.mp4';
$thumbs_dir = __DIR__;
$prefix = 'thumb_';
$xsec = 10;
$ext = 'png';
xSecThumbs($video_path, $thumbs_dir, $prefix, $xsec, $ext, false, false);

xThumbs()

Generates given number of thumbs by automatically calculating video duration

$video_path { string } { path to video to get thumb from }

$thumbs_dir { string } { directory to save thumbs in }

$prefix { mixed } { prefix to add in thumb name }

$thumbs { integer } { 5 by default, number of thumbs to generate from video }

$msg { boolean } { false by default, prints error messages }

Ex:

$video_path = 'sample.mp4';
$thumbs_dir = __DIR__;
$prefix = 'thumb_';
$thumbs = 8;
xThumbs($video_path, $thumbs_dir, $prefix, $thumbs);

flip()

Flip a video in vertical or horizental way

$video_path { string } { path of video to be flipped }

$output_path { string } { path of flipped video to save }

$mode { string } { v by default, direction to flip video } { options: v,h }

$msg { boolean } { false by default, displays messages }

Ex:

$video_path = 'sample.mp4';
$output_path = 'done.mp4';
$mode = 'v';
flip($video_path, $output_path, $mode);

flip_horizental()

Flip a video horizontally

$video_path { string } { path of video to be flipped }

$output_path { string } { path of flipped video to save }

Ex:

$video_path = 'sample.mp4';
$output_path = 'done.mp4';
flip_horizental($video_path, $output_path)

flip_vertical()

Flip a video vertically

$video_path { string } { path of video to be flipped }

$output_path { string } { path of flipped video to save }

Ex:

$video_path = 'sample.mp4';
$output_path = 'done.mp4';
flip_vertical($video_path, $output_path)

flip_both()

Flip a video both vertically and horizentally and create separate output files

$video_path { string } { path of video to be flipped }

$output_dir { string } { directory to save flipped videos }

$ext { string } { mp4 by default, extension of output video }

Ex:

$video_path = 'sample.mp4';
$output_dir = __DIR__;
flip_both($video_path, $output_dir);

grayscale()

Add grayscale effect (make black & white) to a video

$video_path { string } { path of video to be flipped }

$output_path { string } { path of flipped video to save }

Ex:

$video_path = 'sample.mp4';
$output_path = 'gray.mp4';
grayscale($video_path, $output_path);

grayscale_at()

Add grayscale effect at one or multiple points in video

$video_path { string } { path of video to be flipped }

$output_path { string } { path of flipped video to save }

$grey_points { array } { points to add greyscale effect to }

Ex:

$video_path = 'sample.mp4';
$output_path = 'grayed.mp4';
$grey_points = array('5,10', '20,25', '30,33');
grayscale_at($video_path, $output_path, $grey_points);

split_screen()

Show two videos side by side in one video

$vid1 { string } { path to first video }

$vid2 { string } { path to second video }

$output_path { string } { path to output video to be saved }

Ex:

$vid1 = 'hello.mp4';
$vid2 = 'test.mp4';
$output_path = 'split_screen.mp4';
split_screen($vid1, $vid2, $output_path)

speedup_video()

Increases playback speed of video

$video_path { string } { Video to increase speed of }

$output_path { string } { $output_path } { path of output video to save }

$increase { integer } { number to increase speed, points between 0 and 1 }

Ex:

$video_path = 'sample.mp4';
$output_path = 'fast.mp4';
speedup_video($video_path, $output_path);

slowdown_video()

Decrease playback speed of video

$video_path { string } { Video to decrease speed of }

$output_path { string } { $output_path } { path of output video to save }

$increase { integer } { number to decrease speed, points between 0 and 2 }

Ex:

$video_path = 'sample.mp4';
$output_path = 'slow.mp4';
slowdown_video($video_path, $output_path);

video_speed()

Changes playback speed of video

$video_path { string } { Video to change speed of }

$output_path { string } { $output_path } { path of output video to save }\

$mode { string } { i by default, i to increase and d to decrease }

Ex:

$video_path = 'sample.mp4';
$output_path = 'speed.mp4';
video_speed($video_path, $output_path, 'i');

add_watermark()

Adds water to a video at given position

$video_path { string } { Video to add watermark to }

$output_path { $output_path } { path of output video to save }

$img { string } { watermark image to be added }

$position { string } { position to add watermark @ options { tl, tr }}

$msg { boolean } { false by default, displays messages }

Ex: $video_path = 'sample.mp4'; $output_path = 'watermark.mp4'; $img = 'watermark.png'; $position = 'tr'; // top right add_watermark($video_path, $output_path, $img, $position);

watermark_topleft()

Adds watermark at top left corner of video

$video_path { string } { Video to add watermark to }

$output_path { $output_path } { path of output video to save }

$img { string } { watermark image to be added }

Ex:

$video_path = 'sample.mp4';
$output_path = 'watermark.mp4';
$img = 'watermark.png';
watermark_topleft($video_path, $output_path, $img);

watermark_topright()

Adds watermark at top right corner of video

$video_path { string } { Video to add watermark to }

$output_path { $output_path } { path of output video to save }

$img { string } { watermark image to be added }

Ex:

$video_path = 'sample.mp4';
$output_path = 'watermark.mp4';
$img = 'watermark.png';
watermark_topright($video_path, $output_path, $img);

watermark_bottomleft()

Adds watermark at bottom left corner of video

$video_path { string } { Video to add watermark to }

$output_path { $output_path } { path of output video to save }

$img { string } { watermark image to be added }

Ex:

$video_path = 'sample.mp4';
$output_path = 'watermark.mp4';
$img = 'watermark.png';
watermark_bottomleft($video_path, $output_path, $img);

watermark_bottomright()

Adds watermark at bottom right corner of video

$video_path { string } { Video to add watermark to }

$output_path { $output_path } { path of output video to save }

$img { string } { watermark image to be added }

Ex:

$video_path = 'sample.mp4';
$output_path = 'watermark.mp4';
$img = 'watermark.png';
watermark_bottomright($video_path, $output_path, $img);

watermark_center()

Adds watermark at center of video

$video_path { string } { Video to add watermark to }

$output_path { $output_path } { path of output video to save }

$img { string } { watermark image to be added }

Ex:

$video_path = 'sample.mp4';
$output_path = 'watermark.mp4';
$img = 'watermark.png';
watermark_center($video_path, $output_path, $img);

mute_at()

Mutes a video at a given position

$video_path { string } { Video to mute at certain point }

$output_path { string } { $output_path } { path of output video to save }

$mute_points { array } { points to mute video at eg. 10,20}

$msg { boolean } { false by default, displays messages }

Ex:

$video_path = 'sample.mp4';
$output_path = 'muted.mp4';
$mute_points = array('10,13', '20,25', '30,33');
mute_at($video_path, $output_path, $mute_points);

add_preroll()

Add preroll before a video

$video_path { string } { Video to mute at certain point }

$output_path { string } { path of output video to save }

$preroll_path { string } { path of preroll to be added }

$msg { boolean } { false by default, displays messages }

Ex:

$video_path = 'sample.mp4';
$output_path = 'prerolled.mp4';
$preroll_path = 'pre.mp4';
add_preroll($video_path, $output_path, $preroll_path);

add_midroll()

Add midroll to a video

$video_path { string } { Video to mute at certain point }

$output_path { string } { path of output video to save }

$midroll_path { string } { path of midroll to be added }

$msg { boolean } { false by default, displays messages }

Ex:

$video_path = 'sample.mp4';
$output_path = 'prerolled.mp4';
$midroll_path = 'mid.mp4';
add_midroll($video_path, $output_path, $midroll_path);

add_postroll()

Add preroll before a video

$video_path { string } { Video to mute at certain point }

$output_path { string } { path of output video to save }

$postroll_path { string } { path of postroll to be added }

$msg { boolean } { false by default, displays messages }

Ex:

$video_path = 'sample.mp4';
$output_path = 'prerolled.mp4';
$postroll_path = 'post.mp4';
add_postroll($video_path, $output_path, $postroll_path);

add_postpre_roll()

Add preroll and postroll in a video

$video_path { string } { Video to add post and pre roll to }

$output_path { string } { $output_path } { path of output video to save }

$preroll_path { string } { path of preroll to be added }

$postroll_path { string } { path of postroll to be added }

Ex:

$video_path = 'main.mp4';
$output_path = 'out.mp4';
$preroll_path = 'pre.mp4';
$postroll_path = 'post.mp4';
add_postpre_roll($video_path, $output_path, $preroll_path, $postroll_path)

add_allrolls()

Adds post, mid and preroll to a video

$video_path { string } { Video to add post and pre roll to }

$output_path { string } { $output_path } { path of output video to save }

$preroll_path { string } { path of preroll to be added }

$midroll_path { string } { path of midroll to be added }

$postroll_path { string } { path of postroll to be added }

Ex:

$video_path = 'main.mp4';
$output_path = 'out.mp4';
$preroll_path = 'pre.mp4';
$midroll_path = 'mid.mp4';
$postroll_path = 'post.mp4';
add_allrolls($video_path, $output_path, $preroll_path, $midroll_path, $postroll_path)

reverse_video()

Converts a video so that it plays in reverse

$video_path { string } { path to video to be reversed }

$output_path { string } { path of ouput to be saved }

$audio_reverse { string } { fasle by default, reverse audio }

Ex:

$video_path = 'main.mp4';
$output_path = 'out.mp4';
reverse_video($video_path, $output_path);

multi_vreverse()

Converts multiple videos so that they all play in reverse

$videos_array { array } { array of video paths }

$output_dir { string } { directory where to save files }

$audio_reverse { string } { fasle by default, reverse audio }

$format { string } { mp4 by default, output format of videos }

Ex:

$videos_array = array('test.mp4','main.mp4','small.mp4');
$output_dir = __DIR__;
multi_vreverse($videos_array, $output_dir);

grid_four()

Display 4 videos in one video as grid

$videos { array } { paths to 4 videos, all videos need to be of same resoloution }

$output_path { string } { path to save video }

$width { integer } { 1280 by default, width to give to output video }

$height { integer } { 720 by default, height to give to output video }

Ex:

$videos = array(
                        'small.mp4',
                        'test.mp4',
                        'main.mp4',
                        'gray.mp4' 
                   );
$output_path = 'grid.mp4';
grid_four($videos, $output_path)

extract_waveform()

Extracts waveform from video

$video_path { string } { video to extract waveform from }

$output_img { string } { path to save waveform }

$imgsize { string } { size of output image }

Ex:

$video_path = 'small.mp4';
$output_img = 'wave.png';
$imgsize = '1280x240';
extract_waveform($video_path, $output_img, $imgsize)

hardcode_subtitles()

Burn subtitles to video

$video_path { string } { path to video to add subtitles to }

$output_path { string } { path of ouput to be saved }

$sub_file { string } { path to subtitles file to be burned to video }

Ex:

$video_path = 'main.mp4';
$output_path = 'subburned.mp4';
$sub_file = 'main.srt';
hardcode_subtitles($video_path, $output_path, $sub_file)

audiox_merge()

Extract audio from video and merge audio with another audio

$video_path { string } { path to video to extract audio from }

$audio { string } { path of already available audio }

$output_path { string } { path of ouput to be saved }

Ex:

$video_path = 'main.mp4'; 
$audio_path = 'main.mp3';
$output_path = 'xmerged.mp3';
audiox_merge($video, $audio, $output_path)

convert_mp4()

Convert a video to mp4

$video_path { string } { path to video to convert }

$output_path { string } { directory path to save output file in }

$msg { boolean } { false by default, displays messages }

Ex:

$video_path = 'main.mov';
$output_path = __DIR__;
convert_mp4($video_path, $out_path);

convert_mov()

Convert a video to mov

$video_path { string } { path to video to convert }

$output_path { string } { directory path to save output file in }

$msg { boolean } { false by default, displays messages }

Ex:

$video_path = 'main.mp4';
$output_path = __DIR__;
convert_mov($video_path, $out_path);

convert_wmv()

Convert a video to wmv

$video_path { string } { path to video to convert }

$output_path { string } { directory path to save output file in }

$msg { boolean } { false by default, displays messages }

Ex:

$video_path = 'main.mov';
$output_path = __DIR__;
convert_mp4($video_path, $out_path);

conv_iconia()

Converts a video for Accer Iconia Tab, ASUS Transformer TF101 & Transformer Prime TF201

$video_path { string } { path to video to convert }

$output_path { string } { path of ouput to be saved }

$output_format { string } { format of video to be converted }

$msg { boolean } { false by default, displays error messages }

Ex:

$video_path = 'main.mov';
$output_path = __DIR__;
$output_format = 'mp4';
convert_mp4($video_path, $out_path);
conv_iconia( $video_path, $output_path, $output_format);

conv_ipad()

Converts a video for ipad & ipad 2

$video_path { string } { path to video to convert }

$output_path { string } { path of ouput to be saved }

$output_format { string } { format of video to be converted }

$msg { boolean } { false by default, displays error messages }

Ex:

$video_path = 'main.mov';
$output_path = __DIR__;
$output_format = 'mp4';
convert_mp4($video_path, $out_path);
conv_ipad( $video_path, $output_path, $output_format);

conv_ipad3()

Converts a video for ipad3

$video_path { string } { path to video to convert }

$output_path { string } { path of ouput to be saved }

$output_format { string } { format of video to be converted }

$msg { boolean } { false by default, displays error messages }

Ex:

$video_path = 'main.mov';
$output_path = __DIR__;
$output_format = 'mp4';
convert_mp4($video_path, $out_path);
conv_ipad3( $video_path, $output_path, $output_format);

conv_kindle_fire()

Converts a video for Amazon Kindle Fire & Barnes & Noble's NOOK

$video_path { string } { path to video to convert }

$output_path { string } { path of ouput to be saved }

$output_format { string } { format of video to be converted }

$msg { boolean } { false by default, displays error messages }

Ex:

$video_path = 'main.mov';
$output_path = __DIR__;
$output_format = 'mp4';
convert_mp4($video_path, $out_path);
conv_kindle_fire( $video_path, $output_path, $output_format);

add_magic()

Adds specified filter to an image file and is used as primary function for adding various kind of filters on photos

$photo_path { string } { photo to be edited }

$output { string } { path to save output photo }

$magic { string } { filter to add on image }

$extra { string } { false by default, extra paramters for command }

Ex:

$photo_path = 'main.png';
$output = 'edited.png';
$magic = 'sepia';
$extra = '80%';
add_magic($photo_path, $output, $magic, $extra)

convert_photo()

Converts a photo from one type to another

$photo_path { string } { photo to be edited }

$output { string } { path to save output photo }

$resize { string } { false by default, size to be given to photo }

Ex:

$photo_path = 'main.png';
$output = 'edited.png';
convert_photo($photo_path, $output);

add_text()

Adds text to an image

$params { array } { an array with all parameters }

Possible options are: { string } { photo_path } { path of photo to add text to } {required}

{ string } { output } { path of edited photo to save } {required}

{ mixed } { text } { text to be added to image } {required}

{ string } { color } { white by default, color of text }

{ integer } { font_size } { 20 by default, font size of text }

{ integer } { fromtop } { 50 by default, text padding from top }

{ integer } { fromleft } { by default, text padding from left }

{ string } { font } { Arial by default, font of text, make sure server has that font installed }

{ string } { bg } { empty by default, background color of text }

{ mixed } { extra } { empty by default, any extra command parameters to run }

Ex:

$params = array()
$params['photo_path'] = 'main.png';
$params['output'] = 'text_on_image.png';
$params['text'] = 'hell world';
add_text($params);

text_image()

Creates a new image with specified text

$params { array } { an array with all parameters }

Possible options are: { string } { output } { path of edited photo to save } {required}

{ mixed } { text } { text to be added to image } {required}

{ string } { color } { white by default, color of text }

{ integer } { font_size } { 20 by default, font size of text }

{ string } { font } { Arial by default, font of text, make sure server has that font installed }

{ mixed } { extra } { empty by default, any extra command parameters to run }

Ex:

$params = array()
$params['output'] = 'text_image.png';
$params['text'] = 'hell world';
text_image($params);

rotate_photo()

Rotates a photo to specified degrees

$photo_path { string } { path of photo to be rotated }

$output { string } { path to save output photo }

$rotate { integer } { 45 by default, degress to rotate }

Ex:

$photo_path = 'main.png';
$output = 'edited.png';
$rotate = 90;
rotate_photo($photo_path, $output, $rotate);

flip_photo()

Flips a photo in vertical or horizental way

$photo_path { string } { path of photo to be flipped }

$output { string } { path to save output photo }

$flipto { string } { h by default, diection to flip in }

Ex:

$photo_path = 'main.png';
$output = 'edited.png';
$flipto = 'v';
flip_photo($photo_path, $output);

flip_photo_vertical()

Flips a photo vertically

$photo_path { string } { path of photo to be flipped }

$output { string } { path to save output photo }

Ex:

$photo_path = 'main.png';
$output = 'edited.png';
flip_photo_vertical($photo_path, $output)

flip_photo_horizental()

Flips a photo horizentally

$photo_path { string } { path of photo to be flipped }

$output { string } { path to save output photo }

Ex:

$photo_path = 'main.png';
$output = 'edited.png';
flip_photo_horizental($photo_path, $output)

grayscale_photo()

Adds grayscale effect to a photo

$photo_path { string } { path of photo to be grayscaled }

$output { string } { path to save output photo }

$unlink { boolean } { false by default, deletes original file}

Ex:

$photo_path = 'main.png';
$output = 'edited.png';
grayscale_photo($photo_path, $output);

navy()

Adds navy effect to a photo

$photo_path { string } { path of photo to be made navy}

$output { string } { path to save output photo }

Ex:

$photo_path = 'main.png';
$output = 'edited.png';
navy($photo_path, $output)

fire()

Adds fire effect to photo in given color

$photo_path { string } { path of photo to add fire to }

$output { string } { path to save output photo }

$color { stirng } { yellow by default, color of fire effect }

Ex:

$photo_path = 'main.png';
$output = 'edited.png';
fire($photo_path, $output);

green_fire()

Adds green fire effect to photo

$photo_path { string } { path of photo to add fire to }

$output { string } { path to save output photo }

Ex:

$photo_path = 'main.png';
$output = 'edited.png';
green_fire($photo_path, $output)

pink_fire()

Adds pink fire effect to photo

$photo_path { string } { path of photo to add fire to }

$output { string } { path to save output photo }

Ex:

$photo_path = 'main.png';
$output = 'edited.png';
pink_fire($photo_path, $output)

orange_fire()

Adds orange fire effect to photo

$photo_path { string } { path of photo to add fire to }

$output { string } { path to save output photo }

Ex:

$photo_path = 'main.png';
$output = 'edited.png';
orange_fire($photo_path, $output)

black_fire()

Adds black fire effect to photo

$photo_path { string } { path of photo to add fire to }

$output { string } { path to save output photo }

Ex:

$photo_path = 'main.png';
$output = 'edited.png';
black_fire($photo_path, $output)

hex_fire()

Adds hex code fire effect to photo

$photo_path { string } { path of photo to add fire to }

$output { string } { path to save output photo }

Ex:

$photo_path = 'main.png';
$output = 'edited.png';
hex_fire($photo_path, $output, $hex)

rgba()

Adds rgba colors to photo

$photo_path { string } { path of photo to add color to }

$output { string } { path to save output photo }

$rgba_code { string } { rgba code to add color }

Ex:

$photo_path = 'main.png';
$output = 'edited.png';
$rgba_code = '0,0,21,12';
rgba($photo_path, $output, $rgba_code);

sepia()

Adds sepia effect to photo

$photo_path { string } { path of photo to add sepia to }

$output { string } { path to save output photo }

$tone { string } { 80 by default, tone of sepia effect }

Ex:

$photo_path = 'main.png';
$output = 'edited.png';
sepia($photo_path, $output, $tone = '80%')

invert()

Invert an image

$photo_path { string } { path of photo to be edited }

$output { string } { path to save output photo }

Ex:

$photo_path = 'main.png';
$output = 'edited.png';
invert($photo_path, $output)

blur_image()

Blurs an image

$photo_path { string } { path of photo to be edited }

$output { string } { path to save output photo }

$border_color { string } { white by default, color of border }

$border { string } { 20x10 by default, size of border }

$blurness { string } { 5x3 by default, blurness of photo }

Ex:

$photo_path = 'main.png';
$output = 'edited.png';
blur_image($photo_path, $output);

oil_paint()

Adds oil paint effect to photo

$photo_path { string } { path of photo to be flipped }

$output { string } { path to save output photo }

$oil { string } { amount of oil to be added }

Ex:

$photo_path = 'main.png';
$output = 'edited.png';
oil_paint($photo_path, $output, $oil)

charcoal()

Adds charcoal to a photo

$photo_path { string } { path of photo to be edited }

$output { string } { path to save output photo }

$charcoal { string } { amount of charcoal to be added }

Ex:

$photo_path = 'main.png';
$output = 'edited.png';
$charcoal = 'tobedone';
charcoal($photo_path, $output, $charcoal)

emboss()

Adds emboss effect to a photo

$photo_path { string } { path of photo to be edited }

$output { string } { path to save output photo }

$emboss { string } { ebossness to add }

Ex:

$photo_path = 'main.png';
$output = 'edited.png';
$emboss = 'tobedone';
emboss($photo_path, $output, $emboss)

add_toaster()

Adds toaster effect to an image

$photo_path { string } { path of photo to be edited }

$output { string } { path to save output photo }

Ex:

$photo_path = 'main.png';
$output = 'edited.png';
add_toaster($photo_path, $output)

add_gotham()

Adds gotham effect to a photo

$photo_path { string } { path of photo to be edited }

$output { string } { path to save output photo }

Ex:

$photo_path = 'main.png';
$output = 'edited.png';
add_gotham($photo_path, $output)

add_kelvin()

Adds Kelvin effect to a photo

$photo_path { string } { path of photo to be edited }

$output { string } { path to save output photo }

Ex:

$photo_path = 'main.png';
$output = 'edited.png';
add_kelvin($photo_path, $output)

add_lomo()

Adds lomo effect to a photo

$photo_path { string } { path of photo to be edited }

$output { string } { path to save output photo }

Ex:

$photo_path = 'main.png';
$output = 'edited.png';
add_lomo($photo_path, $output) 

add_nashville()

Adds nashville effect to a photo

$photo_path { string } { path of photo to be edited }

$output { string } { path to save output photo }

Ex:

$photo_path = 'main.png';
$output = 'edited.png';
add_nashville($photo_path, $output)

edge_detect()

Detects edges of a photo

$photo_path { string } { path of photo to be edited }

$output { string } { path to save output photo }

$edge { string } { 1 by default, strictness of edge }

Ex:

$photo_path = 'main.png';
$output = 'edited.png';
$edge = 3;
edge_detect($photo_path, $output, $edge)

shade()

Adds shade to a photo

$photo_path { string } { path of photo to be edited }

$output { string } { path to save output photo }

$shade { string } { shade to add to photo }

Ex:

$photo_path = 'main.png';
$output = 'edited.png';
$shade = '0x45';
shade($photo_path, $output, $shade)

double_channel()

Double channels photo

$photo_path { string } { path of photo to be edited }

$second_photo { string } { second photo }

$output { string } { path to save output photo }

$channel { string } { red by default, channel to add to photo }

$size { string } { 100% by default, size of output photo }

Ex:

$photo_path = 'main.png';
$second_photo = 'new.png';
$output = 'edited.png';
double_channel($photo_path, $second_photo, $output);

make_circled()

Makes an image circled

$photo_path { string } { path of photo to be edited }

$output { string } { path to save output photo }

$circle { string } { 64,64,64,0 by default, position and size of circl }

Ex:

$photo_path = 'main.png';
$output = 'edited.png';
make_circled($photo_path, $output);

is_youtube()

youtube_search()

youtube_search_process()

youtube_channel_search()

youtube_related()

youtube_play()

youtube_content_details()

youtube_duration()

youtube_views()

youtube_likes()

youtube_detailer()

youtube_chan_byname()

youtube_chan_byvideo()

youtube_quality()

youtube_thumbs()

is_youtube_hd()

get_youtube_id()

conv_youtube_time()

youtube_channel()

youtube_channel_process()

youtube_cat_vids()

dailymotion_search()

dailymotion_play()

dailymotion_search_process()

dailymotion_video_details()

vimeo_search()

vimeo_search_process()

vimeo_process_play()

vimeo_play()

yahoo_search()

yahoo_process_search()

valid_yahoo_site()

yahoo_valid_dur()

yahoo_valid_quality()

yahoo_mold_thumb()

scld_search()

scld_track_details()

scld_process_search()

About

Discover, Download, Convert & Edit Videos, Photos & Music

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published