
Recherche avancée
Médias (2)
-
Granite de l’Aber Ildut
9 septembre 2011, par
Mis à jour : Septembre 2011
Langue : français
Type : Texte
-
Géodiversité
9 septembre 2011, par ,
Mis à jour : Août 2018
Langue : français
Type : Texte
Autres articles (41)
-
L’espace de configuration de MediaSPIP
29 novembre 2010, parL’espace de configuration de MediaSPIP est réservé aux administrateurs. Un lien de menu "administrer" est généralement affiché en haut de la page [1].
Il permet de configurer finement votre site.
La navigation de cet espace de configuration est divisé en trois parties : la configuration générale du site qui permet notamment de modifier : les informations principales concernant le site (...) -
Mediabox : ouvrir les images dans l’espace maximal pour l’utilisateur
8 février 2011, parLa visualisation des images est restreinte par la largeur accordée par le design du site (dépendant du thème utilisé). Elles sont donc visibles sous un format réduit. Afin de profiter de l’ensemble de la place disponible sur l’écran de l’utilisateur, il est possible d’ajouter une fonctionnalité d’affichage de l’image dans une boite multimedia apparaissant au dessus du reste du contenu.
Pour ce faire il est nécessaire d’installer le plugin "Mediabox".
Configuration de la boite multimédia
Dès (...) -
MediaSPIP 0.1 Beta version
25 avril 2011, parMediaSPIP 0.1 beta is the first version of MediaSPIP proclaimed as "usable".
The zip file provided here only contains the sources of MediaSPIP in its standalone version.
To get a working installation, you must manually install all-software dependencies on the server.
If you want to use this archive for an installation in "farm mode", you will also need to proceed to other manual (...)
Sur d’autres sites (5947)
-
Run ffmpeg audio under Windows with Flutter
11 janvier, par ChrisI'd like to stream audio comming from my microphone in my flutter app in the windows desktop version.


Since there is no library that seems to do such thing while supporting windows desktop app, I have tried using
Process
like this :

// Start the FFmpeg process to capture audio
ffmpegProcess = await Process.start(
 'ffmpeg',
 [
 '-f', 'dshow', // Specify DirectShow input for Windows
 '-i', 'audio="$selectedMic"', // Input audio device (selected mic)
 '-f', 'wav', // Set audio format
 '-ar', '44100', // Set audio sample rate
 '-ac', '1', // Mono channel
 '-b:a', '128k', // Set audio bitrate
 'pipe:1', // Output to stdout
 ],
);

// Listen for data on stdout (audio stream)
ffmpegProcess.stdout.listen((data) async {
 // Send audio data to the server as it comes in
 await sendAudioToServer(data);
});



I've tested the command directly in my terminal (not in the flutter app) and it works fine.


When I run this code in my Flutter app, my task manager also shows a "ffmpeg" process, but somehow there is no stream output in flutter, even after ensuring that the
selectedMic
variable is correct or even when its hardcoded.

Since this command runs without issue in my terminal and even in python, I am wondering why it does not work in Flutter.


Starting my vscode as administrator also don't solve the issue (I wanted to check if it's a permission issue).


Also relevant : When I run the "ffmpeg -version" command, I get an output for the version, meaning that this is not an installation problem (ffmpeg bin folder is in my PATH environment variable). The problem seems to come from recording from the microphone in flutter, but I don't get why.


ffmpegProcess = await Process.start('ffmpeg', ['-version']); // this works



I'd love to get some suggestions where the problem could come from or any kind of alternative solutions.


-
Recorded Video Ending Prematurely with WebSocket and FFmpeg
7 septembre 2024, par ZaidI am working on a screen recording application where it allows users to record their screen and I use websocket to send their bytes data in real time to my FastAPI Python server. The bytes are sent every 2 second and I use FFmpeg to keep saving the bytes in the output MP4 video file.


Problem :
Everything was working fine when I had the server running on my local machine, however, I just deployed the server to EC2 instanceus-ease-1
and when I try to record the videos, the videos are really short, IE, if I record a 30 second video, it only has the video for 3 second. Sometimes it saves 90% of the video and sometimes less. I am not sure what is the problem here.
I have been trying to debug the code for the past few days, but with no success

Here is my code :


FRONTEND


const recorder = new MediaRecorder(stream, {
 mimeType: 'video/webm;codecs=H264',
 videoBitsPerSecond: 8000000
 });

recorder.ondataavailable = (e: BlobEvent) => {
 socketRef.socket.send(e.data)
}



And here is my python code :-


