
Recherche avancée
Autres articles (103)
-
Mise à jour de la version 0.1 vers 0.2
24 juin 2013, parExplications des différents changements notables lors du passage de la version 0.1 de MediaSPIP à la version 0.3. Quelles sont les nouveautés
Au niveau des dépendances logicielles Utilisation des dernières versions de FFMpeg (>= v1.2.1) ; Installation des dépendances pour Smush ; Installation de MediaInfo et FFprobe pour la récupération des métadonnées ; On n’utilise plus ffmpeg2theora ; On n’installe plus flvtool2 au profit de flvtool++ ; On n’installe plus ffmpeg-php qui n’est plus maintenu au (...) -
Ecrire une actualité
21 juin 2013, parPrésentez les changements dans votre MédiaSPIP ou les actualités de vos projets sur votre MédiaSPIP grâce à la rubrique actualités.
Dans le thème par défaut spipeo de MédiaSPIP, les actualités sont affichées en bas de la page principale sous les éditoriaux.
Vous pouvez personnaliser le formulaire de création d’une actualité.
Formulaire de création d’une actualité Dans le cas d’un document de type actualité, les champs proposés par défaut sont : Date de publication ( personnaliser la date de publication ) (...) -
Publier sur MédiaSpip
13 juin 2013Puis-je poster des contenus à partir d’une tablette Ipad ?
Oui, si votre Médiaspip installé est à la version 0.2 ou supérieure. Contacter au besoin l’administrateur de votre MédiaSpip pour le savoir
Sur d’autres sites (20073)
-
How to convert this php code to javascript
5 octobre 2019, par SalmanI have this php code to check the progress percentage of a ffmpeg video conversion. Basically ffmpeg command generates a log file named "output.txt" from where i can estimate the percentage with the help of this code. I want to create a javascript code where i can directly estimate the percentage from the log file.
$content = @file_get_contents('output.txt');
if ($content) {
//get duration of source
preg_match("/Duration: (.*?), start:/", $content, $matches);
$raw_duration = $matches[1];
//raw_duration is in 00:00:00.00 format. This converts it to seconds.
$array_reverse = array_reverse(explode(":", $raw_duration));
$duration = floatval($array_reverse[0]);
if (!empty($array_reverse[1]))
$duration += intval($array_reverse[1]) * 60;
if (!empty($array_reverse[2]))
$duration += intval($array_reverse[2]) * 60 * 60;
//get the time in the file that is already encoded
preg_match_all("/time=(.*?) bitrate/", $content, $matches);
$raw_time = array_pop($matches);
//this is needed if there is more than one match
if (is_array($raw_time)) {
$raw_time = array_pop($raw_time);
}
//raw_time is in 00:00:00.00 format. This converts it to seconds.
$array_reverse = array_reverse(explode(":", $raw_time));
$time = floatval($array_reverse[0]);
if (!empty($array_reverse[1]))
$time += intval($array_reverse[1]) * 60;
if (!empty($array_reverse[2]))
$time += intval($array_reverse[2]) * 60 * 60;
//calculate the progress
$progress = round(($time / $duration) * 100);
echo $duration;
echo $time;
echo $progress;
} -
Python, grab frame number from FFMPEG
22 janvier 2021, par PyrometheousI'm using a script to compile an image sequence into a video.


def ffmpeg_image_sequence(image_sequence, video, fps, encoder):
 global task
 task = False
 path = os.path.dirname(os.path.realpath(image_sequence))
 image_format = {
 'png': '\%06d.png',
 'iff': '\%06d.tiff',
 'tif': '\%06d.tif',
 'jpg': '\%06d.jpg'
 }
 sequence = path + image_format[image_sequence[-3:]]
 output_options = {
 'crf': 20,
 'preset': 'slow',
 'movflags': 'faststart',
 'pix_fmt': 'yuv420p',
 'c:v': encoder,
 'b:v': '20M'
 }
 try:
 (
 ffmpeg
 .input(sequence, framerate=fps)
 .output(video, **output_options)
 ).run()
 except ffmpeg.Error as e:
 warning(str(e))
 task = True



I'm using wxPython for the GUI and ffmpeg for compiling the frames :


import wx
import ffmpeg



I'm running the above function in its own class so that it can be run in a different thread, allowing the statusbar to be updated with how much time has passed.


def wait(start, text):
 time.sleep(.05)
 time_running = round(time.time() - start)
 update_status_bar(main_window, text + ' (Time Elapsed: ' + seconds_to_str(time_running) + ')')



I'd like to replace this with ETA and percentage completed. The window that pops up when running the ffmpeg_image_sequence function displays the following information :


frame=1234 fps= 16 q=13.0 size= 56789kB time=00:38:48.36 bitrate=12345.6kbits/sec speed=0.681x



From what's printed to that window, I'd like to get the current frame= value to determine what percentage of the process is completed, then display something more like :


def wait(text, frame, number_of_frames):
 time.sleep(.05)
 current_frame = frame
 number_of_frames = number_of_files_in_dir - 1
 percentage = round(current_frame / number_of_frames, 1)
 update_status_bar(main_window, text + ' ' + percentage + '% ' + Completed)



With some math to calculate an ETA for completion as well.


So, is there a way to grab that output text from the ffmpeg and turn just that frame= number into a variable ?


-
Minimal configure flags to configure png files to mp4 and gif ?
24 avril 2012, par JonaI'm trying to configure and build ffmpeg only with the most minimum libraries needed to read set of images of png type and convert those images into a movie. The movie output support I need are gif and mp4.
I was able to get mp4 output but gif output I can't get it to work just crashes or exist without errors.
Could not find input stream matching output stream #1.0
There might be some extra configure flags that can be removed too...
Here is my configure :
./configure \
--target-os=linux \
--prefix=$PREFIX \
--enable-cross-compile \
--extra-libs="-lgcc" \
--arch=arm \
--enable-gpl \
--enable-version3 \
--enable-nonfree \
--sysroot=$NDK_SYSROOT \
--extra-cflags="-I../x264 -Ivideokit -O3 -fpic -DANDROID -DHAVE_SYS_UIO_H=1 -Dipv6mr_interface=ipv6mr_ifindex -fasm -Wno-psabi -fno-short-enums -fno-strict-aliasing -finline-limit=300 $OPTIMIZE_CFLAGS " \
--extra-ldflags="-L../x264 -Wl,-rpath-link=/usr/lib -L/usr/lib -nostdlib -lc -lm -ldl -llog" \
--disable-shared \
--enable-static \
--enable-stripping \
--enable-asm \
\
--disable-ffplay \
--disable-ffprobe \
--disable-ffserver \
--disable-doc \
--disable-network \
\
--disable-protocols \
--disable-demuxers \
--disable-decoders \
--disable-encoders \
--disable-muxers \
--enable-libx264 \
--enable-protocol=file \
--enable-demuxer=image2 \
--enable-demuxer=image2pipe \
--enable-demuxer=mjpeg \
--enable-demuxer=rawvideo \
--enable-demuxer=yuv4mpegpipe \
--enable-decoder=png \
--enable-encoder=libx264 \
--enable-encoder=png \
--enable-encoder=mjpeg \
--enable-encoder=gif \
--enable-encoder=mpeg4 \
--enable-encoder=mpeg2video \
--enable-muxer=image2 \
--enable-muxer=image2pipe \
--enable-muxer=mjpeg \
--enable-muxer=mp4 \
--enable-muxer=mpeg2video \
--enable-muxer=rawvideo \
--enable-muxer=yuv4mpegpipe \
--enable-muxer=gif \