
Recherche avancée
Autres articles (35)
-
La file d’attente de SPIPmotion
28 novembre 2010, parUne file d’attente stockée dans la base de donnée
Lors de son installation, SPIPmotion crée une nouvelle table dans la base de donnée intitulée spip_spipmotion_attentes.
Cette nouvelle table est constituée des champs suivants : id_spipmotion_attente, l’identifiant numérique unique de la tâche à traiter ; id_document, l’identifiant numérique du document original à encoder ; id_objet l’identifiant unique de l’objet auquel le document encodé devra être attaché automatiquement ; objet, le type d’objet auquel (...) -
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 -
Encoding and processing into web-friendly formats
13 avril 2011, parMediaSPIP automatically converts uploaded files to internet-compatible formats.
Video files are encoded in MP4, Ogv and WebM (supported by HTML5) and MP4 (supported by Flash).
Audio files are encoded in MP3 and Ogg (supported by HTML5) and MP3 (supported by Flash).
Where possible, text is analyzed in order to retrieve the data needed for search engine detection, and then exported as a series of image files.
All uploaded files are stored online in their original format, so you can (...)
Sur d’autres sites (6469)
-
FFMPEG says "No such file or directory" when trying to convert image sequence
17 juin 2020, par James MorrisFrom the shell, when I specify a sequence of images via
%d
in the input filename, FFMPEG insists "No such file or directory", despite evidence to the contrary. Looking online, I haven't managed to find any references to generating video from a sequence of images using FFMPEG where%d
is not used, yet it seems to fail here.


My images should be identified by FFMPEG from
img%06d.gif
. Issuingls img[0-9][0-9][0-9][0-9][0-9][0-9].gif
succeeds in the very same directory I issue the FFMPEG command.


The command I use is :



ffmpeg -i img%06d.gif -c:v libx264 -r 30 -pix_fmt yuv720p test.mp4




What could possibly be going wrong ???


-
ffmpeg incorrectly adds a fixed delay to the end of each video chunk
13 janvier 2023, par SkylerI am trying to combine audio a video data to output as an mp4 file using the command below, the videos are segmented to match the exact length of the audio file they are going to be merged with :


command = 'ffmpeg -y -i {} -i {} -strict -2 -q:v 1 {} -loglevel {} -c:v h264_nvenc'.format(
 audio_file, temp_result_avi, outfile, self.ffmpeg_loglevel
 )
 subprocess.call(command, shell=True)



however each video made by this is exactly 24 ms longer so this causes large delays as they get stitched back together. This doesnt work since the combined video needs to be combined back with another video and the desync gets worse as you get further in the combined videos.


How can I remedy this ?


-
FFmpeg : crossfading audio with multiple files, but works with video only
12 février 2024, par JayCravensI've found this script that cross-fade's all mp4's in the directory. If I try to add the audio with
AUDIO="[0:a]afade=d=1[a0];"
, using the same iteration, it doesn't work.

This works fine...


#!/bin/bash

CMD="ffmpeg"
FILES=(*.mp4)
SIZE=${#FILES[@]}
VIDEO=""
OUT=""

i="0"
total_duration="0"
for file in "${FILES[@]}"; do
 echo "$file"
 CMD="$CMD -i '$file'"

 duration=$(ffprobe -v error -select_streams v:0 -show_entries stream=duration -of csv=p=0 "$file" | cut -d'.' -f1)

 if [[ "$i" == "0" ]]
 then
 VIDEO="[0:v]setpts=PTS-STARTPTS[v0];"
 else
 fade_start=$((total_duration))
 VIDEO="${VIDEO}[${i}:v]format=yuva420p,fade=in:st=0:d=1:alpha=1,setpts=PTS-STARTPTS+(${fade_start}/TB)[v${i}];"
 if (( i < SIZE-1 ))
 then
 if (( i == 1 ))
 then
 OUT="${OUT}[v0][v1]overlay[outv1];"
 else
 OUT="${OUT}[outv$((i-1))][v${i}]overlay[outv${i}];"
 fi
 else
 if (( SIZE == 2 ))
 then
 OUT="${OUT}[v0][v1]overlay,format=yuv420p[outv]"
 else
 OUT="${OUT}[outv$((i-1))][v${i}]overlay,format=yuv420p[outv]"
 fi
 fi
 fi

 total_duration=$((total_duration+duration))

 i=$((i+1))
done

CMD="$CMD -filter_complex \"${VIDEO}${OUT}\" -c:v libx264 -preset ultrafast -map [outv] crossfade.mp4"

echo "$CMD"

bash -c "$CMD"



I read
acrossfade
requires 32bit little endian, so I went toafade
.
It didn't change anything.

I've got this working via fade in/out, for any number of files, with working audio. I still have to preprocess the audio sections which require fading.


#!/bin/bash

if [ -e *.mkv ]; then
 file_type=".mkv"
else
 file_type=".mp4"
fi

mkdir ./temp
for file in *$file_type; do mv "$file" "in_$file"; done

# Function to fade in video
function fade_in() {
file_list1=(in_*)
 echo "Executing fade_in"
 for file in "${file_list1[@]}"; do
 ffmpeg -i "$file" -y -vf fade=in:0:30 -hide_banner -preset ultrafast "out_$file"
 done
mv in_* ./temp
}
export -f fade_in

# Function to fade out video
function fade_out() {
 file_list2=(out_*)
 echo "Executing fade_out"
 for file in "${file_list2[@]}"; do
 frame_count=$(ffmpeg -i $file -map 0:v:0 -c copy -f null -y /dev/null 2>&1 | grep -Eo 'frame= *[0-9]+ *' | grep -Eo '[0-9]+' | tail -1)
 frame_start=$((frame_count - 30))
 ffmpeg -i "$file" -y -vf fade=out:"$frame_start":30 -hide_banner -preset ultrafast "to_mux_$file"
 done
 mv out_* ./temp
}

export -f fade_out

bash -c "fade_in"
bash -c "fade_out"

ls --quoting-style=shell-always -1v *$file_type > tmp.txt
sed 's/^/file /' tmp.txt > list.txt && rm tmp.txt

ffmpeg -f concat -safe 0 -i list.txt -c copy -shortest -movflags +faststart fade_muxed$file_type

mv to_mux_* ./temp
rm list.txt
#rm -rf ./temp

exit 0



Number the file name's sequentially (i.e. 01_file.mkv 02_file.mkv etc.), to ensure order, or it will be up to the directory sort. Using
ls --quoting-style=shell-always -v1
has proved very reliable. It should handle 99% of naming conventions.It's not a cross fade, but the two second transition is very close. With working and synchronized audio.
If you have a good multi-file concatenation method that includes audio cross-fading, I'm still looking.


Ed Morton, I completely agree, sir. One-hundred percent. I didn't write the first script. I would NEVER use capitals. They're horrible. I
"like_full_words"
with_
's. Never for any reason other than visual though, so that was a great read, I recommend it.