
Recherche avancée
Autres articles (56)
-
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 (...)
-
Le profil des utilisateurs
12 avril 2011, parChaque utilisateur dispose d’une page de profil lui permettant de modifier ses informations personnelle. Dans le menu de haut de page par défaut, un élément de menu est automatiquement créé à l’initialisation de MediaSPIP, visible uniquement si le visiteur est identifié sur le site.
L’utilisateur a accès à la modification de profil depuis sa page auteur, un lien dans la navigation "Modifier votre profil" est (...) -
Configurer la prise en compte des langues
15 novembre 2010, parAccéder à la configuration et ajouter des langues prises en compte
Afin de configurer la prise en compte de nouvelles langues, il est nécessaire de se rendre dans la partie "Administrer" du site.
De là, dans le menu de navigation, vous pouvez accéder à une partie "Gestion des langues" permettant d’activer la prise en compte de nouvelles langues.
Chaque nouvelle langue ajoutée reste désactivable tant qu’aucun objet n’est créé dans cette langue. Dans ce cas, elle devient grisée dans la configuration et (...)
Sur d’autres sites (4866)
-
Revision 70542 : Vérification SIREN/SIRET : tolérer une chaîne contenant des espaces. Ca ...
9 mars 2013, par tcharlss@… — LogVérification SIREN/SIRET : tolérer une chaîne contenant des espaces.
Ca permet une écriture plus lisible => ; 493 056 592 00022 au lieu de 49305659200022 par exemple. -
how to capture continuous Realtime progress stream of output (from ffmpeg)
6 décembre 2022, par user206904I am having trouble showing the progress of ffmpeg through my script. I compile my script to exe with ps2exe and ffmpeg output on standard error instead of outputting on standard out
So I used to pipe 1 option


my script.ps1 now is :


# $nb_of_frames= #some_int
& $ffmpeg_path -progress pipe:1 -i input.mp4 -c:v libx264 -pix_fmt yuv420p -crf 25 -preset fast -an output.mp4



then I compile it with ps2exe. (to reproduce you don't need the compile, just use the above command with pipe:1 directly in cmd or PowerShell you will get the same behavior)


Normally with ffmpeg you get a progress reporting (that is interactive), one line containing the information and it keeps getting updated as 1 single line without spamming the console with 100s of lines, it looks like this.


frame= 7468 fps=115 q=22.0 size= 40704kB time=00:05:10.91 bitrate=1072.5kbits/s speed= 4.8x



But this does not appear in the compiled version of my script, so after digging I added
-progress pipe:1
to get the progress to appear on std out

Now I get a continuous output every second that looks like this :


frame=778
fps=310.36
stream_0_0_q=16.0
bitrate= 855.4kbits/s
total_size=3407872
progress=continue
...
frame=1092
fps=311.04
stream_0_0_q=19.0
bitrate= 699.5kbits/s
total_size=3932160
progress=continue 



I would like to print some sort of updatable percentage out of this, I can compute a percentage easily if I can capture that frame number, but in this case, I don't know how to capture a real-time output like this and how to make my progress reporting update 1 single line of percentage in real-time (or some progress bar via symbols) instead of spamming on many lines


(or if there is a way to make the default progress of FFmpeg appear in the compiled version of my script that would work too)


edit : a suggestion based on the below answer


#use the following lines instead of write-progress if using with ps2exe
 #$a=($frame * 100 / $maxFrames)
 #$str = "#"*$a
 #$str2 = "-"*(100-$a)
 #Write-Host -NoNewLine "`r$a% complete | $str $str2|"




Thanks


-
Creating a single video using extracted frames from several video clips without having to write the frames into a folder
24 décembre 2023, par AthekulI have a set of mp4 video clips named :
file1.mp4, file2.mp4,..filen.mp4.

I want to write a code for going through the files sequentially and extracting a frame every 10 seconds of the video.
Then I want to combine the frames and make one output video file at 6 fps.

I have the code which does that but it extracts frames and stores them in a subfolder before combining them into a video. I think that is inefficient.
Is there a way whereby I can extract frames from the video clips and output the final video without having to store the frames in a folder ?


This is the code that I have.


#!/bin/bash

# Step 1: Extract frames every 10 seconds
input_folder="/home/aj/Videos/merge"
output_folder="/home/aj/Videos/merge"
subfolder="frames"

# Create subfolder if it doesn't exist
mkdir -p "$output_folder/$subfolder"

# Get the total number of input files
total_files=$(find "$input_folder" -maxdepth 1 -type f -name "*.mp4" | wc -l)
processed_files=0
global_frame_counter=0

# Iterate through mp4 files in the input folder
for file in "$input_folder"/*.mp4; do
 filename=$(basename "$file")
 filename_no_ext="${filename%.mp4}"

 # Extract frames every 10 seconds
 ffmpeg -i "$file" -vf fps=1/10 "$output_folder/$subfolder/output_${global_frame_counter}%02d.png"
 
 # Increment the global frame counter
 ((global_frame_counter ++))

 # Increment the processed files count
 ((processed_files++))

 # Calculate and echo the percentage of files processed
 percentage=$((processed_files * 100 / total_files))
 echo -e "\033[1;32mProcessing: $percentage% complete\033[0m"
done

# Step 2: Combine frames into a single video
cd "$output_folder/$subfolder" || exit

ffmpeg -r 6 -f image2 -s 1920x1080 -i "output_%*.png" -vcodec libx264 -crf 25 -pix_fmt yuv420p "$output_folder/result.mp4"

echo "Frames extracted and video created successfully."