
Recherche avancée
Médias (1)
-
The pirate bay depuis la Belgique
1er avril 2013, par
Mis à jour : Avril 2013
Langue : français
Type : Image
Autres articles (43)
-
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 -
Déploiements possibles
31 janvier 2010, parDeux types de déploiements sont envisageable dépendant de deux aspects : La méthode d’installation envisagée (en standalone ou en ferme) ; Le nombre d’encodages journaliers et la fréquentation envisagés ;
L’encodage de vidéos est un processus lourd consommant énormément de ressources système (CPU et RAM), il est nécessaire de prendre tout cela en considération. Ce système n’est donc possible que sur un ou plusieurs serveurs dédiés.
Version mono serveur
La version mono serveur consiste à n’utiliser qu’une (...) -
Creating farms of unique websites
13 avril 2011, parMediaSPIP platforms can be installed as a farm, with a single "core" hosted on a dedicated server and used by multiple websites.
This allows (among other things) : implementation costs to be shared between several different projects / individuals rapid deployment of multiple unique sites creation of groups of like-minded sites, making it possible to browse media in a more controlled and selective environment than the major "open" (...)
Sur d’autres sites (6234)
-
ffmpeg streaming an image failure [closed]
30 mai 2024, par deonstI am trying stream a static image on the network. Everything I have tried yet so far has failed :
Examples :


ffmpeg -y -stream_loop -1 -r 1 -i text2.png -vcodec libx264 -crf 17 -pix_fmt yuv420p -f mpegts udp ://239.1.250.12:1234


File is generated but unplayable by VLC or any other TS capable device. ffplay complains about input frame errors but still produces a picture after a few seconds.


Tried this for youtube solution as well to a local file.
ffmpeg -f image2 -loop 1 -i text1.jpg -re -f lavfi -i anullsrc -vf format=yuv420p -c:v libx264 -b:v 2000k -maxrate 2000k -bufsize 4000k -g 50 -c:a aac test_flt.mkv


Warning, codec option b not been used for any stream : looks like their is no stream from the image2 demuxer.


Questions :
Has anyone successfully managed to achieve this ?
If so is there any specific requirements for the input image ?


-
Compress video using ffmpeg.js
25 mai 2024, par John MarkI attempted to upload and compress a video using ffmpeg.js. However, it appears that this process is ineffective on modern browsers. I have already implemented console logging to verify if the video compression is occurring, yet thus far, no compression has been achieved. Could anyone suggest an alternative library for video compression that might better suit the requirements ?


<template>
 <div>
 <input type="file" accept="video/*" />
 <video ref="video" controls="controls"></video>
 </div>
</template>

<code class="echappe-js"><script>&#xA;import { FFmpeg } from &#x27;@ffmpeg/ffmpeg&#x27;;&#xA;&#xA;export default {&#xA; methods: {&#xA; async handleFileInputChange(event) {&#xA; const file = event.target.files[0];&#xA; if (!file) return;&#xA;&#xA; const video = this.$refs.video;&#xA; const url = URL.createObjectURL(file);&#xA; video.src = url;&#xA;&#xA; const inputVideoPath = &#x27;input.mp4&#x27;;&#xA; const outputVideoPath = &#x27;compressed_output.mp4&#x27;;&#xA;&#xA; console.log("Compressing video...");&#xA; await this.compressVideo(file, inputVideoPath, outputVideoPath);&#xA; console.log("Compression completed.");&#xA;&#xA; video.src = URL.createObjectURL(await this.downloadFile(outputVideoPath));&#xA; },&#xA; async compressVideo(file, inputVideoPath, outputVideoPath) {&#xA; const ffmpeg = new FFmpeg();&#xA; await ffmpeg.load();&#xA;&#xA; // Writing the input file to the FFmpeg file system&#xA; await ffmpeg.writeFile(inputVideoPath, file);&#xA;&#xA; // Execute FFmpeg command for compression&#xA; await ffmpeg.exec([&#x27;-i&#x27;, inputVideoPath, &#x27;-vcodec&#x27;, &#x27;libx264&#x27;, &#x27;-crf&#x27;, &#x27;28&#x27;, outputVideoPath]);&#xA; },&#xA; async downloadFile(filePath) {&#xA; const ffmpeg = new FFmpeg();&#xA; await ffmpeg.load();&#xA;&#xA; // Read the compressed file from FFmpeg file system&#xA; const data = await ffmpeg.readFile(filePath);&#xA;&#xA; return new Blob([data.buffer], { type: &#x27;video/mp4&#x27; });&#xA; }&#xA; }&#xA;};&#xA;</script>





