
Recherche avancée
Médias (3)
-
Exemple de boutons d’action pour une collection collaborative
27 février 2013, par
Mis à jour : Mars 2013
Langue : français
Type : Image
-
Exemple de boutons d’action pour une collection personnelle
27 février 2013, par
Mis à jour : Février 2013
Langue : English
Type : Image
-
Collections - Formulaire de création rapide
19 février 2013, par
Mis à jour : Février 2013
Langue : français
Type : Image
Autres articles (58)
-
Des sites réalisés avec MediaSPIP
2 mai 2011, parCette page présente quelques-uns des sites fonctionnant sous MediaSPIP.
Vous pouvez bien entendu ajouter le votre grâce au formulaire en bas de page. -
Support audio et vidéo HTML5
10 avril 2011MediaSPIP utilise les balises HTML5 video et audio pour la lecture de documents multimedia en profitant des dernières innovations du W3C supportées par les navigateurs modernes.
Pour les navigateurs plus anciens, le lecteur flash Flowplayer est utilisé.
Le lecteur HTML5 utilisé a été spécifiquement créé pour MediaSPIP : il est complètement modifiable graphiquement pour correspondre à un thème choisi.
Ces technologies permettent de distribuer vidéo et son à la fois sur des ordinateurs conventionnels (...) -
HTML5 audio and video support
13 avril 2011, parMediaSPIP uses HTML5 video and audio tags to play multimedia files, taking advantage of the latest W3C innovations supported by modern browsers.
The MediaSPIP player used has been created specifically for MediaSPIP and can be easily adapted to fit in with a specific theme.
For older browsers the Flowplayer flash fallback is used.
MediaSPIP allows for media playback on major mobile platforms with the above (...)
Sur d’autres sites (5794)
-
Revision b29c48b03c : Shorten GF/arf interval in hard scenes. This patch accounts in the first pass s
6 mars 2015, par paulwilkinsChanged Paths :
Modify /vp9/encoder/vp9_firstpass.c
Shorten GF/arf interval in hard scenes.This patch accounts in the first pass stats for blocks that
while not coded as intra, are complex and have an intra error /
best error ratio below a threshold.The modification shortens the GF arf interval for a particular
class of content that contains a lot of blocks matching the
above criteria. (In one short problem test sequence the average
interval dropped from about 14-15 to 10-11)The change results in small net gains in metrics results for the
Yt( 0.2%) and yt-hd ( 0.5%) sets and is approximately neutral
for the other test sets.The change is currently shielded by a flag and off by default
pending verification that it does not cause other regressions
in tests on a wider YT test set.Change-Id : I6b803daa6a4ac09a6f428fb3a18be1ecedd974b7
-
What is wrong with the following ffmpeg command
9 juin 2017, par BradWhat is wrong with the following ffmpeg command ? Originally this had
-sameq
instead of the-qscale:a 0
Command :
ffmpeg -loglevel debug -threads 4 -i sample-in.mpg -ss 00:00:01 -t 00:00:05 -f image2 -y sample-frames/frame%d.png -acodec copy -qscale:a 0 -y sample.mp3
Output
ffmpeg version 1.2.1 Copyright (c) 2000-2013 the FFmpeg developers
built on Jul 9 2013 04:36:42 with Apple clang version 4.1 (tags/Apple/clang-421.11.66) (based on LLVM 3.1svn)
configuration: --prefix=/usr/local/Cellar/ffmpeg/1.2.1 --enable-shared --enable-pthreads --enable-gpl --enable-version3 --enable-nonfree --enable-hardcoded-tables --enable-avresample --enable-vda --cc=cc --host-cflags= --host-ldflags= --enable-libx264 --enable-libfaac --enable-libmp3lame --enable-libxvid --enable-ffplay
libavutil 52. 18.100 / 52. 18.100
libavcodec 54. 92.100 / 54. 92.100
libavformat 54. 63.104 / 54. 63.104
libavdevice 54. 3.103 / 54. 3.103
libavfilter 3. 42.103 / 3. 42.103
libswscale 2. 2.100 / 2. 2.100
libswresample 0. 17.102 / 0. 17.102
libpostproc 52. 2.100 / 52. 2.100
Splitting the commandline.
Reading option '-loglevel' ... matched as option 'loglevel' (set libav* logging level) with argument 'debug'.
Reading option '-threads' ... matched as AVOption 'threads' with argument '4'.
Reading option '-i' ... matched as input file with argument 'sample-in.mpg'.
Reading option '-ss' ... matched as option 'ss' (set the start time offset) with argument '00:00:01'.
Reading option '-t' ... matched as option 't' (record or transcode "duration" seconds of audio/video) with argument '00:00:05'.
Reading option '-f' ... matched as option 'f' (force format) with argument 'image2'.
Reading option '-y' ... matched as option 'y' (overwrite output files) with argument '1'.
Reading option 'sample-frames/frame%d.png' ... matched as output file.
Reading option '-acodec' ... matched as option 'acodec' (force audio codec ('copy' to copy stream)) with argument 'copy'.
Reading option '-qscale:a' ... matched as option 'qscale' (use fixed quality scale (VBR)) with argument '0'.
Reading option '-y' ... matched as option 'y' (overwrite output files) with argument '1'.
Reading option 'sample.mp3' ... matched as output file.
Finished splitting the commandline.
Parsing a group of options: global .
Applying option loglevel (set libav* logging level) with argument debug.
Applying option y (overwrite output files) with argument 1.
Last message repeated 1 times
Successfully parsed a group of options.
Parsing a group of options: input file sample-in.mpg.
Successfully parsed a group of options.
Opening an input file: sample-in.mpg.
[mpeg @ 0x7ffb4a80f200] Format mpeg probed with size=16384 and score=52
[mpeg @ 0x7ffb4a80f200] File position before avformat_find_stream_info() is 0
[mpeg @ 0x7ffb4a80f200] probing stream 0 pp:2500
[mpeg @ 0x7ffb4a80f200] Probe with size=2002, packets=1 detected mpegvideo with score=25
[mpeg @ 0x7ffb4a80f200] probing stream 0 pp:2499
[mpeg @ 0x7ffb4a80f200] Probe with size=4043, packets=2 detected mpegvideo with score=25
[mpeg @ 0x7ffb4a80f200] probing stream 0 pp:2498
[mpeg @ 0x7ffb4a80f200] Probe with size=6084, packets=3 detected mpegvideo with score=25
[mpeg @ 0x7ffb4a80f200] probing stream 0 pp:2497
[mpeg @ 0x7ffb4a80f200] probing stream 0 pp:2496
[mpeg @ 0x7ffb4a80f200] Probe with size=10166, packets=5 detected mpegvideo with score=25
[mpeg @ 0x7ffb4a80f200] probing stream 0 pp:2495
[mpeg @ 0x7ffb4a80f200] probing stream 0 pp:2494
[mpeg @ 0x7ffb4a80f200] probing stream 0 pp:2493
[mpeg @ 0x7ffb4a80f200] probing stream 0 pp:2492
[mpeg @ 0x7ffb4a80f200] Probe with size=18330, packets=9 detected mpegvideo with score=25
[mpeg @ 0x7ffb4a80f200] probing stream 0 pp:2491
[mpeg @ 0x7ffb4a80f200] probing stream 0 pp:2490
[mpeg @ 0x7ffb4a80f200] probing stream 0 pp:2489
[mpeg @ 0x7ffb4a80f200] probing stream 0 pp:2488
[mpeg @ 0x7ffb4a80f200] probing stream 0 pp:2487
[mpeg @ 0x7ffb4a80f200] probing stream 0 pp:2486
[mpeg @ 0x7ffb4a80f200] probing stream 0 pp:2485
[mpeg @ 0x7ffb4a80f200] probing stream 0 pp:2484
[mpeg @ 0x7ffb4a80f200] Probe with size=34658, packets=17 detected mpegvideo with score=25
[mpeg @ 0x7ffb4a80f200] probing stream 0 pp:2483
[mpeg @ 0x7ffb4a80f200] probing stream 0 pp:2482
[mpeg @ 0x7ffb4a80f200] probing stream 0 pp:2481
[mpeg @ 0x7ffb4a80f200] probing stream 0 pp:2480
[mpeg @ 0x7ffb4a80f200] probing stream 0 pp:2479
[mpeg @ 0x7ffb4a80f200] probing stream 0 pp:2478
[mpeg @ 0x7ffb4a80f200] probing stream 0 pp:2477
[mpeg @ 0x7ffb4a80f200] probing stream 0 pp:2476
[mpeg @ 0x7ffb4a80f200] probing stream 0 pp:2475
[mpeg @ 0x7ffb4a80f200] probing stream 0 pp:2474
[mpeg @ 0x7ffb4a80f200] probing stream 0 pp:2473
[mpeg @ 0x7ffb4a80f200] probing stream 0 pp:2472
[mpeg @ 0x7ffb4a80f200] probing stream 0 pp:2471
[mpeg @ 0x7ffb4a80f200] probing stream 0 pp:2470
[mpeg @ 0x7ffb4a80f200] probing stream 0 pp:2469
[mpeg @ 0x7ffb4a80f200] probing stream 0 pp:2468
[mpeg @ 0x7ffb4a80f200] Probe with size=67266, packets=33 detected mpegvideo with score=51
[mpeg @ 0x7ffb4a80f200] probed stream 0
[mpeg @ 0x7ffb4a80f200] first_dts 86997 not matching first dts 93003 in the queue
Last message repeated 3 times
[mpeg @ 0x7ffb4a80f200] first_dts 86997 not matching first dts 108018 in the queue
Last message repeated 3 times
[mpeg @ 0x7ffb4a80f200] first_dts 90000 not matching first dts 111600 in the queue
Last message repeated 9 times
[mpeg @ 0x7ffb4a80f200] first_dts 90000 not matching first dts 135360 in the queue
Last message repeated 8 times
[mpeg @ 0x7ffb4a80f200] first_dts 90000 not matching first dts 156960 in the queue
Last message repeated 9 times
[mpeg @ 0x7ffb4a80f200] first_dts 90000 not matching first dts 180720 in the queue
Last message repeated 8 times
[mpeg @ 0x7ffb4a80f200] first_dts 90000 not matching first dts 202320 in the queue
Last message repeated 9 times
[mpeg @ 0x7ffb4a80f200] first_dts 90000 not matching first dts 226080 in the queue
Last message repeated 8 times
[mpeg @ 0x7ffb4a80f200] first_dts 90000 not matching first dts 247680 in the queue
Last message repeated 9 times
[mpeg @ 0x7ffb4a80f200] first_dts 90000 not matching first dts 271440 in the queue
Last message repeated 9 times
[mpeg @ 0x7ffb4a80f200] first_dts 90000 not matching first dts 295200 in the queue
Last message repeated 8 times
[mpeg @ 0x7ffb4a80f200] first_dts 90000 not matching first dts 316800 in the queue
Last message repeated 9 times
[mpeg @ 0x7ffb4a80f200] first_dts 90000 not matching first dts 340560 in the queue
Last message repeated 8 times
[mpeg @ 0x7ffb4a80f200] first_dts 90000 not matching first dts 362160 in the queue
Last message repeated 9 times
[mpeg @ 0x7ffb4a80f200] first_dts 90000 not matching first dts 385920 in the queue
Last message repeated 8 times
[mpeg @ 0x7ffb4a80f200] first_dts 90000 not matching first dts 407520 in the queue
Last message repeated 9 times
[mpeg @ 0x7ffb4a80f200] first_dts 90000 not matching first dts 431280 in the queue
Last message repeated 8 times
[mpeg @ 0x7ffb4a80f200] first_dts 90000 not matching first dts 452880 in the queue
Last message repeated 9 times
[mpeg @ 0x7ffb4a80f200] first_dts 90000 not matching first dts 476640 in the queue
Last message repeated 8 times
[mpeg @ 0x7ffb4a80f200] first_dts 90000 not matching first dts 498240 in the queue
Last message repeated 9 times
[mpeg @ 0x7ffb4a80f200] first_dts 90000 not matching first dts 522000 in the queue
Last message repeated 9 times
[mpeg @ 0x7ffb4a80f200] max_analyze_duration 5000000 reached at 5005000 microseconds
[mpeg @ 0x7ffb4a80f200] File position after avformat_find_stream_info() is 0
Input #0, mpeg, from 'sample-in.mpg':
Duration: 00:00:05.97, start: 1.000000, bitrate: 6827 kb/s
Stream #0:0[0x1e0], 152, 1/90000: Video: mpeg1video, yuv420p, 704x480 [SAR 200:219 DAR 880:657], 1001/30000, 104857 kb/s, 29.97 fps, 29.97 tbr, 90k tbn, 29.97 tbc
Stream #0:1[0x1c0], 211, 1/90000: Audio: mp2, 48000 Hz, stereo, s16p, 64 kb/s
Successfully opened the file.
Parsing a group of options: output file sample-frames/frame%d.png.
Applying option ss (set the start time offset) with argument 00:00:01.
Applying option t (record or transcode "duration" seconds of audio/video) with argument 00:00:05.
Applying option f (force format) with argument image2.
Successfully parsed a group of options.
Opening an output file: sample-frames/frame%d.png.
Successfully opened the file.
Parsing a group of options: output file sample.mp3.
Applying option acodec (force audio codec ('copy' to copy stream)) with argument copy.
Applying option qscale:a (use fixed quality scale (VBR)) with argument 0.
Successfully parsed a group of options.
Opening an output file: sample.mp3.
Successfully opened the file.
[buffer @ 0x7ffb4a411e40] Setting entry with key 'video_size' to value '704x480'
[buffer @ 0x7ffb4a411e40] Setting entry with key 'pix_fmt' to value '0'
[buffer @ 0x7ffb4a411e40] Setting entry with key 'time_base' to value '1/90000'
[buffer @ 0x7ffb4a411e40] Setting entry with key 'pixel_aspect' to value '200/219'
[buffer @ 0x7ffb4a411e40] Setting entry with key 'sws_param' to value 'flags=2'
[buffer @ 0x7ffb4a411e40] Setting entry with key 'frame_rate' to value '30000/1001'
[graph 0 input from stream 0:0 @ 0x7ffb4a411de0] w:704 h:480 pixfmt:yuv420p tb:1/90000 fr:30000/1001 sar:200/219 sws_param:flags=2
[scale @ 0x7ffb4a414800] Setting 'w' to value '0'
[scale @ 0x7ffb4a414800] Setting 'h' to value '0'
[scale @ 0x7ffb4a414800] Setting 'flags' to value '0x4'
[auto-inserted scaler 0 @ 0x7ffb4a414740] w:0 h:0 flags:'0x4' interl:0
[format @ 0x7ffb4a42aa20] auto-inserting filter 'auto-inserted scaler 0' between the filter 'Parsed_null_0' and the filter 'format'
[auto-inserted scaler 0 @ 0x7ffb4a414740] picking rgb24 out of 7 ref:yuv420p alpha:0
[auto-inserted scaler 0 @ 0x7ffb4a414740] w:704 h:480 fmt:yuv420p sar:200/219 -> w:704 h:480 fmt:rgb24 sar:200/219 flags:0x4
[png @ 0x7ffb4a831000] detected 4 logical cores
[mp3 @ 0x7ffb4a831600] Invalid audio stream. Exactly one MP3 audio stream is required.
Output #0, image2, to 'sample-frames/frame%d.png':
Metadata:
encoder : Lavf54.63.104
Stream #0:0, 0, 1/90000: Video: png, rgb24, 704x480 [SAR 200:219 DAR 880:657], 1001/30000, q=2-31, 200 kb/s, 90k tbn, 29.97 tbc
Output #1, mp3, to 'sample.mp3':
Metadata:
encoder : Lavf54.63.104
Stream #1:0, 0, 1/90000: Audio: mp2, 48000 Hz, stereo, 64 kb/s
Stream mapping:
Stream #0:0 -> #0:0 (mpeg1video -> png)
Stream #0:1 -> #1:0 (copy)
Could not write header for output file #1 (incorrect codec parameters ?): Invalid argument
Statistics: 4542608 bytes read, 2 seeksI found the code above from : http://kwlug.org/node/854
I did a few edits removing the-sameq
and replacing it with-qscale:a 0
which probably is wrong. -
where to put the watermark png file in this code ?
15 août 2017, par asifthis is a line from ffmpeg video converter php script ;
$ffmpeg." -i ".$video_to_convert." -vcodec flv -f flv -r 30 -b ".$quality."-ab 128000 -ar".$audio." -s ".$size." ".$converted_vids.$name.".".$new_format."
where :
.$video_to_convert. = input file
.$converted_vids.$name. = output file
.$new_format. ; = file extention format
now i want to add watermark.png file, if i put any where i got error conversion
as i added the linelogo.png -filter_complex 'overlay
in video quality line, i got errorError ;
ffmpeg version N-71954-gbc6f84f Copyright (c) 2000-2015 the FFmpeg developers
built with gcc 4.4.7 (GCC) 20120313 (Red Hat 4.4.7-16)
configuration: --prefix=/usr --enable-version3 --enable-gpl --enable-shared --enable-libmp3lame --enable-libvorbis --enable-libtheora --enable-libvpx --enable-libx264 --enable-libxvid --enable-libopencore-amrwb --enable-libopencore-amrnb --enable-postproc --enable-nonfree --enable-pthreads --enable-x11grab --enable-libfaac --enable-libopenjpeg --enable-zlib --disable-doc
libavutil 54. 23.101 / 54. 23.101
libavcodec 56. 37.101 / 56. 37.101
libavformat 56. 31.102 / 56. 31.102
libavdevice 56. 4.100 / 56. 4.100
libavfilter 5. 16.101 / 5. 16.101
libswscale 3. 1.101 / 3. 1.101
libswresample 1. 1.100 / 1. 1.100
libpostproc 53. 3.100 / 53. 3.100
Input #0, mov,mp4,m4a,3gp,3g2,mj2, from 'uploaded/1502801111_21.mp4':
Metadata:
major_brand : isom
minor_version : 512
compatible_brands: isomiso2avc1mp41
encoder : Lavf56.31.102
Duration: 00:02:27.32, start: 0.023220, bitrate: 635 kb/s
Stream #0:0(und): Video: h264 (High) (avc1 / 0x31637661), yuv420p, 480x320 [SAR 1:1 DAR 3:2], 476 kb/s, 25 fps, 25 tbr, 12800 tbn, 50 tbc (default)
Metadata:
handler_name : VideoHandler
Stream #0:1(und): Audio: aac (LC) (mp4a / 0x6134706D), 44100 Hz, stereo, fltp, 151 kb/s (default)
Metadata:
handler_name : SoundHandler
Please use -b:a or -b:v, -b is ambiguous
Cannot find a matching stream for unlabeled input pad 1 on filter Parsed_overlay_0This is index.php file scipt of conversion :
v<?php include("templates/header.php");?>
<div>
<?php
require_once('languages/en.php');
include ("includes/settings.php");
include("includes/functions.php");
include("includes/LIB_parse.php");
include("classes/other.php");
cron(); // to run cron job to delete all files
if(isset($_POST['uploader_0_name']) or isset ($_GET['uploaded_name']))
{
if(isset($_POST['uploader_0_name']))
{
list($_SESSION['original_name'], $ext) = explode('.',$_POST['uploader_0_name']);
}else{
$fullname=$_GET['uploaded_name'];
}
if(isset($_POST['uploader_0_name']))
{
list($_SESSION['original_name'], $ext) = explode('.',$_POST['uploader_0_name']);
}else{
list($_SESSION['original_name'], $ext) = explode('.',$_GET['uploaded_name']);
$_SESSION['original_name']= return_between($_GET['uploaded_name'], '_', "$ext", 'EXCL') ;
$_SESSION['original_name']= str_replace(".","",$_SESSION['original_name']);
}
if(isset($_POST['uploader_0_name']))
{
$fullname= $_POST['uploader_0_tmpname'];
}else{
$fullname=$_GET['uploaded_name'];
}
$ext= pathinfo($fullname, PATHINFO_EXTENSION);
$_SESSION['name']=RemoveExtension($fullname);
$store_dir="uploaded/";
$_SESSION['converted_vids']=$converted_vids;
$_SESSION['temp_dir']=$store_dir;
// if those directotires don't exist - create them and give them read/write permissions
if(!is_dir($store_dir)) mkdir($store_dir, 0777);
if(!is_dir($converted_vids)) mkdir($converted_vids, 0777);
$extension = substr($fullname, strrpos($fullname, "."));
$extension = strtolower($extension);
$video_to_convert=$store_dir.$_SESSION['name'];
$_SESSION['video_to_convert']=$video_to_convert;
$_SESSION['extension']=$extension;
/*******************************
check extenxions
***************************************************/
if (!in_array($ext, $allowedExtensions))
{
echo '<div style="text-align:center"><strong>'.$ext."</strong><br /> is an invalid file type!<br />Supported files are:<br /><strong>";
foreach ($allowedExtensions as $value) { echo $value . "<br />"; }
echo "</strong><br />";
echo "<a href="http://stackoverflow.com/feeds/tag/\"index.php\"">"."<img src="http://stackoverflow.com/feeds/tag/\"images/red-back.png\"" border="\"0\"" style='max-width: 300px; max-height: 300px' /></a></div>";
include("templates/footer.php");
exit;
}
?>
<center>
<form action="index.php" method="post" target="_self">
<br />
<fieldset>
<legend class="show_legend">Convert To</legend>
<div class="radio_buttons">
<img alt="" src="http://stackoverflow.com/feeds/tag/images/flv.jpg" class="format_button" style='max-width: 300px; max-height: 300px' />
<input type="radio" class="blue_font" value="flv" />
<img alt="" src="http://stackoverflow.com/feeds/tag/images/mp4.jpg" class="format_button" style='max-width: 300px; max-height: 300px' />
<input type="radio" value="mp4" />
<img alt="" src="http://stackoverflow.com/feeds/tag/images/wmv.png" class="format_button" style='max-width: 300px; max-height: 300px' />
<input type="radio" value="wmv" />
<img alt="" src="http://stackoverflow.com/feeds/tag/images/avi.png" class="format_button" style='max-width: 300px; max-height: 300px' />
<input type="radio" value="avi" />
<img alt="" src="http://stackoverflow.com/feeds/tag/images/mp3.png" class="format_button" style='max-width: 300px; max-height: 300px' />
<input type="radio" value="mp3" />
<img alt="" src="http://stackoverflow.com/feeds/tag/images/ogg.png" class="format_button" style='max-width: 300px; max-height: 300px' />
<input type="radio" value="ogg" />
<img alt="" src="http://stackoverflow.com/feeds/tag/images/webm.png" class="format_button" style='max-width: 300px; max-height: 300px' />
<input type="radio" value="webm" />
</div>
</fieldset>
<fieldset>
<legend class="show_legend">Optional settings</legend>
<div class="radio_buttons" style="display:inline;padding:10px">
<br />Video quality:
<select class="radio_buttons" disabled="disabled">
<option value="2000000">high</option>
<option value="logo.png -filter_complex 'overlay' ">medium</option>
<option value="-i seen.png \-filter_complex '[0:v][1:v]overlay=10:10:enable=between(t\,15\,25)' -c:v libx264 -pix_fmt yuv420p -movflags faststart">Seen</option>
<option value="-i logo2.png \-filter_complex '[0:v][1:v]overlay=10:10:enable=between(t\,10\,20)'">HD Watermark</option>
<option value="-i logo.png -filter_complex 'overlay'">Watermark</option>
<option value="-vf drawtext='fontsize=20:y=h-line_h-10:x=(2*n)-tw:fontfile='op.ttf':text='DesiBombs.com'' -c:v libx264 -pix_fmt yuv420p -movflags faststart">Watermark</option>
</select>
</div>
<div class="radio_buttons" style="display:inline;padding:10px">Audio quality:
<select class="radio_buttons" disabled="disabled">
<option value="44100">high</option>
<option value="22050">medium</option>
<option value="11025">low</option>
</select>
<div class="radio_buttons" style="display:inline;padding:10px">Video size:
<select class="radio_buttons" disabled="disabled">
<option value="320x240">320x240</option>
<option value="512x384" selected="selected">512x384</option>
<option value="640x360">640x360</option>
<option value="854x480">854x480</option>
<option value="1280x720">1280x720</option>
</select>
</div>
</div></fieldset>
<div class="radio_buttons">
<input type="submit" disabled="disabled" value="" style="display:none" />
</div>
</form></center>
<?php
}
elseif(isset($_POST['type']))
{
$new_format=htmlspecialchars($_POST['type']); // read output format from form
$name=$_SESSION['name'];
//$_SESSION['extension'];
$video_to_convert=$store_dir.$_SESSION['name'].$_SESSION['extension'];
if (isset($_POST['size'])) {$size=$_POST['size'];}
if (isset($_POST['quality'])) {$quality=$_POST['quality'];}
if (isset($_POST['audio'])) {$audio=$_POST['audio'];}
if($new_format=="webm" && $audio=="11025"){$audio="22050";$new_format="webm"; }// for webm and ogg audio can not be 11050
if($new_format=="ogg" && $audio=="11025"){$audio="22050"; $new_format="ogg"; }// for webm and ogg audio can not be 11050
$_SESSION['type']=$new_format;
if($new_format=="flv"){ $call=$ffmpeg." -i ".$video_to_convert." -vcodec flv -f flv -r 30 -b ".$quality."-ab 128000 -ar".$audio." -s ".$size." ".$converted_vids.$name.".".$new_format." -y 2> log/".$name.".txt";}
if($new_format=="avi"){ $call=$ffmpeg." -i ".$video_to_convert." -vcodec mjpeg -f avi -acodec libmp3lame -b ".$quality." -s ".$size." -r 30 -g 12 -qmin 3 -qmax 13 -ab 224 -ar ".$audio." -ac 2 ".$converted_vids.$name.".".$new_format." -y 2> log/".$name.".txt";}
if($new_format=="mp3"){ $call=$ffmpeg." -i ".$video_to_convert." -vn -acodec libmp3lame -ac 2 -ab 128000 -ar ".$audio." ".$converted_vids.$name.".".$new_format." -y 2> log/".$name.".txt";}
if($new_format=="mp4"){ $call=$ffmpeg." -i ".$video_to_convert." -vf logo.png -vcodec mpeg4 -r 30 -b ".$quality." -acodec libmp3lame -ab 126000 -ar ".$audio." -ac 2 -s ".$size." ".$converted_vids.$name.".".$new_format." -y 2> log/".$name.".txt";}
if($new_format=="wmv"){ $call=$ffmpeg." -i ".$video_to_convert." -vcodec wmv1 -r 30 -b ".$quality." -acodec wmav2 -ab 128000 -ar ".$audio." -ac 2 -s ".$size." ".$converted_vids.$name.".".$new_format." -y 2> log/".$name.".txt";}
if($new_format=="ogg"){ $call=$ffmpeg." -i ".$video_to_convert." -vcodec libtheora -r 30 -b ".$quality." -acodec libvorbis -ab 128000 -ar ".$audio." -ac 2 -s ".$size." ".$converted_vids.$name.".".$new_format." -y 2> log/".$name.".txt";}
if($new_format=="webm"){ $call=$ffmpeg." -i ".$video_to_convert." -vcodec libvpx -r 30 -b ".$quality." -acodec libvorbis -ab 128000 -ar ".$audio." -ac 2 -s ".$size." ".$converted_vids.$name.".".$new_format." -y 2> log/".$name.".txt";}
/* START CONVERTING The Video */
require_once("includes/ffmpeg_cmd.php");
$convert = (popen($convert_call, "r"));
pclose($convert);
flush();
// define sessions
$_SESSION['dest_file']=$converted_vids.$name.".".$new_format;
echo "<code class="echappe-js"><script>\n";<br />
echo "counter = 5\n";<br />
echo "var redirect = 0; \n";<br />
echo "$(document).ready(function()\n";<br />
echo "{\n";<br />
echo "var refreshId = setInterval(function() \n";<br />
echo "{\n";<br />
echo "if(redirect == 0) \n { \n";<br />
echo "$('#timeval').load('progress_bar.php');\n";<br />
echo "}\n";<br />
echo "else \n";<br />
echo "{\n";<br />
echo "$('#timeval').load('progress_bar.php?counter='+ counter--);\n";<br />
echo "}\n";<br />
echo "}, 1000);\n";<br />
echo "});\n"; <br />
echo "</script>\n" ;
//
/************************* for debug *************************************
echo "" ; print_r ($_SESSION) ; echo "
" ; **********************************************************************************/
?>
< ?php
else if(isset($_GET[’finished’]))
echo "" ; if(!isset($_SESSION[’name’])) echo "please convert new video" ;include("templates/footer.php") ; ;exit ; $filepath=$converted_vids."./".$_SESSION[’name’].".".$_SESSION[’type’] ; require_once"video_duration.php" ;
$_SESSION[’duration’]=$hours." :".$minutes." :".$seconds ;
$vid_name=$_SESSION[’name’] ;
$vid_src=$_SESSION[’extension’] ;
$vid_new=$_SESSION[’type’] ;
if (isset($_SESSION[’duration’])) $duration=$_SESSION[’duration’] ;else $duration="unknown" ;
if(file_exists($converted_vids.$vid_name.".".$vid_new))
$vid_size=get_size($converted_vids.$vid_name.".".$vid_new) ;
else $vid_size=0 ;?>
your video informationVideo duration < ?php echo $hours." :".$minutes." :".$seconds ; ?> original video name < ?php if(isset($_SESSION[’original_name’]))echo $_SESSION[’original_name’] ; ?> video size < ?php echo $vid_size." MB
" ; ?>source extension < ?php echo str_replace(".","","$vid_src") ; ?> new extension < ?php echo $vid_new ; ?> < ?php
echo "
" ;
session_unset() ;
else
?><script type="text/javascript"><br />
// Convert divs to queue widgets when the DOM is ready<br />
$(function() {<br />
$("#uploader").pluploadQueue({<br />
// General settings<br />
runtimes : 'flash',<br />
url : 'upload.php',<br />
max_file_size : '&lt;?php echo $max_file_size ;?>mb',<br />
chunk_size : '1mb',<br />
unique_names : true,<br />
<br />
// Resize images on clientside if we can<br />
resize : {width : 320, height : 240, quality : 90},<br />
init : {<br />
FilesAdded: function(up, files) {<br />
plupload.each(files, function(file) {<br />
if (up.files.length > 1) {<br />
up.removeFile(file);<br />
}<br />
});<br />
if (up.files.length >= 1) {<br />
$('#pickfiles').hide('slow');<br />
}<br />
},<br />
FilesRemoved: function(up, files) {<br />
if (up.files.length < 1) {<br />
$('#pickfiles').fadeIn('slow');<br />
}<br />
}<br />
},<br />
multi_selection: false,<br />
// Specify what files to browse for<br />
filters : [<br />
{title : "Video files", extensions : "&lt;?php foreach ($allowedExtensions as $value) { echo $value . ","; }?>"}<br />
<br />
],<br />
<br />
// Flash settings<br />
flash_swf_url : 'js/plupload.flash.swf',<br />
<br />
// Silverlight settings<br />
silverlight_xap_url : 'js/plupload.silverlight.xap'<br />
});<br />
<br />
// Client side form validation<br />
$('form').submit(function(e) {<br />
var uploader = $('#uploader').pluploadQueue();<br />
<br />
// Files in queue upload them first<br />
if (uploader.files.length > 0) {<br />
// When all files are uploaded submit form<br />
uploader.bind('StateChanged', function() {<br />
if (uploader.files.length === (uploader.total.uploaded + uploader.total.failed)) {<br />
$('form')[0].submit();<br />
}<br />
});<br />
<br />
uploader.start();<br />
} else {<br />
alert('You must queue at least one video.');<br />
}<br />
<br />
return false;<br />
});<br />
});<br />
</script>Maximum upload size < ?php echo $max_file_size ; ?> MB
< ?php include("templates/info.php") ; ?>
< ?php
//End Body Area/
?>