
Recherche avancée
Médias (1)
-
Bug de détection d’ogg
22 mars 2013, par
Mis à jour : Avril 2013
Langue : français
Type : Video
Autres articles (48)
-
Personnaliser les catégories
21 juin 2013, parFormulaire de création d’une catégorie
Pour ceux qui connaissent bien SPIP, une catégorie peut être assimilée à une rubrique.
Dans le cas d’un document de type catégorie, les champs proposés par défaut sont : Texte
On peut modifier ce formulaire dans la partie :
Administration > Configuration des masques de formulaire.
Dans le cas d’un document de type média, les champs non affichés par défaut sont : Descriptif rapide
Par ailleurs, c’est dans cette partie configuration qu’on peut indiquer le (...) -
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. -
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 (11253)
-
recording yuv data which is converted from a bitmap and images are changed constantly on this bitmap
3 février 2016, par UserAxI am trying to record images which are changed at a set time interval. These are displayed on an imageview. (something like a movie maker)
For this I am :
-
Drawing these images on a bitmap, this method is repeated over a 50ms interval
private void BitmapUpdate() {
timer = new Timer();
timer.scheduleAtFixedRate(new TimerTask() {
public void run() {
try {
new Task1().execute();
} catch (Exception e) {
// TODO: handle exception
}
}
}, 0, 50);
}
class Task1 extends AsyncTask {
@Override
protected void onPreExecute() {
super.onPreExecute();
clearBitmap();
}
@Override
protected String doInBackground(Void... arg0) {
onImageDisplayed();
return null;
}
@Override
protected void onPostExecute(String result) {
super.onPostExecute(result);
}
}
public void clearBitmap(){
if (imageview != null){
//All the 3 methods below give same error - can't call getpixels() on recycled bitmap
imageview.setDrawingCacheEnabled(false);
//OR
imageview.destroyDrawingCache();
//OR
bitmap.recycle();
}
}
public void onImageDisplayed(){
if (imageview != null) {
imageview.setDrawingCacheEnabled(true);
imageview.buildDrawingCache();
bitmap = imageview.getDrawingCache();
System.out.println(bitmap.getByteCount() + " is bitmap size ");
}
} -
Using the bitmap data to convert it to yuv data
By using getNV21 method :
Convert bitmap array to YUV (YCbCr NV21)
- Finally this yuv data is passed FFmpeg recorder, through a method similar to onPreviewFrame, except that the data is from getNV21 method. This method is started by a button click.
What I have achieved :
-
If i dont use clearBitmap() ; i get only the first image recorded in the video, even on changing to next image only first image is present throughout the video.
-
So After research on stack overflow many developers suggested clearing the previous imageCache for the next Image. But in my case if i use any of these methods, anywhere,
imageview.setDrawingCacheEnabled(false);
//OR
imageview.destroyDrawingCache();
//OR
bitmap.recycle();
I get the error ; mostly because the getNV21 method is running non stop, and always is expecting pixels flow from the Bitmap.
- If i try running the methods one after another, by stopping getpixels for a moment by a boolean, i only get a black screen.
Kindly help...!
THANKS.
-
-
Generating Gif from Mp4 directly - ffmpeg
20 janvier 2016, par sentyI am trying to generate a gif from an mp4 video file. I want to scale it and crop it while generating.
I achieved that (cropping & scaling) from mp4 to mp4 with the below line , (so I can extract pngs with ffmpeg and use Imagick to make animated gif), but I believe there is a better way of achieving purely with ffmpeg.
ffmpeg -i in.mp4 -filter:v "scale=300:ih*300/iw, crop=200:500:50:80" -c:a copy out.mp4
My question is how to achieve the same this code is doing, but for directly generating gif from mp4.
Then I started tweaking with mp4 to gif conversion, but when palette comes in, I couldn’t fully understand what’s going on.
I found this answer and I made it work, however I couldn’t understand how to adapt scaling & cropping.
$ ffmpeg -y -ss 30 -t 3 -i in.mp4 \
-vf fps=10,scale=320:-1:flags=lanczos,palettegen palette.png$ ffmpeg -ss 30 -t 3 -i in.flv -i palette.png -filter_complex \ "fps=10,scale=320:-1:flags=lanczos[x];[x][1:v]paletteuse" out.gif
I partially understand what this bit does
-y -ss 30 -t 3 -i in.mp4
(getting the first 30 seconds and generating a 3 second gif out of it). But for the next lines, I am completely lost what it is actually doing.It’d be amazing if someone can explain what each command does, or refer a link explaining this topic.
-
FFMPEG progress bar in php
16 mars 2017, par Mick JackI am using ffmpeg to convert a video file large files take a long time to get encode. i will like to show a progress bar with a percentage/time remaining
i saw and tried this example but for some reason the progress bar is not showing.
Html form
<form action="upload.php" method="post" enctype="multipart/form-data">
<label for="file"><span></span></label>
<input type="file" />
<br />
Please enter video title:
<br />
<input />
<br />
<input type="submit" value="Submit" />
</form>
<div title="test">
<h5>Encoding percentage</h5>
<code class="echappe-js"><script src="https://code.jquery.com/jquery-2.1.1.min.js" type="text/javascript"></script><script><br />
$(document).ready(function(){<br />
setInterval(function(){<br />
$("#screen").load('progress.php')<br />
}, 10000);<br />
});<br />
</script>upload.php ffmpeg script
shell_exec("C:\\ffmpeg\\bin\\ffmpeg.exe -y -i ".$target_file." -c:v libx264 -s:v 854x480 -c:a copy \"{$newFileName}\" > logfile.txt 2>&1"); // script to encode video
Progress.php
$content = @file_get_contents('blocks.txt');
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);
echo "Duration: " . $duration . "<br />";
echo "Current Time: " . $time . "<br />";
echo "Progress: " . $progress . "%";
}
?>