
Recherche avancée
Médias (1)
-
Collections - Formulaire de création rapide
19 février 2013, par
Mis à jour : Février 2013
Langue : français
Type : Image
Autres articles (59)
-
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) (...)
-
(Dés)Activation de fonctionnalités (plugins)
18 février 2011, parPour gérer l’ajout et la suppression de fonctionnalités supplémentaires (ou plugins), MediaSPIP utilise à partir de la version 0.2 SVP.
SVP permet l’activation facile de plugins depuis l’espace de configuration de MediaSPIP.
Pour y accéder, il suffit de se rendre dans l’espace de configuration puis de se rendre sur la page "Gestion des plugins".
MediaSPIP est fourni par défaut avec l’ensemble des plugins dits "compatibles", ils ont été testés et intégrés afin de fonctionner parfaitement avec chaque (...) -
Le plugin : Podcasts.
14 juillet 2010, parLe problème du podcasting est à nouveau un problème révélateur de la normalisation des transports de données sur Internet.
Deux formats intéressants existent : Celui développé par Apple, très axé sur l’utilisation d’iTunes dont la SPEC est ici ; Le format "Media RSS Module" qui est plus "libre" notamment soutenu par Yahoo et le logiciel Miro ;
Types de fichiers supportés dans les flux
Le format d’Apple n’autorise que les formats suivants dans ses flux : .mp3 audio/mpeg .m4a audio/x-m4a .mp4 (...)
Sur d’autres sites (6296)
-
x264 encoding with libav
25 mars 2014, par user3453729I try to encode raw image data to x264 with libav :
AVPacket vpkt = { 0 };
av_init_packet(&vpkt);
int got;
int ret = avcodec_encode_video2(vcodec, &vpkt, frameyuv.get(), &got);
if (!ret && got && vpkt.size) {
if (vpkt.pts != AV_NOPTS_VALUE) {
vpkt.pts = av_rescale_q(vpkt.pts, vcodec->time_base, videost->time_base);
}
if (vpkt.dts != AV_NOPTS_VALUE) {
vpkt.dts = av_rescale_q(vpkt.dts, vcodec->time_base, videost->time_base);
}
vpkt.stream_index = videost->index;
if(vcodec->coded_frame->key_frame) {
vpkt.flags |= AV_PKT_FLAG_KEY;
}
/* -> will return -22 if max_b_frames > 0 */
ret = av_interleaved_write_frame(oc, &vpkt);
}Runs fine when vcodec->max_b_frames is set to 0, but on any other value av_interleaved_write_frame returns -22 (invalid argument).
/* will fail */
c->max_b_frames = 3;
/* -> ok*/
c->max_b_frames = 0;Why ? Am i missing something ?
Codec options are
AVDictionary *opts = NULL;
av_dict_set(&opts, "vprofile", "baseline", 0);
/* ... */
c->codec_type = AVMEDIA_TYPE_VIDEO;
c->bit_rate = 500 * 1000;
c->width = VideoWidth;
c->height = VideoHeight;
c->time_base.den = fps;
c->time_base.num = 1;
c->pix_fmt = AV_PIX_FMT_YUV420P;Container format is mp4.
-
Using ffmpeg with Imagick
19 mars 2014, par user3240613I am trying to generate thumbnails from videos in imagick, by extracting a single frame from them, using the ffmpeg application.
I use this code currently :
$image->newPseudoImage( null, null, 'ffmpeg:video.mp4[50]');
It works. But it is not an ideal solution.
I want to generate the thumbnail from a 50% position in the video, but i do not know how long the video is, so I can't do something like ffmpeg:video.mp4[500001]. And even if I knew the length, I still couldn't do it because running this ffmpeg:video.mp4[1000] takes almost 20 seconds to execute (ffmpeg:video.mp4[50] takes one or two seconds only).When i try to add some extra parameters like "ffmpeg:video.mp4[50] -ss 50" it returns error.
The only other option I can think of, is using the exec to directly execute the ffmpeg command in the shell like "ffmpeg -i video.mp4 -vframes 1 -o screenshot.jpg" or something like that. Would that actually be more efficient solution than using the newpseudoimage method ?
-
ffmpeg not returning duration, cant play video until complete. Stream images 2 video via PHP
17 février 2014, par John JI am real struggling with ffmpeg. I am trying to convert images to video, I have an ip camera which I am recording from. The recordings are mjpegs 1 frame per image.
I am trying to create a script in php so I can recreate a video from date to date, this requires inputting the images via image2pipe and then creating the video.
The trouble is, ffmpeg does return the duration and start stats, so I have no way of working out when the video is done or what percentage is done. The video won't play until its finished, and its not a very good UE.
Any ideas of how I can resolve this, the video format can be anything I am open to suggestions.
PHP :
//Shell command
exec('cat /image/dir/*.jpg | ffmpeg -y -c:v mjpeg -f image2pipe -r 10 -i - -c:v libx264 -pix_fmt yuv420p -movflags +faststart myvids/vidname.mp4 1>vidname.txt 2>&1')
//This is loaded via javascript when the video is loaded (which is failing due to stats being wrong
$video_play = "<video width="\"320\"" height="\"240\"" src="\"myvids/vidname.mp4\"" type="\"video/mp4\"\" controls="\"controls\"" preload="\"none\""></video>";Javascript :
//Javascript to create the loop until video is loaded
<code class="echappe-js"><script><br />
$(document).ready(function() {<br />
var loader = $("#clip_load").percentageLoader();<br />
$.ajaxSetup({ cache: false }); // This part addresses an IE bug. without it, IE will only load the first number and will never refresh<br />
var interval = setInterval(updateProgress,1000);<br />
function updateProgress(){ $.get( "&#39;.base_url().&#39;video/getVideoCompile_Process?l=&#39;.$vid_name.&#39;-output.txt&amp;t=per", function( data ) { if(data=>\&#39;100\&#39;){ $("#clip_load").html(\&#39;&#39;.$video_play.&#39;\&#39;); clearInterval(interval); }else{loader.setProgress(data); } }); }<br />
});<br />
</script>PHP (page is called via javascript :
//This is the script which returns the current percentage
$logloc = $this->input->get('l');
$content = @file_get_contents($logloc);
if($content){
//get duration of source
preg_match("/Duration: (.*?), start:/", $content, $matches);
$rawDuration = $matches[1];
//rawDuration is in 00:00:00.00 format. This converts it to seconds.
$ar = array_reverse(explode(":", $rawDuration));
$duration = floatval($ar[0]);
if (!empty($ar[1])) $duration += intval($ar[1]) * 60;
if (!empty($ar[2])) $duration += intval($ar[2]) * 60 * 60;
//get the time in the file that is already encoded
preg_match_all("/time=(.*?) bitrate/", $content, $matches);
$rawTime = array_pop($matches);
//this is needed if there is more than one match
if (is_array($rawTime)){$rawTime = array_pop($rawTime);}
//rawTime is in 00:00:00.00 format. This converts it to seconds.
$ar = array_reverse(explode(":", $rawTime));
$time = floatval($ar[0]);
if (!empty($ar[1])) $time += intval($ar[1]) * 60;
if (!empty($ar[2])) $time += intval($ar[2]) * 60 * 60;
//calculate the progress
$progress = round(($time/$duration) * 100);
if ($this->input->get('t')=='per'){
echo $progress;
}else{
echo "Duration: " . $duration . "<br />";
echo "Current Time: " . $time . "<br />";
echo "Progress: " . $progress . "%";}
}else{ echo "cannot locate";}Thanks