
Recherche avancée
Autres articles (63)
-
Websites made with MediaSPIP
2 mai 2011, parThis page lists some websites based on MediaSPIP.
-
Support de tous types de médias
10 avril 2011Contrairement à beaucoup de logiciels et autres plate-formes modernes de partage de documents, MediaSPIP a l’ambition de gérer un maximum de formats de documents différents qu’ils soient de type : images (png, gif, jpg, bmp et autres...) ; audio (MP3, Ogg, Wav et autres...) ; vidéo (Avi, MP4, Ogv, mpg, mov, wmv et autres...) ; contenu textuel, code ou autres (open office, microsoft office (tableur, présentation), web (html, css), LaTeX, Google Earth) (...)
-
Amélioration de la version de base
13 septembre 2013Jolie sélection multiple
Le plugin Chosen permet d’améliorer l’ergonomie des champs de sélection multiple. Voir les deux images suivantes pour comparer.
Il suffit pour cela d’activer le plugin Chosen (Configuration générale du site > Gestion des plugins), puis de configurer le plugin (Les squelettes > Chosen) en activant l’utilisation de Chosen dans le site public et en spécifiant les éléments de formulaires à améliorer, par exemple select[multiple] pour les listes à sélection multiple (...)
Sur d’autres sites (4667)
-
ffmpeg multiple rtsp cameras into sigle stream to youtube
26 janvier 2017, par user3157121I have two rtsp ip cameras (dlink) and I want combine (merge) 2 stream in one video output and put it to yutube (live streaming).
My first step is ok and my command is :
ffmpeg
-i "rtsp://xxxxxx:xxxxxx@192.168.1.164/live2.sdp"
-i "rtsp://xxxxxx:xxxxxx@192.168.1.164/live2.sdp"
-filter_complex "
nullsrc=size=1600x448 [base];
[0:v] setpts=PTS-STARTPTS, scale=800x448 [upperleft];
[1:v] setpts=PTS-STARTPTS, scale=800x448 [upperright];
[base][upperleft] overlay=shortest=1 [base];
[base][upperright] overlay=shortest=1:x=800 [base]"
-map [base] test.mp4My test.mp4 video output is ok.
After that, I try to send this video to youtube live with this command :
ffmpeg
-i "rtsp://xxxxxx:xxxxxx@192.168.1.164/live2.sdp"
-i "rtsp://xxxxxx:xxxxxx@192.168.1.164/live2.sdp"
-filter_complex "
nullsrc=size=1600x448 [base];
[0:v] setpts=PTS-STARTPTS, scale=800x448 [upperleft];
[1:v] setpts=PTS-STARTPTS, scale=800x448 [upperright];
[base][upperleft] overlay=shortest=1 [base];
[base][upperright] overlay=shortest=1:x=800 [base]"
-map [base] -f flv "rtmp://a.rtmp.youtube.com/live2/xxx-xxxx-xxxx-xxxx"But the youtube stream does not receive data. (It seems to start but do not see the image). I think is a audio problem. But I don’t know how to insert a fake audio (I don’t want audio).
Is there a solution ?
Thanks,
Mattia -
Running FFMPEG command through Golang exec
18 décembre 2016, par Jon StevensI need to run an ffmpeg command to create a video from images with a crossfade between images as the transition. The command is derived from this post. I need to run it through the Golang os/exec package. The command I need to run is :
ffmpeg -loop 1 -t 5 -i img-0.png -loop 1 -t 5 -i img-1.png -loop 1 -t 5 -i img-2.png -filter_complex "[1:v][0:v]blend=all_expr='A*(if(gte(T,0.5),1,T/0.5))+B*(1-(if(gte(T,0.5),1,T/0.5)))'[b1v];[2:v][1:v]blend=all_expr='A*(if(gte(T,0.5),1,T/0.5))+B*(1-(if(gte(T,0.5),1,T/0.5)))'[b2v];[0:v][b1v][1:v][b2v][2:v]concat=n=5:v=1:a=0,format=yuv420p[v]" -map '[v]' -c:v libx264 -pix_fmt yuv420p -r 30 -s 1280x720 -aspect 16:9 -crf 1 -preset ultrafast output.mp4
If you run this command directly in the terminal, it works just fine. However, it does not work through my code. This is my code that takes a string command and runs it through the os/exec package :
command := "ffmpeg -loop 1 -t 5 -i img-0.png -loop 1 -t 5 -i img-1.png -loop 1 -t 5 -i img-2.png -filter_complex "[1:v][0:v]blend=all_expr='A*(if(gte(T,0.5),1,T/0.5))+B*(1-(if(gte(T,0.5),1,T/0.5)))'[b1v];[2:v][1:v]blend=all_expr='A*(if(gte(T,0.5),1,T/0.5))+B*(1-(if(gte(T,0.5),1,T/0.5)))'[b2v];[0:v][b1v][1:v][b2v][2:v]concat=n=5:v=1:a=0,format=yuv420p[v]" -map '[v]' -c:v libx264 -pix_fmt yuv420p -r 30 -s 1280x720 -aspect 16:9 -crf 1 -preset ultrafast output.mp4"
lastQuote := rune(0)
f := func(c rune) bool {
switch {
case c == lastQuote:
lastQuote = rune(0)
return false
case lastQuote != rune(0):
return false
case unicode.In(c, unicode.Quotation_Mark):
lastQuote = c
return false
default:
return unicode.IsSpace(c)
}
}
parts := strings.FieldsFunc(command, f)
cmd := exec.Command(parts[0], parts[1:]...)
cmd.Stderr = os.Stderr
cmd.Stdout = os.Stdout
err := cmd.Run()
if err != nil {
return err
}When I run this, I get the ffmpeg error : No such filter : ’"’, Error configuring filters. I know it has something to do with the quotes that HAVE to be in the video filters, but I have tried everything to get it to work and I can’t figure it out.
Any help is greatly appreciated !
-
ffmpeg does not work with a large number of urls in the request
2 avril 2023, par Hack teamIf i put one url in the array, everything works perfectly, but when i add more than one url to the array, it throws an error :


