
Recherche avancée
Autres articles (81)
-
Support de tous types de médias
10 avril 2011Contrairement à beaucoup de logiciels et autres plate-formes modernes de partage de documents, MediaSPIP a l’ambition de gérer un maximum de formats de documents différents qu’ils soient de type : images (png, gif, jpg, bmp et autres...) ; audio (MP3, Ogg, Wav et autres...) ; vidéo (Avi, MP4, Ogv, mpg, mov, wmv et autres...) ; contenu textuel, code ou autres (open office, microsoft office (tableur, présentation), web (html, css), LaTeX, Google Earth) (...)
-
Supporting all media types
13 avril 2011, parUnlike most software and media-sharing platforms, MediaSPIP aims to manage as many different media types as possible. The following are just a few examples from an ever-expanding list of supported formats : images : png, gif, jpg, bmp and more audio : MP3, Ogg, Wav and more video : AVI, MP4, OGV, mpg, mov, wmv and more text, code and other data : OpenOffice, Microsoft Office (Word, PowerPoint, Excel), web (html, CSS), LaTeX, Google Earth and (...)
-
Les tâches Cron régulières de la ferme
1er décembre 2010, parLa gestion de la ferme passe par l’exécution à intervalle régulier de plusieurs tâches répétitives dites Cron.
Le super Cron (gestion_mutu_super_cron)
Cette tâche, planifiée chaque minute, a pour simple effet d’appeler le Cron de l’ensemble des instances de la mutualisation régulièrement. Couplée avec un Cron système sur le site central de la mutualisation, cela permet de simplement générer des visites régulières sur les différents sites et éviter que les tâches des sites peu visités soient trop (...)
Sur d’autres sites (5584)
-
writeImages and renaming the images using PHP
3 mai 2015, par Kiran Kumar DashI am working on a multimedia project. So, I am having a case where I am producing a sequence of images from a string input using he code below :
<?php
/*** a new Imagick object ***/
$aniGif = new Imagick();
/*** set the image format to gif ***/
$aniGif->setFormat( "gif" );
/*** a new ImagickPixel object for the colors ***/
$color = new ImagickPixel( "white" );
/*** set color to white ***/
$color->setColor( "white" );
$colorarray =array("white", "red", "blue" , "aqua", "fuchsia", "gray", "lime", "maroon", "navy", "orange", "purple", "silver", "teal", "yellow", "green", "maroon", "green", "olive");
/*** the text for the image ***/
$string = "Hello Kiran Kumar";
/*** a new draw object ***/
$draw = new ImagickDraw();
/*** set the draw font to helvetica ***/
$draw->setFont( "./SociaLAnimaL.ttf" );
/*** set the draw font to helvetica ***/
$draw->setFontSize( "100" );
/*** loop over the text ***/
for ( $i = 0; $i <= strlen( $string ); $i++ )
{
/*** grab a character ***/
$part = substr( $string, 0, $i );
/*** a new ImagickPixel object for the colors ***/
$color = new ImagickPixel( "white" );
/*Generate random number for random color*/
$randomNumber = rand(0,16);
/*** create a new gif frame ***/
$aniGif->newImage( 1920, 1200, $colorarray[$randomNumber] );
/*** add the character to the image ***/
$aniGif->annotateImage( $draw, 960, 600, 0, $part );
/*** set the frame delay to 30 ***/
$aniGif->setImageDelay( 30 );
}
/*** write the file ***/
$aniGif->writeImages($directory.'kiran.jpg', $out);
echo 'all done';
?>Now the problem is the writeimages object is generating images as kiran-0.jpg, kiran-1.jpg, kiran-2.jpg and so on. but what I am expecting is kiran001.jpg, kiran002.jpg, kiran003.jpg...and so on so that I can create a video out of it in while maintaining the sequence.Here is the code for video creation :
<?php
$ffmpeg= "/home/kiran/bin/ffmpeg";
echo exec("$ffmpeg -f image2 -framerate 2/1 -pattern_type glob -i \"/var/www/html/fftest/getthumbnail/tmp/animate/est/*.jpg\" -i \"/var/www/html/fftest/getthumbnail/audios/audio1.mp3\" -c:v libx264 -c:a copy -shortest -s 1920x1080 -r 60 -vf \"format=yuv420p\" \"/var/www/html/fftest/getthumbnail/output/animatedaudiocolor21.avi\" 2>&1" , $output, $return);
?>As you can see I am using -pattern type glob to select all the images, but this is getting confused with he naming sequence of kiran-0, kiran-1.
So, what I am expecting here is how can I use writeimage object o name my images as the way mentioned above. so that I can use kiran%03d.jpg in my ffmpeg command instead of *.jpg.
Or if any one can help me providing a code so that I can rename all the images in the expected manner.I tried the below code to rename all images :
<?php
$fileFolder="/fftest/getthumbnail/tmp/animate/test";
$directory = $_SERVER['DOCUMENT_ROOT'].$fileFolder.'/';
$i = 001;
$handler = opendir($directory);
while ($file = readdir($handler)) {
if ($file != "." && $file != "..") {
$newName = 'kiran'.$i ;
rename($directory.$file, $directory.$newName); // here; prepended a $directory
$i++;
}
}
closedir($handler);
?>But the code is unable to rename the images in sequence.
Help please...
-
How to integrate Netflix audio isma and video ismv files into a single file ?
25 juillet 2012, par ΩmegaHaving Netflix audio
.isma
file and video.ismv
file, how can be those separate files be integrated into a single.mp4
or.flv
file ? Is there some schema or algorithm that can be used to develop such a tool, or is there already a tool available ?
I tried to use ffmpeg as follows :
# ffmpeg -i in.isma -i in.ismv out.mp4
ffmpeg version N-42856-g3ccf22c Copyright (c) 2000-2012 the FFmpeg developers
built on Jul 24 2012 14:59:19 with gcc 4.1.2 (GCC) 20080704 (Red Hat 4.1.2-52)
configuration:
libavutil 51. 65.100 / 51. 65.100
libavcodec 54. 44.100 / 54. 44.100
libavformat 54. 20.100 / 54. 20.100
libavdevice 54. 2.100 / 54. 2.100
libavfilter 3. 3.100 / 3. 3.100
libswscale 2. 1.100 / 2. 1.100
libswresample 0. 15.100 / 0. 15.100
[aac @ 0x98c9ee0] Reserved bit set.
Input #0, mov,mp4,m4a,3gp,3g2,mj2, from 'in.isma':
Metadata:
major_brand : mp42
minor_version : 0
compatible_brands: isomiso2dashiso6piff
creation_time : 1941-03-31 12:20:24
Duration: 00:48:39.59, start: 0.000000, bitrate: 67 kb/s
Stream #0:0(und): Audio: aac (enca / 0x61636E65), 24000 Hz, mono, s16, 62 kb/s
Metadata:
creation_time : 1941-03-31 12:20:24
handler_name : Audio Media Handler
[mov,mp4,m4a,3gp,3g2,mj2 @ 0x98cb020] Could not find codec parameters for stream 0 (Video: none (encv / 0x76636E65), 320x240, 233 kb/s): unknown codec
Consider increasing the value for the 'analyzeduration' and 'probesize' options
in.ismv: could not find codec parametersEven there is no audio error shown in the above response, I was unable to convert the single audio
.isma
file into mp3 or other audio format file. I assume these isma/ismv files are somehow crypted or encoded in non-standard format. Below is a partial dump of audio file.00000000 ...$ftypmp42....isomiso2 00 00 00 24 | 66 74 79 70 | 6D 70 34 32 | 00 00 00 00 | 69 73 6F 6D | 69 73 6F 32
00000018 dashiso6piff...luuidNetf 64 61 73 68 | 69 73 6F 36 | 70 69 66 66 | 00 00 00 6C | 75 75 69 64 | 4E 65 74 66
00000030 lixPiffStrm!.........wªÔ 6C 69 78 50 | 69 66 66 53 | 74 72 6D 21 | 01 00 00 00 | 00 00 00 00 | 01 77 AA D4
00000048 .....˜–€....Ì6Ê«......·û 00 00 00 00 | 00 98 96 80 | 00 00 00 06 | CC 36 CA AB | 00 00 00 00 | 00 00 B7 FB
00000060 .....v†»......KK..l°.... 00 00 00 00 | 01 76 86 BB | 00 00 00 00 | 00 00 4B 4B | 00 00 6C B0 | 00 00 00 00
00000078 ...³..D˜øcÌ_Š7jˆ‘E>"..Þ} 00 00 06 B3 | 00 00 44 98 | F8 63 CC 5F | 8A 37 6A 88 | 91 45 3E 22 | 02 1B DE 7D
00000090 ...nuuid¯3¡ª´%E‘%ÔÚz2ÿ. 00 00 00 6E | 75 75 69 64 | AF 33 A1 90 | AA B4 25 45 | 91 25 D4 DA | 7A 32 FF 05
000000A8 ......./È[<?þÿ.N.e.t.f.l 00 00 00 00 | 00 00 01 2F | C8 5B 3C 3F | FE FF 00 4E | 00 65 00 74 | 00 66 00 6C
000000C0 .i.x. .M.e.d.i.a. .L.i.b 00 69 00 78 | 00 20 00 4D | 00 65 00 64 | 00 69 00 61 | 00 20 00 4C | 00 69 00 62
000000D8 .r.a.r.y. .V.e.r.s.i.o.n 00 72 00 61 | 00 72 00 79 | 00 20 00 56 | 00 65 00 72 | 00 73 00 69 | 00 6F 00 6E
000000F0 . .1.2...3.8.....µmoov.. 00 20 00 31 | 00 32 00 2E | 00 33 00 38 | 00 2E 00 00 | 05 B5 6D 6F | 6F 76 00 00
00000108 .xmvhd........Ééó.....Éé 00 78 6D 76 | 68 64 01 00 | 00 00 00 00 | 00 00 C9 E9 | F3 08 00 00 | 00 00 C9 E9
00000120 ó..˜–€....Ì6Ê«.......... F3 08 00 98 | 96 80 00 00 | 00 06 CC 36 | CA AB 00 01 | 00 00 01 00 | 00 00 00 00
00000138 ........................ 00 00 00 00 | 00 00 00 01 | 00 00 00 00 | 00 00 00 00 | 00 00 00 00 | 00 00 00 01
00000150 ..............@......... 00 00 00 00 | 00 00 00 00 | 00 00 00 00 | 00 00 40 00 | 00 00 00 00 | 00 00 00 00
00000168 ........................ 00 00 00 00 | 00 00 00 00 | 00 00 00 00 | 00 00 00 00 | 00 00 00 00 | 00 02 00 00
00000180 .&pssh....š.ðy˜@B†«’æ[àˆ 02 26 70 73 | 73 68 00 00 | 00 00 9A 04 | F0 79 98 40 | 42 86 AB 92 | E6 5B E0 88
00000198 _•............ü.<.W.R.M. 5F 95 00 00 | 02 06 06 02 | 00 00 01 00 | 01 00 FC 01 | 3C 00 57 00 | 52 00 4D 00
000001B0 H.E.A.D.E.R. .x.m.l.n.s. 48 00 45 00 | 41 00 44 00 | 45 00 52 00 | 20 00 78 00 | 6D 00 6C 00 | 6E 00 73 00
000001C8 =.".h.t.t.p.:././.s.c.h. 3D 00 22 00 | 68 00 74 00 | 74 00 70 00 | 3A 00 2F 00 | 2F 00 73 00 | 63 00 68 00
000001E0 e.m.a.s...m.i.c.r.o.s.o. 65 00 6D 00 | 61 00 73 00 | 2E 00 6D 00 | 69 00 63 00 | 72 00 6F 00 | 73 00 6F 00
000001F8 f.t...c.o.m./.D.R.M./.2. 66 00 74 00 | 2E 00 63 00 | 6F 00 6D 00 | 2F 00 44 00 | 52 00 4D 00 | 2F 00 32 00
00000210 0.0.7./.0.3./.P.l.a.y.R. 30 00 30 00 | 37 00 2F 00 | 30 00 33 00 | 2F 00 50 00 | 6C 00 61 00 | 79 00 52 00
00000228 e.a.d.y.H.e.a.d.e.r.". . 65 00 61 00 | 64 00 79 00 | 48 00 65 00 | 61 00 64 00 | 65 00 72 00 | 22 00 20 00
00000240 v.e.r.s.i.o.n.=.".4...0. 76 00 65 00 | 72 00 73 00 | 69 00 6F 00 | 6E 00 3D 00 | 22 00 34 00 | 2E 00 30 00
00000258 ..0...0.".>.<.D.A.T.A.>. 2E 00 30 00 | 2E 00 30 00 | 22 00 3E 00 | 3C 00 44 00 | 41 00 54 00 | 41 00 3E 00
00000270 <.P.R.O.T.E.C.T.I.N.F.O. 3C 00 50 00 | 52 00 4F 00 | 54 00 45 00 | 43 00 54 00 | 49 00 4E 00 | 46 00 4F 00
00000288 >.<.K.E.Y.L.E.N.>.1.6.<. 3E 00 3C 00 | 4B 00 45 00 | 59 00 4C 00 | 45 00 4E 00 | 3E 00 31 00 | 36 00 3C 00
000002A0 /.K.E.Y.L.E.N.>.<.A.L.G. 2F 00 4B 00 | 45 00 59 00 | 4C 00 45 00 | 4E 00 3E 00 | 3C 00 41 00 | 4C 00 47 00
000002B8 I.D.>.A.E.S.C.T.R.<./.A. 49 00 44 00 | 3E 00 41 00 | 45 00 53 00 | 43 00 54 00 | 52 00 3C 00 | 2F 00 41 00
000002D0 L.G.I.D.>.<./.P.R.O.T.E. 4C 00 47 00 | 49 00 44 00 | 3E 00 3C 00 | 2F 00 50 00 | 52 00 4F 00 | 54 00 45 00
000002E8 C.T.I.N.F.O.>.<.K.I.D.>. 43 00 54 00 | 49 00 4E 00 | 46 00 4F 00 | 3E 00 3C 00 | 4B 00 49 00 | 44 00 3E 00
00000300 A.A.A.A.A.D.k.6./.w.A.A. 41 00 41 00 | 41 00 41 00 | 41 00 44 00 | 6B 00 36 00 | 2F 00 77 00 | 41 00 41 00
00000318 A.A.A.A.A.A.A.A.A.A.=.=. 41 00 41 00 | 41 00 41 00 | 41 00 41 00 | 41 00 41 00 | 41 00 41 00 | 3D 00 3D 00
00000330 <./.K.I.D.>.<.C.H.E.C.K. 3C 00 2F 00 | 4B 00 49 00 | 44 00 3E 00 | 3C 00 43 00 | 48 00 45 00 | 43 00 4B 00
00000348 S.U.M.>.v.R.W.D.3.9.D.o. 53 00 55 00 | 4D 00 3E 00 | 76 00 52 00 | 57 00 44 00 | 33 00 39 00 | 44 00 6F 00
00000360 7.K.Y.=.<./.C.H.E.C.K.S. 37 00 4B 00 | 59 00 3D 00 | 3C 00 2F 00 | 43 00 48 00 | 45 00 43 00 | 4B 00 53 00
00000378 U.M.>.<./.D.A.T.A.>.<./. 55 00 4D 00 | 3E 00 3C 00 | 2F 00 44 00 | 41 00 54 00 | 41 00 3E 00 | 3C 00 2F 00
00000390 W.R.M.H.E.A.D.E.R.>....L 57 00 52 00 | 4D 00 48 00 | 45 00 41 00 | 44 00 45 00 | 52 00 3E 00 | 00 00 00 4C
000003A8 pssh....)p.ä<ÇJ4Œ[®ÇCšG 70 73 73 68 | 00 00 00 00 | 29 70 1F E4 | 3C C7 4A 34 | 8C 5B AE 90 | C7 43 9A 47
000003C0 ...,........9:ÿ.ò...û¡.Ù 00 00 00 2C | 00 00 00 04 | 00 00 00 00 | 39 3A FF 00 | F2 1E 01 1A | FB A1 13 D9
000003D8 n.N®Á7.Üý\8ªv̬.øÀß‹½¸«¾ 6E 1A 4E AE | C1 37 11 DC | FD 5C 38 AA | 76 CC AC 08 | F8 C0 DF 8B | BD B8 AB BE
000003F0 ...‡trak...htkhd........ 00 00 02 87 | 74 72 61 6B | 00 00 00 68 | 74 6B 68 64 | 01 00 00 07 | 00 00 00 00
00000408 Ééó.....Ééó............. C9 E9 F3 08 | 00 00 00 00 | C9 E9 F3 08 | 00 00 00 01 | 00 00 00 00 | 00 00 00 06
00000420 Ì6Ê«.................... CC 36 CA AB | 00 00 00 00 | 00 00 00 00 | 00 00 00 00 | 01 00 00 00 | 00 01 00 00
00000438 ........................ 00 00 00 00 | 00 00 00 00 | 00 00 00 00 | 00 01 00 00 | 00 00 00 00 | 00 00 00 00
00000450 ....@...............mdia 00 00 00 00 | 40 00 00 00 | 00 00 00 00 | 00 00 00 00 | 00 00 02 17 | 6D 64 69 61
00000468 ...,mdhd........Ééó..... 00 00 00 2C | 6D 64 68 64 | 01 00 00 00 | 00 00 00 00 | C9 E9 F3 08 | 00 00 00 00
00000480 Ééó...]À.....-0.UÄ.....4 C9 E9 F3 08 | 00 00 5D C0 | 00 00 00 00 | 04 2D 30 00 | 55 C4 00 00 | 00 00 00 34
00000498 hdlr........soun........ 68 64 6C 72 | 00 00 00 00 | 00 00 00 00 | 73 6F 75 6E | 00 00 00 00 | 00 00 00 00
000004B0 ....Audio Media Handler. 00 00 00 00 | 41 75 64 69 | 6F 20 4D 65 | 64 69 61 20 | 48 61 6E 64 | 6C 65 72 00
000004C8 ...¯minf....smhd........ 00 00 01 AF | 6D 69 6E 66 | 00 00 00 10 | 73 6D 68 64 | 00 00 00 00 | 00 00 00 00
000004E0 ...$dinf....dref........ 00 00 00 24 | 64 69 6E 66 | 00 00 00 1C | 64 72 65 66 | 00 00 00 00 | 00 00 00 01
000004F8 ....url .......sstbl.... 00 00 00 0C | 75 72 6C 20 | 00 00 00 01 | 00 00 01 73 | 73 74 62 6C | 00 00 00 10
00000510 stts............ctts.... 73 74 74 73 | 00 00 00 00 | 00 00 00 00 | 00 00 00 10 | 63 74 74 73 | 00 00 00 00
00000528 ........stsd............ 00 00 00 00 | 00 00 01 17 | 73 74 73 64 | 00 00 00 00 | 00 00 00 01 | 00 00 01 07
00000540 enca.................... 65 6E 63 61 | 00 00 00 00 | 00 00 00 01 | 00 00 00 00 | 00 00 00 00 | 00 02 00 10
00000558 ....]À.....`sinf....frma 00 00 00 00 | 5D C0 00 00 | 00 00 00 60 | 73 69 6E 66 | 00 00 00 0C | 66 72 6D 61
00000570 mp4a....schm....piff.... 6D 70 34 61 | 00 00 00 14 | 73 63 68 6D | 00 00 00 00 | 70 69 66 66 | 00 01 00 01
00000588 ...8schi...0uuid‰tÛÎ{çLQ 00 00 00 38 | 73 63 68 69 | 00 00 00 30 | 75 75 69 64 | 89 74 DB CE | 7B E7 4C 51
000005A0 „ùqHùˆ%T............9:ÿ. 84 F9 71 48 | F9 88 25 54 | 00 00 00 00 | 00 00 01 08 | 00 00 00 00 | 39 3A FF 00
000005B8 ...........Psinf....frma 00 00 00 00 | 00 00 00 00 | 00 00 00 50 | 73 69 6E 66 | 00 00 00 0C | 66 72 6D 61
000005D0 mp4a....schm....cenc.... 6D 70 34 61 | 00 00 00 14 | 73 63 68 6D | 00 00 00 00 | 63 65 6E 63 | 00 01 00 00
000005E8 ...(schi... tenc........ 00 00 00 28 | 73 63 68 69 | 00 00 00 20 | 74 65 6E 63 | 00 00 00 00 | 00 00 01 08
00000600 ....9:ÿ............3esds 00 00 00 00 | 39 3A FF 00 | 00 00 00 00 | 00 00 00 00 | 00 00 00 33 | 65 73 64 73
00000618 .....€€€"....€€€.@...„.. 00 00 00 00 | 03 80 80 80 | 22 00 00 00 | 04 80 80 80 | 14 40 15 00 | 02 84 00 01
00000630 Ô....Â.€€€....€€€......s D4 05 00 01 | 06 C2 05 80 | 80 80 02 13 | 10 06 80 80 | 80 01 02 00 | 00 00 10 73
00000648 tsc............stsz..... 74 73 63 00 | 00 00 00 00 | 00 00 00 00 | 00 00 14 73 | 74 73 7A 00 | 00 00 00 00
00000660 ...........stco......... 00 00 00 00 | 00 00 00 00 | 00 00 10 73 | 74 63 6F 00 | 00 00 00 00 | 00 00 00 00
00000678 ..code>I will appreciate every usefull comment.
-
Revision 15676 : Restauration correcte des types mime des fichiers Ogg sur les branches 2.1 ...
11 mai 2010, par kent1@… — LogRestauration correcte des types mime des fichiers Ogg sur les branches 2.1 et 2.2 (http://trac.rezo.net/trac/spip/ticket/1941) Ajout des types de fichiers : f4a/f4b/f4p/f4v/mpc (http://en.wikipedia.org/wiki/Flv#File_formats) sur les branches 2.1 et 2.2 Report du commit oublié : 14272 (...)