@router.websocket("/stream")
async def websocket_endpoint(websocket: WebSocket, token: str = Query(...), videoId: str = Query(...), authorize: AuthJWT = Depends()):
 await manager.connect(websocket)
 dataNumber = 1

 recordingFile = os.path.join(temp_dir, f"recording_{videoId}.mp4")

 command = [
 'ffmpeg', 
 '-y',
 '-i', 
 '-', 
 '-codec:v', 
 'copy', 
 '-f', 'mp4',
 recordingFile,
 ]

 process = subprocess.Popen(command, stdin=subprocess.PIPE)
 try:
 while True:
 try:
 data = await websocket.receive_bytes()
 if not data:
 break
 process.stdin.write(data)
 await websocket.send_json({"chunkNumber": dataNumber, "status": 200})
 dataNumber = dataNumber + 1
 except RuntimeError:
 break 
 except WebSocketDisconnect:
 print(f"Client disconnected: {websocket.client.host}")
 finally:
 manager.disconnect(websocket)

 # Close stdin to signal EOF
 process.stdin.close()

 # Wait for FFmpeg to finish processing
 process.wait()

 # Ensure that the process is terminated
 process.terminate() 



I also get this error in the console :-



Editor's note : Text is auto-extracted by an AI (ie : may not be 100% correct)


libpostproc 57. 3.100/57. 3.100
Input #6, matroska, webm, from 'fd:':
Metadata:
encoder: Chrome
Duration: N/A, start: 0.000000, bitrate: N/A
Stream #0:0(eng): Video: h264 (Constrained Baseline), yuv420p(tv, bt789, progressive), 1920x1080, SAR 1:1 DAR 16:9, 30
.30 fps, 56 tbr, 1k tbn (default)

Output #8, mp4, to /tmp/recording_d367d8d3-60de-483e-bf29-1849841b82f3.mp4':
Metadata:
encoder: Lavf60.16.100
Stream #0:0(eng): Video: h264 (Constrained Baseline) (avc1 / 0x31637661), yuv420p(tv, bt709, progressive), 1920x1080 [
SAR 1:1 DAR 16:9], q=2-31, 38.30 fps, 56 tbr, 16k tbn (default)
Stream mapping:
Stream #0:0> #0:6 (copy)
Client disconnected: 127.0.0.189 bitrate=3374.0kbits/s speed=0.999x
[matroska, webm @ 8x61e88988f3c0]
9493864 (0x98dd68)
[out#0/mp4 @ 0x61e8898cc488] video:9263kB audio:0kB subtitle:0kB other streams: 9kB global headers: 8kB muxing overhead: 0
.143342%
size= 9276kB time=00:00:21.85 bitrate=3476.8kbits/s speed=1.08x
INFO:
connection closed
INFO: 127.0.0.1:52546 "POST /api/process HTTP/1.1" 200 ок



-
No audio in the final video when converting webm blobs to mp4 using ffmpeg
28 septembre 2024, par alpeccaI trying to record user camera and microphone and using MediaRecorder to convert the stream to blobs and sending the blobs every 2 second to the backend using websocket. Everything is working fine, but when I checked the final mp4 video in the backend, it doesn't have any audio to it, I try specifying the audio codec, but still no help.


My frontend code :-


const micStream = await navigator.mediaDevices.getUserMedia({ audio: true });

const recorder = new MediaRecorder(stream, {
 mimeType: 'video/webm;codecs=H264',
 videoBitsPerSecond: 8000000,
 audioBitsPerSecond : 8000000
});

recorder.ondataavailable = (e: BlobEvent) => {
 websocket.send(e.data) 
} 
recorder.start(2000);



And here is the backend code :-


@router.websocket("/streamaudio")
async def websocket_endpoint(websocket: WebSocket):
 await manager.connect(websocket)

 recordingFile = os.path.join(os.getcwd(), f"recording_.mp4")

 command = [
 'ffmpeg', 
 '-y',
 '-i', 
 '-', 
 '-codec:v', 
 'copy', 
 '-c:a', 'aac', 
 '-y',
 '-f', 'mp4',
 recordingFile,
 # "-"
 # f'output{queueNumber}.mp4',
 ] 

 
 try:
 while True:
 try:
 
 data = await websocket.receive_bytes()
 
 process.stdin.send(data)
 
 except RuntimeError:
 break 
 except WebSocketDisconnect:
 print(f"Client disconnected: {websocket.client.host}")
 finally:
 manager.disconnect(websocket)
 await process.stdin.aclose()
 await process.wait()