
Recherche avancée
Autres articles (62)
-
Récupération d’informations sur le site maître à l’installation d’une instance
26 novembre 2010, parUtilité
Sur le site principal, une instance de mutualisation est définie par plusieurs choses : Les données dans la table spip_mutus ; Son logo ; Son auteur principal (id_admin dans la table spip_mutus correspondant à un id_auteur de la table spip_auteurs)qui sera le seul à pouvoir créer définitivement l’instance de mutualisation ;
Il peut donc être tout à fait judicieux de vouloir récupérer certaines de ces informations afin de compléter l’installation d’une instance pour, par exemple : récupérer le (...) -
Use, discuss, criticize
13 avril 2011, parTalk to people directly involved in MediaSPIP’s development, or to people around you who could use MediaSPIP to share, enhance or develop their creative projects.
The bigger the community, the more MediaSPIP’s potential will be explored and the faster the software will evolve.
A discussion list is available for all exchanges between users. -
Installation en mode ferme
4 février 2011, parLe mode ferme permet d’héberger plusieurs sites de type MediaSPIP en n’installant qu’une seule fois son noyau fonctionnel.
C’est la méthode que nous utilisons sur cette même plateforme.
L’utilisation en mode ferme nécessite de connaïtre un peu le mécanisme de SPIP contrairement à la version standalone qui ne nécessite pas réellement de connaissances spécifique puisque l’espace privé habituel de SPIP n’est plus utilisé.
Dans un premier temps, vous devez avoir installé les mêmes fichiers que l’installation (...)
Sur d’autres sites (9913)
-
How do I combine PyTube audio and video streams in a Flask app and let the user download as one file without storing on the web server ?
10 avril 2022, par AJB9384I'm building a YouTube downloader as a side project in Flask. It allows users to input a url and download the video without storing anything on the server I'm hosting on


Lower quality videos can be sent to the user easily as they from PyTube as one file. I use the code below :


import os
import flask
from flask import redirect, url_for, session, send_file
import requests

import pytube
from pytube import YouTube
from io import BytesIO

@app.route('/pull_videos', methods = ['GET', 'POST'])
def pull_videos(): 
 buffer=BytesIO()
 yt_test=YouTube('https://www.youtube.com/watch?v=NNNPgIfK2YE')
 video = yt_test.streams.get_by_itag(251)

 video.stream_to_buffer(buffer)
 buffer.seek(0)

 return send_file(buffer, as_attachment=True, download_name="Test video")



However, I struggle when trying to pull in higher quality videos as they come in as separate audio and videos streams (see documentation here : https://pytube.io/en/latest/user/streams.html#)


I am trying to use ffmpeg to combine the two and then send to the user, but the code below isn't working as expected and throws an error :


Code :


import os
import flask
from flask import redirect, url_for, session, send_file
import requests
import ffmpeg

import pytube
from pytube import YouTube
from io import BytesIO

@app.route('/pull_videos', methods = ['GET', 'POST'])
def pull_videos(): 
 buffer=BytesIO()
 
 video = yt_test.streams.get_by_itag(137)
 input_video = ffmpeg.input(video)
 
 audio = yt_test.streams.get_by_itag(137)
 input_audio = ffmpeg.input(audio)
 
 combined = ffmpeg.concat(input_video, input_audio, v=1, a=1)
 combined.stream_to_buffer(buffer)
 buffer.seek(0)

 return send_file(buffer, as_attachment=True, download_name="Test video")



Error : AttributeError : 'FilterableStream' object has no attribute 'stream_to_buffer'


How could I combine these audio and video streams from PyTube into one file for the user to download without storing on the server ?


-
How do I use gpg to verify an ffmpeg source snapshot download ? [closed]
2 novembre 2024, par NeddieI downloaded two files :


ffmpeg-snapshot.tar.bz2
ffmpeg-devel.asc



The
.asc
file looks like this :

-----BEGIN PGP PUBLIC KEY BLOCK-----


mQENBE22rV0BCAC3DzRmA2XlhrqYv9HKoEvNHHf+PzosmCTHmYhWHDqvBxPkSvCl
...
+x8ETJgPoNK3kQoDagApj4qAt83Ayac3HzNIuEJ7LdvfINIOprujnJ9vH4n04XLg
I4EZ
=Rjbw
-----END PGP PUBLIC KEY BLOCK-----


The command


gpg --show-keys ffmpeg-devel.asc



gives


pub rsa2048 2011-04-26 [SC]
 FCF986EA15E6E293A5644F10B4322F04D67658D8
uid FFmpeg release signing key <ffmpeg-devel@ffmpeg.org>
sub rsa2048 2011-04-26 [E]



The command


gpg --verify ffmpeg-devel.asc ffmpeg-snapshot.tar.bz2



gives output


gpg: verify signatures failed: Unexpected error



I tried decompressing the bz2 file and then


gpg --verify ffmpeg-devel.asc ffmpeg-snapshot.tar



and got the same error.


What am I missing ?


-
FFMPEG - How to wait until all blobs are written before finishing ffmpeg process when getting them from media recorder API
7 novembre 2020, par Caio NakaiI'm using media recorder API to record a video from user's screen and sending the blobs through web socket to a nodejs server. The nodejs server is using the blobs to create a webm video file, the video is being created fine but with a delay, after the user clicks on the stop recording button it stops the media recorder api, however the server didn't finish the processing of all blobs (at least that's what I think it's happening) and then when I check the video file generated the last few seconds of the recording are missing I wonder if there's an way to solve this. Any help is appreciated :)


This is the front-end code that sends the blobs to the nodejs server


const startScreenCapture = async () => {
 try {
 let screenStream;
 videoElem = document.getElementById("myscreen");
 screenStream = await navigator.mediaDevices.getDisplayMedia(
 displayMediaOptions
 );

 const recorderOptions = {
 mimeType: "video/webm;codecs=vp9",
 videoBitsPerSecond: 3 * 1024 * 1024,
 };

 screenMediaRecorder = new MediaRecorder(screenStream, recorderOptions);
 screenMediaRecorder.start(1); // 1000 - the number of milliseconds to record into each Blob
 screenMediaRecorder.ondataavailable = (event) => {
 console.debug("Got blob data:", event.data);
 console.log("Camera stream: ", event.data);
 if (event.data && event.data.size > 0) {
 socket.emit("screen_stream", event.data);
 }
 };

 videoElem.srcObject = screenStream;
 // console.log("Screen stream", screenStream);
 // socket.emit("screen_stream", screenStream);
 } catch (err) {
 console.error("Error: " + err);
 }
};

const stopCapture = (evt) => {
 let tracks = videoElem.srcObject.getTracks();

 tracks.forEach((track) => track.stop());
 videoElem.srcObject = null;
 screenMediaRecorder.stop();
 socket.emit("stop_screen");
 socket.close();
};



This is the nodejs back-end that handle the blobs and generates the videofile


const ffmpeg2 = child_process.spawn("ffmpeg", [
 "-i",
 "-",
 "-c:v",
 "copy",
 "-c:a",
 "copy",
 "screen.webm",
 ]);


 socket.on("screen_stream", (msg) => {
 console.log("Writing screen blob! ");
 ffmpeg2.stdin.write(msg);
 });

 socket.on("stop_screen", () => {
 console.log("Stop recording..");
 });