-
Problems with Python's azure.cognitiveservices.speech when installing together with FFmpeg in a Linux web app
15 mai 2024, par Kakobo kakoboI need some help.
I'm building an web app that takes any audio format, converts into a .wav file and then passes it to 'azure.cognitiveservices.speech' for transcription.I'm building the web app via a container Dockerfile as I need to install ffmpeg to be able to convert non ".wav" audio files to ".wav" (as azure speech services only process wav files). For some odd reason, the 'speechsdk' class of 'azure.cognitiveservices.speech' fails to work when I install ffmpeg in the web app. The class works perfectly fine when I install it without ffpmeg or when i build and run the container in my machine.


I have placed debug print statements in the code. I can see the class initiating, for some reason it does not buffer in the same when when running it locally in my machine. The routine simply stops without any reason.


Has anybody experienced a similar issue with azure.cognitiveservices.speech conflicting with ffmpeg ?


Here's my Dockerfile :


# Use an official Python runtime as a parent imageFROM python:3.11-slim

#Version RunRUN echo "Version Run 1..."

Install ffmpeg

RUN apt-get update && apt-get install -y ffmpeg && # Ensure ffmpeg is executablechmod a+rx /usr/bin/ffmpeg && # Clean up the apt cache by removing /var/lib/apt/lists saves spaceapt-get clean && rm -rf /var/lib/apt/lists/*

//Set the working directory in the container

WORKDIR /app

//Copy the current directory contents into the container at /app

COPY . /app

//Install any needed packages specified in requirements.txt

RUN pip install --no-cache-dir -r requirements.txt

//Make port 80 available to the world outside this container

EXPOSE 8000

//Define environment variable

ENV NAME World

//Run main.py when the container launches

CMD ["streamlit", "run", "main.py", "--server.port", "8000", "--server.address", "0.0.0.0"]`and here's my python code:



def transcribe_audio_continuous_old(temp_dir, audio_file, language):
 speech_key = azure_speech_key
 service_region = azure_speech_region

 time.sleep(5)
 print(f"DEBUG TIME BEFORE speechconfig")

 ran = generate_random_string(length=5)
 temp_file = f"transcript_key_{ran}.txt"
 output_text_file = os.path.join(temp_dir, temp_file)
 speech_recognition_language = set_language_to_speech_code(language)
 
 speech_config = speechsdk.SpeechConfig(subscription=speech_key, region=service_region)
 speech_config.speech_recognition_language = speech_recognition_language
 audio_input = speechsdk.AudioConfig(filename=os.path.join(temp_dir, audio_file))
 
 speech_recognizer = speechsdk.SpeechRecognizer(speech_config=speech_config, audio_config=audio_input, language=speech_recognition_language)
 done = False
 transcript_contents = ""

 time.sleep(5)
 print(f"DEBUG TIME AFTER speechconfig")
 print(f"DEBUG FIle about to be passed {audio_file}")

 try:
 with open(output_text_file, "w", encoding=encoding) as file:
 def recognized_callback(evt):
 print("Start continuous recognition callback.")
 print(f"Recognized: {evt.result.text}")
 file.write(evt.result.text + "\n")
 nonlocal transcript_contents
 transcript_contents += evt.result.text + "\n"

 def stop_cb(evt):
 print("Stopping continuous recognition callback.")
 print(f"Event type: {evt}")
 speech_recognizer.stop_continuous_recognition()
 nonlocal done
 done = True
 
 def canceled_cb(evt):
 print(f"Recognition canceled: {evt.reason}")
 if evt.reason == speechsdk.CancellationReason.Error:
 print(f"Cancellation error: {evt.error_details}")
 nonlocal done
 done = True

 speech_recognizer.recognized.connect(recognized_callback)
 speech_recognizer.session_stopped.connect(stop_cb)
 speech_recognizer.canceled.connect(canceled_cb)

 speech_recognizer.start_continuous_recognition()
 while not done:
 time.sleep(1)
 print("DEBUG LOOPING TRANSCRIPT")

 except Exception as e:
 print(f"An error occurred: {e}")

 print("DEBUG DONE TRANSCRIPT")

 return temp_file, transcript_contents



The transcript this callback works fine locally, or when installed without ffmpeg in the linux web app. Not sure why it conflicts with ffmpeg when installed via container dockerfile. The code section that fails can me found on note #NOTE DEBUG"