
Recherche avancée
Médias (2)
-
Valkaama DVD Label
4 octobre 2011, par
Mis à jour : Février 2013
Langue : English
Type : Image
-
Podcasting Legal guide
16 mai 2011, par
Mis à jour : Mai 2011
Langue : English
Type : Texte
Autres articles (111)
-
Script d’installation automatique de MediaSPIP
25 avril 2011, parAfin de palier aux difficultés d’installation dues principalement aux dépendances logicielles coté serveur, un script d’installation "tout en un" en bash a été créé afin de faciliter cette étape sur un serveur doté d’une distribution Linux compatible.
Vous devez bénéficier d’un accès SSH à votre serveur et d’un compte "root" afin de l’utiliser, ce qui permettra d’installer les dépendances. Contactez votre hébergeur si vous ne disposez pas de cela.
La documentation de l’utilisation du script d’installation (...) -
Ajouter des informations spécifiques aux utilisateurs et autres modifications de comportement liées aux auteurs
12 avril 2011, parLa manière la plus simple d’ajouter des informations aux auteurs est d’installer le plugin Inscription3. Il permet également de modifier certains comportements liés aux utilisateurs (référez-vous à sa documentation pour plus d’informations).
Il est également possible d’ajouter des champs aux auteurs en installant les plugins champs extras 2 et Interface pour champs extras. -
Que fait exactement ce script ?
18 janvier 2011, parCe script est écrit en bash. Il est donc facilement utilisable sur n’importe quel serveur.
Il n’est compatible qu’avec une liste de distributions précises (voir Liste des distributions compatibles).
Installation de dépendances de MediaSPIP
Son rôle principal est d’installer l’ensemble des dépendances logicielles nécessaires coté serveur à savoir :
Les outils de base pour pouvoir installer le reste des dépendances Les outils de développements : build-essential (via APT depuis les dépôts officiels) ; (...)
Sur d’autres sites (11116)
-
how to get exact position in video as image view ?
16 février 2024, par Dhruvisha JoshiI want to give photo editing feature in my app. so I am allowing user to add text to photo and after that I want to convert it to video using Ffmpeg command.


here is my command that adds text and convert photo to video.

ffmpeg -loop 1 -i /var/mobile/Containers/Data/Application/88F535C3-A300-456C-97BB-1A9B83EAEE7B/Documents/Compress_Picture/input.jpg -filter_complex "[0]scale=1080:trunc(ow/a/2)*2[video0];[video0]drawtext=text='Dyjfyjyrjyfjyfkyfk':fontfile=/private/var/containers/Bundle/Application/DE5C8DAA-4D66-4345-834A-89F8AC19DF9B/Clear Status.app/avenyt.ttf:fontsize=66.55112651646448:fontcolor=#FFFFFF:x=349.92:y=930.051993067591" -c:v libx264 -t 5 -pix_fmt yuv420p -y /var/mobile/Containers/Data/Application/88F535C3-A300-456C-97BB-1A9B83EAEE7B/Documents/Compress_Picture/output0.mp4


here is my swift code to generate command.


var filterComplex = ""
var inputs = ""
var audioIndex = ""

