
Recherche avancée
Autres articles (50)
-
Submit bugs and patches
13 avril 2011Unfortunately a software is never perfect.
If you think you have found a bug, report it using our ticket system. Please to help us to fix it by providing the following information : the browser you are using, including the exact version as precise an explanation as possible of the problem if possible, the steps taken resulting in the problem a link to the site / page in question
If you think you have solved the bug, fill in a ticket and attach to it a corrective patch.
You may also (...) -
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 (...) -
Menus personnalisés
14 novembre 2010, parMediaSPIP utilise le plugin Menus pour gérer plusieurs menus configurables pour la navigation.
Cela permet de laisser aux administrateurs de canaux la possibilité de configurer finement ces menus.
Menus créés à l’initialisation du site
Par défaut trois menus sont créés automatiquement à l’initialisation du site : Le menu principal ; Identifiant : barrenav ; Ce menu s’insère en général en haut de la page après le bloc d’entête, son identifiant le rend compatible avec les squelettes basés sur Zpip ; (...)
Sur d’autres sites (3492)
-
Stream microphone from client browser to remote server and pass audio in real time to ffmpeg to combine with a second video source
4 mai 2021, par fakeguybrushthreepwoodAs a beginner at working with these kinds of real-time streaming services, I've spent hours trying to work out how this is possible, but can't seem to work out I'd precisely go about it.


I'm prototyping a personal basic web app that does the following :


- 

-
In a web browser, the web application has a button that says 'Stream Microphone' - when pressed it streams the audio from the user's microphone (the user obviously has to consent to give permission to send their microphone audio) through to the server which I was presuming would be running node.js (no specific reason at this point, just thought this is how I'd go about doing it).


-
The server receives the audio close enough to real-time somehow (not sure how I'd do this).


-
I can then run ffmpeg on the command line and take the real-time audio coming in real-time and add it as the sound to a video file (let's just say I'm going to play testmovie.mp4) that I want to play.










I've looked at various solutions - such as maybe using WebRTC, RTP/RTSP, Piping audio into ffmpeg, Gstreamer, Kurento, Flashphoner and/or Wowza - but somehow they look overly complicated and usually seem to focus on video along with audio. I just need to work with audio.


-
-
Is every instance of subprocess.Popen() its own shell ?
26 avril 2021, par saa-sofBackground :
I'm trying to make an application that plays music via a GUI (Tkinter), Youtube_DL and FFmpeg. While the actual application is done it also requires FFmpeg to be an environment variable to work. Now, I'm trying to foolproof the creation of a "personal" FFmpeg environment variable in order to make the application portable (the last step is using pyinstaller to make a .exe file).


Problem :
I'm trying to create the environment variable for FFmpeg by passing
SET
throughsubprocess.Popen
:

add_ffmpeg = subprocess.Popen(f"IF EXIST {path2set} SET PATH=%PATH%;{path2set}", shell=True)



When I try to
echo %PATH%
(withPopen
) the FFmpeg variable that should be present, is not. I just need to know whether or not I'm wasting my time withSET
and should instead be usingSETX
or perhaps some other solution, I'm open to being told I did this all wrong.

Relevant Code :


# get any sub-directory with ffmpeg in it's name
ffmpeg = glob(f"./*ffmpeg*/")

# proceed if there is a directory
if len(ffmpeg) > 0:
 # double-check directory exists
 ffmpeg_exist = path.isdir(ffmpeg[0])

 if ffmpeg_exist:
 print("FFmpeg: Found -> Setting Up")
 
 # get the absolute path of the directories bin folder ".\ffmpeg-release-essentials.zip\bin"
 path2set = f"{path.abspath(ffmpeg[0])}\\bin\\"
 
 # add path of directory to environment variables
 add_ffmpeg = subprocess.Popen(f"IF EXIST {path2set} SET PATH=%PATH%;{path2set}", shell=True)
 add_ffmpeg.wait()
 
 # print all of the current environment variables
 list_vars = subprocess.Popen("echo %PATH%", shell=True)
 list_vars.wait()

else:
 print("FFmpeg: Missing -> Wait for Download...")
 
 # download the ffmpeg file via direct link
 wget.download("https://www.gyan.dev/ffmpeg/builds/ffmpeg-release-essentials.zip")
 
 # unzip the file
 powershell = subprocess.Popen("powershell.exe Expand-Archive -Path './ffmpeg-release-essentials.zip' "
 "-DestinationPath './'")
 powershell.wait()

 # remove the file
 remove("./ffmpeg-release-essentials.zip")

 # get any sub-directory with ffmpeg in it's name
 ffmpeg = glob("./*ffmpeg*/")

 # double-check directory exists
 ffmpeg_exist = path.isdir(ffmpeg[0])
 
 # proceed with if it exists
 if ffmpeg_exist:
 print("FFmpeg: Found -> Setting Up")
 
 # get the absolute path of the directories bin folder ".\ffmpeg-release-essentials.zip\bin"
 path2set = f"{path.abspath(ffmpeg[0])}\\bin\\"
 
 # add path of directory to environment variables
 add_ffmpeg = subprocess.Popen(f"IF EXIST {path2set} SET PATH=%PATH%;{path2set}", shell=True)
 add_ffmpeg.wait()

 # print all of the current environment variables
 list_vars = subprocess.Popen("echo %PATH%", shell=True)
 list_vars.wait()
 
 else:
 print("Something unexplained has gone wrong.")
 exit(0)



-
How to compress base64 decoded video data using ffmpeg in django
23 mai 2021, par Sudipto SarkerI want to upload the video/audio file in my django-channels project. So I uploaded video(base64 encoded url) from websocket connection. It is working fine. But now after decoding base64 video data I want to compress that video using ffmpeg.But it showing error like this.
''Raw : No such file or directory''
I used 'AsyncJsonWebsocketConsumer' in consumers.py file.Here is my code :
consumers.py :


async def send_file_to_room(self, room_id, dataUrl, filename):
 # decoding base64 data
 format, datastr = dataUrl.split(';base64,')
 ext = format.split('/')[-1]
 file = ContentFile(base64.b64decode(datastr), name=filename)
 print(f'file: {file}')
 # It prints 'Raw content'
 output_file_name = filename + '_temp.' + ext
 ff = f'ffmpeg -i {file} -vf "scale=iw/5:ih/5" {output_file_name}'
 subprocess.run(ff,shell=True) 



May be here ffmpeg can not recognize the file to be compressed. I also tried to solve this using post_save signal.


signals.py :


@receiver(post_save, sender=ChatRoomMessage)
def compress_video_or_audio(sender, instance, created, **kwargs):
 print("Inside signal")
 if created:
 if instance.id is None:
 print("Instance is not present")
 else:
 video_full_path = f'{instance.document.path}'
 print(video_full_path)
 // E:\..\..\..\Personal Chat Room\media\PersonalChatRoom\file\VID_20181219_134306_w5ow8F7.mp4
 output_file_name = filename + '_temp.' + extension
 ff = f'ffmpeg -i {filename} -vf "scale=iw/5:ih/5" {output_file_name}'
 subprocess.run(ff,shell=True)
 instance.document = output_file_name
 instance.save()



It is also causing "E :..\Django\New_Projects\Personal : No such file or directory".
How can I solve this issue ? Any suggetions.It will be more helpful if it can be compressed before saving the object in database. Thanks in advance.