HTTP error 403 Forbidden https://p16-sign-sg.tiktokcdn.com/tos-alisg-i-photomode-sg/2c182489bc4e42dcbb70f37a283cf5f1~tplv-photomode-image.jpeg?from=photomode.AWEME_DETAIL&x-expires=1681740000&x-signature=BaB75chVtpoZg6sE%2B0oWmxtzky0%3D https://p16-sign-sg.tiktokcdn.com/tos-alisg-i-photomode-sg/34cae24dad35476d96d8db03b46076b9~tplv-photomode-image.jpeg?from=photomode.AWEME_DETAIL&x-expires=1681740000&x-signature=RTyGbq%2BfLz3hNahtLJyaWycQtPI%3D: Server returned 403 Forbidden (access denied)



However, if i put each of the urls one by one, then access is available and everything works perfectly


It feels like ffmpeg makes one out of three urls and catches an error because of it. But I don't understand how to handle urls.


My code :


from PIL import Image
from io import BytesIO

import requests
import ffmpeg

def make_even(n):
 return n + n % 2

list_of_urls = [
 "https://p16-sign-sg.tiktokcdn.com/tos-alisg-i-photomode-sg/2c182489bc4e42dcbb70f37a283cf5f1~tplv-photomode-image.jpeg?from=photomode.AWEME_DETAIL&x-expires=1681740000&x-signature=BaB75chVtpoZg6sE%2B0oWmxtzky0%3D",
 "https://p16-sign-sg.tiktokcdn.com/tos-alisg-i-photomode-sg/34cae24dad35476d96d8db03b46076b9~tplv-photomode-image.jpeg?from=photomode.AWEME_DETAIL&x-expires=1681740000&x-signature=RTyGbq%2BfLz3hNahtLJyaWycQtPI%3D",
 "https://p16-sign-sg.tiktokcdn.com/tos-alisg-i-photomode-sg/c2cb000f9332498caf6bd837f42e92c6~tplv-photomode-image.jpeg?from=photomode.AWEME_DETAIL&x-expires=1681740000&x-signature=4Zh5PFWNUYQhxQHuKM7P8rk8geU%3D"
]

response = requests.get(list_of_urls\[0\])
img = Image.open(BytesIO(response.content))

width, height = img.size
width = make_even(width)
height = make_even(height)

(
 ffmpeg
 .input(' '.join(list_of_urls), framerate=0.33)
 .filter('scale', width, height)
 .output('output.mp4')
 .run()
)