
Recherche avancée
Autres articles (40)
-
Les tâches Cron régulières de la ferme
1er décembre 2010, parLa gestion de la ferme passe par l’exécution à intervalle régulier de plusieurs tâches répétitives dites Cron.
Le super Cron (gestion_mutu_super_cron)
Cette tâche, planifiée chaque minute, a pour simple effet d’appeler le Cron de l’ensemble des instances de la mutualisation régulièrement. Couplée avec un Cron système sur le site central de la mutualisation, cela permet de simplement générer des visites régulières sur les différents sites et éviter que les tâches des sites peu visités soient trop (...) -
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 -
Les vidéos
21 avril 2011, parComme les documents de type "audio", Mediaspip affiche dans la mesure du possible les vidéos grâce à la balise html5 .
Un des inconvénients de cette balise est qu’elle n’est pas reconnue correctement par certains navigateurs (Internet Explorer pour ne pas le nommer) et que chaque navigateur ne gère en natif que certains formats de vidéos.
Son avantage principal quant à lui est de bénéficier de la prise en charge native de vidéos dans les navigateur et donc de se passer de l’utilisation de Flash et (...)
Sur d’autres sites (5885)
-
Use ffmpeg to record 2 webcams on raspberry pi
30 janvier 2021, par RaresBaaaI want to record 2 webcams using ffmpeg, i have a simple python script but it doesn't work when I run the 2 subprocesses at the same time.


ROOT_PATH = os.getenv("ROOT_PATH", "/home/pi")
ENCODING = os.getenv("ENCODING", "copy")
new_dir = datetime.datetime.now().strftime("%Y_%m_%d_%H_%M_%S")
RECORDINGS_PATH1 = os.getenv("RECORDINGS_PATH", "RecordingsCam1")
RECORDINGS_PATH2 = os.getenv("RECORDINGS_PATH", "RecordingsCam2")
recording_path1 = os.path.join(ROOT_PATH, RECORDINGS_PATH1, new_dir)
recording_path2 = os.path.join(ROOT_PATH, RECORDINGS_PATH2, new_dir)
os.mkdir(recording_path1)
os.mkdir(recording_path2)
segments_path1 = os.path.join(recording_path1, "%03d.avi")
segments_path2 = os.path.join(recording_path2, "%03d.avi")
record1 = "ffmpeg -nostdin -i /dev/video0 -c:v {} -an -sn -dn -segment_time 30 -f segment {}".format(ENCODING, segments_path1)
record2 = "ffmpeg -nostdin -i /dev/video2 -c:v {} -an -sn -dn -segment_time 30 -f segment {}".format(ENCODING, segments_path2)
subprocess.Popen(record1, shell=True)
subprocess.Popen(record2, shell=True)



Also, i tried capturing the 2 sources side by side but it gives the error :`Filtering and streamcopy cannot be used together.


-
Command is running different from expected when i use it trought Python
17 septembre 2021, par Gustavo MarinhoI have a code where i download a youtube video as 3gpp and convert it to a mp3, i need to use FFmpeg to do this, and it work well when using both cmd and powershell, but, when i tried to run the same command in Python, it didin't work at all.


This is my command :


ffmpeg -i C:\YTDownloads\CurrentAudio.3gpp C:\YTDownloads\CurrentAudio.mp3


I tried :


subprocess.call(r'%SystemRoot%\system32\WindowsPowerShell\v1.0\powershell.exe ffmpeg -i C:\YTDownloads\CurrentAudio.3gpp C:\YTDownloads\CurrentAudio.mp3', shell=True)


subprocess.run(["ffmpeg","-i","C:\YTDownloads\CurrentAudio.3gpp","C:\YTDownloads\CurrentAudio.mp3]")



os.system('powershell ffmpeg -i C:\YTDownloads\CurrentAudio.3gpp C:\YTDownloads\CurrentAudio.mp3')



subprocess.run([
 'ffmpeg',
 '-i', os.path.join(parent_dir, f"{newname}.3gpp"),
 os.path.join(parent_dir, f"{newname}.mp3")
]) 



subprocess.call('C:\Windows\System32\powershell.exe ffmpeg -i C:\YTDownloads\CurrentAudio.3gpp C:\YTDownloads\CurrentAudio.mp3', shell=True)



all of them return some type of error, in some of them it returns that ffmpeg isn't a recognized as a internal command, in others it says that the system can't find the specified path, but none of them works, even thought it works perfectly when i use the exactly same command on cmd/powershell.


sorry for my bad english :3


-
How to loop over gif file finite number of times while creating mp4 as output with ffmpeg
16 mai 2020, par in-userI am able to convert gif file to mp4 using this command :



ffmpeg -i animated.gif -movflags faststart -pix_fmt yuv420p -vf "scale=trunc(iw/2)*2:trunc(ih/2)*2" video.mp4




What I want to do is to loop over gif animation 3 times and convert to mp4.



I am able to do this with 2 shell commands. First one from above and then concatenate the same video 3 times.



ffmpeg -f concat -safe 0 -i <(printf "file '$PWD/video.mp4'\n%.0s" {1..3}) -c copy videoloop.mp4




I have also tried with -ignore_loop 0 option and setting time. It does work but it is not exactly what I am trying to do since I can extend the video but can not make exactly 3 loops.



ffmpeg -ignore_loop 0 -i animated.gif -movflags faststart -pix_fmt yuv420p -vf "scale=trunc(iw/2)*2:trunc(ih/2)*2" -t 12 videoloop.mp4




So as you can see I am already able to achieve what I want, but with 2 shell commands :



ffmpeg -i animated.gif -movflags faststart -pix_fmt yuv420p -vf "scale=trunc(iw/2)*2:trunc(ih/2)*2" video.mp4
ffmpeg -f concat -safe 0 -i <(printf "file '$PWD/video.mp4'\n%.0s" {1..3}) -c copy videoloop.mp4




Is it possible to do this with only one call to ffmpeg ?



I tried with -loop option for the input file. It doesn't work for gifs. I also tried with -stream_loop. It creates something corrupted.