
Recherche avancée
Médias (1)
-
Video d’abeille en portrait
14 mai 2011, par
Mis à jour : Février 2012
Langue : français
Type : Video
Autres articles (75)
-
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 (...) -
Personnaliser en ajoutant son logo, sa bannière ou son image de fond
5 septembre 2013, parCertains thèmes prennent en compte trois éléments de personnalisation : l’ajout d’un logo ; l’ajout d’une bannière l’ajout d’une image de fond ;
-
Mise à jour de la version 0.1 vers 0.2
24 juin 2013, parExplications des différents changements notables lors du passage de la version 0.1 de MediaSPIP à la version 0.3. Quelles sont les nouveautés
Au niveau des dépendances logicielles Utilisation des dernières versions de FFMpeg (>= v1.2.1) ; Installation des dépendances pour Smush ; Installation de MediaInfo et FFprobe pour la récupération des métadonnées ; On n’utilise plus ffmpeg2theora ; On n’installe plus flvtool2 au profit de flvtool++ ; On n’installe plus ffmpeg-php qui n’est plus maintenu au (...)
Sur d’autres sites (10164)
-
Python Flask : Saving live stream video to a file periodically
25 juillet 2023, par Sanjay ShahiI am creating a flask application with JavaScript to save the live video streams to a file.


What I am trying to achieve here is that, the video stream will be sent to flask application periodically (20 secs). The first time it will create a video and after that, the video needs to be merged to the existing file.


I am using SocketIO to transmit the video from JS.


`async function startCapture() {
 try {
 // Access the user's webcam
 stream = await navigator.mediaDevices.getUserMedia({ 
 video: true,
 audio: { echoCancellation: true, noiseSuppression: true },
 });

 // Attach the stream to the video element
 video.srcObject = stream;

 // Create a new MediaRecorder instance to capture video chunks
 recorder = new MediaRecorder(stream);

 // Event handler for each data chunk received from the recorder
 recorder.ondataavailable = (e) => {
 const videoBlob = e.data;
 transmitVideoChunk(videoBlob);
 chunks.push(e.data);
 };

 // Start recording the video stream
 recorder.start();

 // Enable/disable buttons
 startButton.disabled = true;
 stopButton.disabled = false;

 // Start transmitting video chunks at the desired fps
 startTransmitting();
 } catch (error) {
 console.error('Error accessing webcam:', error);
 }
}`



`
function transmitVideoBlob() {
 const videoBlob = new Blob(chunks, { type: 'video/webm' });
 socket.emit('video_data', videoBlob);
 // Clear the chunks array
 chunks = [];
}

// Start transmitting video chunks at the desired fps
function startTransmitting() {
 const videoInterval = 20000; // Interval between frames in milliseconds
 videoIntervalId = setInterval(() => {
 transmitVideoBlob();
 }, videoInterval);
}`



In flask, I have created a function, which will call create_videos.
video_path : location to save the video
filename : file name of video
new_video_data_blob : binary data received from JS


def create_videos(video_path, filename, new_video_data_blob):
 chunk_filename = os.path.join(video_path, f"{str(uuid1())}_{filename}")
 final_filename = os.path.join(video_path, filename)
 out_final_filename = os.path.join(video_path, "out_" + filename)
 # Save the current video chunk to a file
 with open(chunk_filename, "wb") as f:
 print("create file chunk ", chunk_filename)
 f.write(new_video_data_blob)

 if not os.path.exists(final_filename):
 # If the final video file doesn't exist, rename the current chunk file
 os.rename(chunk_filename, final_filename)
 else:
 while not os.path.exists(chunk_filename):
 time.sleep(0.1)
 # If the final video file exists, use FFmpeg to concatenate the current chunk with the existing file
 try:
 subprocess.run(
 [
 "ffmpeg",
 "-i",
 f"concat:{final_filename}|{chunk_filename}",
 "-c",
 "copy",
 "-y",
 out_final_filename,
 ]
 )
 while not os.path.exists(out_final_filename):
 time.sleep(0.1)
 os.remove(final_filename)
 os.rename(out_final_filename, final_filename)

 except Exception as e:
 print(e)
 # Remove the current chunk file
 os.remove(chunk_filename)
 return final_filename



When I record as well using below code in JS


audio: { echoCancellation: true, noiseSuppression: true },



I get the following error.


[NULL @ 0x55e697e8c900] Invalid profile 5.
[webm @ 0x55e697ec3180] Non-monotonous DTS in output stream 0:0; previous: 37075, current: 37020; changing to 37075. This may result in incorrect timestamps in the output file.
[NULL @ 0x55e697e8d8c0] Error parsing Opus packet header.
 Last message repeated 1 times
[NULL @ 0x55e697e8c900] Invalid profile 5.
[NULL @ 0x55e697e8d8c0] Error parsing Opus packet header.





But when I record video only, it will work fine.


How can I merge the new binary data to the existing video file ?


-
How to send audio video data to backend service for ffmpeg processing [closed]
26 juin 2022, par Shinu MathewHow to send audio-video data from user's webcam to a backend service for ffmpeg processing from an angular application.


-
Can we Stream Live Audio from Android phone using FFmpeg ?
17 août 2023, par UdayIm using ffmpeg_kit_flutter package to Stream data to the RTSP server in Flutter.


IOS : Working


Android : Its not working


Command Used :


'ffmpeg -f avfoundation -i ":0" -acodec aac -f rtsp -rtsp_transport tcp "$Url"'



When i ran a "
ffmpeg -devices
" command on android, it returns follwing response, through which i got to know android doesn't support avfoundation but android hasandroid_camera
,
Does thisandroid_camera
support audio too ?

Command : 'ffmpeg -devices'


Response :


I/flutter (10620): logs: libavutil 57. 28.100 / 57. 28.100
I/flutter (10620): logs: libavcodec 59. 37.100 / 59. 37.100
I/flutter (10620): logs: libavformat 59. 27.100 / 59. 27.100
I/flutter (10620): logs: libavdevice 59. 7.100 / 59. 7.100
I/flutter (10620): logs: libavfilter 8. 44.100 / 8. 44.100
I/flutter (10620): logs: libswscale 6. 7.100 / 6. 7.100
I/flutter (10620): logs: libswresample 4. 7.100 / 4. 7.100
I/flutter (10620): logs:Devices:
I/flutter (10620): D. = Demuxing supported
I/flutter (10620): .E = Muxing supported
I/flutter (10620): --
I/flutter (10620): logs: D android_camera 
I/flutter (10620): logs: D lavfi 
I/flutter (10620): logs: DE video4linux2,v4l2



Commands which I tried in Android


FFmpegKit.execute('-y -f android_camera -i 0:1 -r 30 -c:a aac -f rtsp -rtsp_transport tcp "$Url"');

FFmpegKit.execute('-y -f android_camera -i 0:1 -r 30 -c:a libmp3lame -qscale:a 2 "/storage/emulated/0/Download/androidvideo.mp3"');

FFmpegKit.execute('-y -f android_camera -i 0:0 -r 30 -c:a wavpack -b:a 64k "/storage/emulated/0/Download/androidvideo.wav"');



This command records video but no audio in it.


FFmpegKit.execute('-video_size hd720 -f android_camera -camera_index 1 -i anything -r 10 -t 00:00:15 "$dir/androidvideo.mp4”');