
Recherche avancée
Autres articles (31)
-
MediaSPIP v0.2
21 juin 2013, parMediaSPIP 0.2 est la première version de MediaSPIP stable.
Sa date de sortie officielle est le 21 juin 2013 et est annoncée ici.
Le fichier zip ici présent contient uniquement les sources de MediaSPIP en version standalone.
Comme pour la version précédente, il est nécessaire d’installer manuellement l’ensemble des dépendances logicielles sur le serveur.
Si vous souhaitez utiliser cette archive pour une installation en mode ferme, il vous faudra également procéder à d’autres modifications (...) -
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 (...) -
Mise à disposition des fichiers
14 avril 2011, parPar défaut, lors de son initialisation, MediaSPIP ne permet pas aux visiteurs de télécharger les fichiers qu’ils soient originaux ou le résultat de leur transformation ou encodage. Il permet uniquement de les visualiser.
Cependant, il est possible et facile d’autoriser les visiteurs à avoir accès à ces documents et ce sous différentes formes.
Tout cela se passe dans la page de configuration du squelette. Il vous faut aller dans l’espace d’administration du canal, et choisir dans la navigation (...)
Sur d’autres sites (4510)
-
How can I stream raw video frames AND audio to FFMPEG with Python 2.7 ?
18 novembre 2017, par Just AskinI am streaming raw video frames from Pygame to FFMPEG, then sending to a rtmp stream, but for the life of me, I can’t figure out how to send live audio using the same Python module. It does not need to be the Pygame mixer, but I am not opposed to using it if that is where the best answer lies. I’m pretty sure it’s not though.
My question is this : What is the best strategy to send live audio output from a program to FFMPEG along with raw video frames simultaneously from the same Python module ?
My program is large, and eventually I would like to build options to switch audio inputs from a queue of music, a microphone, or any other random sounds from any program I want to use. But for the time being, I just want something to work. I am starting off with a simple Espeak command.
Here is my Python commands :
command = ['ffmpeg', '-re', '-framerate', '22', '-s', '1280x720', '-pix_fmt', 'rgba', '-f', 'rawvideo', '-i', '-', '-f', 's16le', '-ar', '22500', '-i', '/tmp/audio', '-preset', ultrafast', '-pix_fmt', 'rgba', '-b:v', '2500', '-s', 'hd720', '-r', '25', '-g', '50', '-crf', '20', '-f', 'flv', 'rtmp://xxx' ]
pipe = sp.Popen(command, stdin=sp.PIPE)Then I send my frames to stdin from within my main
while True:
loop.The problem I run into with this strategy is I can’t figure out how to shove audio into FFMPEG from within Python without blocking the pipe. After hours of research, I am pretty confident I can’t use the pipe to send the audio along with the frames. I thought the named pipe was my solution (which works running Espeak outside of Python), but it blocks Python until the Espeak is done... so no good.
I assume I need threading for multiprocessing, but I cannot figure out from the official documentation or any other resources as to how I can solve my problem with it.
The
['-f', 's16le', '-ar', '22500', '-i', '/tmp/audio']
are settings that work if I run espeak from a separate terminal withespeak 'some text' --stdout > /tmp/audio
.I am using Centos 7, Python 2.7, pygame, the latest build of FFMPEG,
-
Systemd service (python loop -> ffmpeg stream)
7 janvier 2019, par KevittoI am currently running a stream with ffmpeg, through icecast2 through a python snippet (Fig1). I have created a systemd service to run said python script on boot (Fig2) and use a custom target (Fig3) to make sure it loads once every other service is loaded, mostly for icecast2.
I’ve conducted multiple tests, and the stream works fine if launched either from the python code or if I restart the service attached to it.
My problem is, on a (re)boot of the system, the service runs for approximately 15 seconds, then the stream dies. I’ve read so much on python and systemd, but I can’t for the life of me figure out where the problem lies. I’ve tried changing my python code, the unit load order and anything else I found online that could help, but found nothing.
Fig1 (dxstream.py)
import sys
import time
import subprocess
def start():
return subprocess.Popen(r’ffpmeg -re -f alsa -ac2 -i hw:1,0 -acodec mp3 -ab 320k -f mp3 icecast://sourcehackme@localhost:8000/stream', shell=True)
testProcess = start()
while True:
res = testProcess.poll()
if res is not None:
testProcess = start()
time.sleep(1)Fig2 (dxstream.service)
[Unit]
Description=ffmpeg stream starter
After=multi-user.target
[Service]
Type=idle
Execstart=/usr/bin/python /usr/local/bin/dxstream.py
Restart=on-failure
[Install]
WantedBy=custom.targetFig3 (custom.target)
[Unit]
Description=Custom Target
Requires=multi-user.target
After=multi-user.target
AllowIsolate=yes -
scripting massive number of files with ffmpeg [closed]
2 décembre 2020, par 8LiterAlright, I've got over 5000 MP4 files in a single directory that I would ultimately like to process using ffmpeg. I've got a few different solutions that all work by themselves, but put together do not make my job any easier.
The current file list looks like this, in one single directory :


- 

- 10-1.mp4
- 10-2.mp4
- 10123-1.mp4
- 10123-2.mp4
- 10123-3.mp4
- 10123-4.mp4
- 10123-5.mp4
- 10123-6.mp4
- 102-1.mp4
- 103-1.mp4
- 103-2.mp4
- 103-3.mp4
- 107-1.mp4
- 107-2.mp4
- 107-3.mp4
- 107-4.mp4
- 107-5.mp4
- 107-6.mp4
- 11-1.mp4
- 11-2.mp4










































The ideal process I would like is the following :


A. Take however many files in the directory have a particular prefix, for example the two "11" files at the bottom, and concatenate them into a single MP4 file. The end result is a single "11.MP4"


B. Delete the original two "11-1.mp4" and "11-2.mp4", keeping only the new "11.mp4" complete file.


C. Repeat steps A-B for all other files in this directory


This is not apparently possible right now from what I can glean from other threads, but I've tested a more manual approach which is not clean OR fast, and this is what my workflow looks like in real life...


- 

- move files with same prefix into new folder (I have a working bat file that will do this for me)
- run a ffmpeg bat file to process an "output.mp4" file (I have a working bat file that will do this for me)
- delete the original files
- rename the output.mp4 file to the prefix name (i.e. 11.mp4)
- copy that file back into the new directory
- repeat steps 1-5 a thousand times.














I've also looked into creating all new directories BASED on the filename (I have a working bat file that will do this for me) and then copy my ffmpeg bat file into each directory, and run each bat file manually... but again it's a ton of work.


(FROM STEP 1 ABOVE)


@echo off
setlocal

set "basename=."
for /F "tokens=1* delims=.*" %%a in ('dir /B /A-D ^| sort /R') do (
 set "filename=%%a"
 setlocal EnableDelayedExpansion
 for /F "delims=" %%c in ("!basename!") do if "!filename:%%c=!" equ "!filename!" (
 set "basename=!filename!"
 md "!basename!"
 )
 move "!filename!.%%b" "!basename!"
 for /F "delims=" %%c in ("!basename!") do (
 endlocal
 set "basename=%%c

 )
)



(FROM STEP 2 ABOVE)


:: Create File List
del "F:\videos\*.txt" /s /f /q
for %%i in (*.mp4) do echo file '%%i'>> mylist.txt

:: Concatenate Files
ffmpeg.exe -f concat -safe 0 -i mylist.txt -c copy output.mp4



Any ideas how I can approach this ? I'm open to powershell, batch, even python if I need to.