if currentPhotoTextDataArray.contains(where: { $0.isLocation }) {
 // At least one element has isLocation set to true
 // Do something here
 print("There's at least one element with isLocation == true")
 inputs = "-i \(inputPath) -i \(self.locImagePath)"
 audioIndex = "2"
 
 } else {
 // No elements have isLocation == true
 print("No elements have isLocation set to true")
 inputs = "-i \(inputPath)"
 audioIndex = "1"
 }
 
 for (index, textData) in currentPhotoTextDataArray.enumerated() {
 print("x: \(textData.xPosition), y: \(textData.yPosition)")
 let x = (textData.xPosition) * 1080 / self.photoViewWidth
 let y = (textData.yPosition) * 1920 / self.photoViewHeight
 
 let fontSizeForWidth = (textData.fontSize * 1080) / self.photoViewWidth
 let fontSizeForHeight = (textData.fontSize * 1920) / self.photoViewHeight
 print("fontSizeForWidth: \(fontSizeForWidth)")
 print("fontSizeForHeight: \(fontSizeForHeight)")
 
 let fontPath = textData.font.fontPath
 let fontColor = textData.fontColor.toHexOrASS(format: "hex")
 let backColor = textData.backColor?.toHexOrASS(format: "hex")
 print("fontPath: \(fontPath)")
 print("fontColor: \(fontColor)")
 
 let breakedText = self.addBreaks(in: textData.text, with: UIFont(name: textData.font.fontName, size: fontSizeForHeight) ?? UIFont(), forWidth: 1080, padding: Int(x))
 
 if textData.isLocation {
 print("Location is there.")
 
 let textFont = UIFont(name: textData.font.fontName, size: fontSizeForHeight)
 let attributes: [NSAttributedString.Key: Any] = [NSAttributedString.Key.font: textFont ?? UIFont()]
 let size = (textData.text as NSString).size(withAttributes: attributes)
 let textWidth = Int(size.width) + 130
 
 var endTimeLoc = 0.0
 if let audioData = self.audioDataArray.first(where: { $0.photoIndex == mainIndex }) {
 let duration = audioData.audioEndTime - audioData.audioStartTime
 endTimeLoc = duration
 } else {
 endTimeLoc = 5
 }
 
 let layerFilter = "color=color=black@.38:size=\(textWidth)x130[layer0];[video\(index)][layer0]overlay=enable='between(t,0,\(endTimeLoc))':x=\(x):y=(\(y)-(overlay_h/2))[layer1];"
 filterComplex += layerFilter
 let imageFilter = "[1:v]scale=80:80[image];[layer1][image]overlay=enable='between(t,0,\(endTimeLoc))':x=\(x)+10:y=(\(y)-(overlay_h/2))[v\(index)];"
 filterComplex += imageFilter
 
 if index == currentPhotoTextDataArray.count - 1 {
 let textFilter = "[v\(index)]drawtext=text='\(breakedText)':fontfile=\(fontPath):fontsize=\(fontSizeForHeight):fontcolor=\(fontColor):x=(\(x)+100):y=(\(y)-(text_h/2))"
 filterComplex += textFilter
 } else {
 let textFilter = "[v\(index)]drawtext=text='\(breakedText)':fontfile=\(fontPath):fontsize=\(fontSizeForHeight):fontcolor=\(fontColor):x=(\(x)+100):y=(\(y)-(text_h/2))[video\(index + 1)];"
 filterComplex += textFilter
 }
 
 } else {
 
 let textBack = textData.backColor != nil ? ":box=1:boxcolor=\(backColor ?? "")@0.8:boxborderw=25" : ""
 
 if index == currentPhotoTextDataArray.count - 1 {
 let textFilter = "[video\(index)]drawtext=text='\(breakedText)':fontfile=\(fontPath):fontsize=\(fontSizeForHeight):fontcolor=\(fontColor):x=\(x):y=\(y)\(textBack)"
 filterComplex += textFilter
 } else {
 let textFilter = "[video\(index)]drawtext=text='\(breakedText)':fontfile=\(fontPath):fontsize=\(fontSizeForHeight):fontcolor=\(fontColor):x=\(x):y=\(y)\(textBack)[video\(index + 1)];"
 filterComplex += textFilter
 }
 }
 
 }
 
 if let audioData = self.audioDataArray.first(where: { $0.photoIndex == mainIndex }) {
 
 let audioSTime = self.getSTimeAudio(index: mainIndex, secondsPhoto: Int(audioData.audioStartTime))
 let audioETime = self.getETimeAudio(index: mainIndex, secondsPhoto: Int(audioData.audioEndTime))
 let duration = audioData.audioEndTime - audioData.audioStartTime
 
 command = "-loop 1 \(inputs) -ss \(audioSTime) -to \(audioETime) -i \"\(audioData.audioURL.path)\" -filter_complex \"[0]scale=1080:trunc(ow/a/2)*2[video0];\(filterComplex)[final_video]\" -map \"[final_video]\":v -map \(audioIndex):a -c:v libx264 -t \(duration) -pix_fmt yuv420p -y \(outputURL.path)"
 
 } else {
 command = "-loop 1 \(inputs) -filter_complex \"[0]scale=1080:trunc(ow/a/2)*2[video0];\(filterComplex)\" -c:v libx264 -t 5 -pix_fmt yuv420p -y \(outputURL.path)"
 }
 }



I am not getting exact position of text in generated video as added by user. if anyone knows please help me with this.


-
Ffmpeg video of images in loop ?
4 février 2024, par DanielI am trying to make a video from 2 images repeating in loop :
image1.png to be shown 1.2 seconds.
Then image2.png to be shown for 3 seconds.
Video should be long 180 seconds.
png images are different resolution, image1 is smaller, image2 is 1080*1920, video should use resolution of a image2, and image1 should be shown in its original size, not stretched.


ffmpeg -loop 1 -t 1.2 -i image1.png -loop 1 -t 3 -i image2.png -filter_complex "[0:v]scale=1920:1080:force_original_aspect_ratio=decrease[img1];[1:v][img1]overlay=eof_action=repeat[video]" -map "[video]" -t 180 -r 30 -y output.mp4


Output is 3 seconds long and show only image1 ?


-
FFMPEG use audio volume as param for filters
2 septembre 2016, par user3878395Can someone help me with FFMPEG’s
filter_complex
? I need to use the volume from an audio channel as param for filters (logo size dependent on audio volume).I have this command and I need it to change size of [3:v] (logo.png) by audio volume from [2:a] (test.mp3)
bin/ffmpeg -loop 1 -f image2 -i img.jpg -i hp.png -ss 20 -t 4 -i test.mp3 -i logo.png -filter_complex "[2:a]showwaves=s=780x140:mode=p2p,format=rgba,colorkey=black[sw];[0:v]scale=1920:-1,crop=iw:1080[bg];[bg][sw]overlay=(main_w/2-overlay_w/2):(main_h/2-overlay_h/2+200),format=yuv420p[ff];[ff][1:v]overlay=(main_w/2-overlay_w/2+30):(main_h/2-overlay_h/2-50),format=yuv420p[ff2];[ff2][3:v]overlay=(main_w/2-overlay_w/2+30):(main_h/2-overlay_h/2-50),format=yuv420p" -shortest -y -c:a aac -vcodec libx264 -strict -experimental -b:a 192k video.mp4