
Recherche avancée
Médias (1)
-
The Great Big Beautiful Tomorrow
28 octobre 2011, par
Mis à jour : Octobre 2011
Langue : English
Type : Texte
Autres articles (61)
-
Gestion des droits de création et d’édition des objets
8 février 2011, parPar défaut, beaucoup de fonctionnalités sont limitées aux administrateurs mais restent configurables indépendamment pour modifier leur statut minimal d’utilisation notamment : la rédaction de contenus sur le site modifiables dans la gestion des templates de formulaires ; l’ajout de notes aux articles ; l’ajout de légendes et d’annotations sur les images ;
-
Dépôt de média et thèmes par FTP
31 mai 2013, parL’outil MédiaSPIP traite aussi les média transférés par la voie FTP. Si vous préférez déposer par cette voie, récupérez les identifiants d’accès vers votre site MédiaSPIP et utilisez votre client FTP favori.
Vous trouverez dès le départ les dossiers suivants dans votre espace FTP : config/ : dossier de configuration du site IMG/ : dossier des média déjà traités et en ligne sur le site local/ : répertoire cache du site web themes/ : les thèmes ou les feuilles de style personnalisées tmp/ : dossier de travail (...) -
Keeping control of your media in your hands
13 avril 2011, parThe vocabulary used on this site and around MediaSPIP in general, aims to avoid reference to Web 2.0 and the companies that profit from media-sharing.
While using MediaSPIP, you are invited to avoid using words like "Brand", "Cloud" and "Market".
MediaSPIP is designed to facilitate the sharing of creative media online, while allowing authors to retain complete control of their work.
MediaSPIP aims to be accessible to as many people as possible and development is based on expanding the (...)
Sur d’autres sites (11209)
-
JSmpeg is not playing audio from websocket stream
5 juin 2023, par NikI am trying to stream RTSP to web browser using ffmpeg through web socket relay written in node js taken from https://github.com/phoboslab/jsmpeg , and on the browser i am using JSMpeg to display the RTSP stream, the video is playing fine, but audio is not playing,


The ffmpeg command :


ffmpeg -rtsp_transport tcp -i rtsp://wowzaec2demo.streamlock.net/vod/mp4:BigBuckBunny_115k.mp4 
 -f mpegts -c:v mpeg1video -c:a mp2 http://127.0.0.1:8081/stream_from_ffmpeg/



The node js web socket relay :


// Use the websocket-relay to serve a raw MPEG-TS over WebSockets. You can use
// ffmpeg to feed the relay. ffmpeg -> websocket-relay -> browser
// Example:
// node websocket-relay yoursecret 8081 8082
// ffmpeg -i <some input="input"> -f mpegts http://localhost:8081/yoursecret

var fs = require('fs'),
 http = require('http'),
 WebSocket = require('ws');

if (process.argv.length < 3) {
 console.log(
 'Usage: \n' +
 'node websocket-relay.js <secret> [ ]'
 );
 process.exit();
}

var STREAM_SECRET = process.argv[2],
 STREAM_PORT = process.argv[3] || 8081,
 WEBSOCKET_PORT = process.argv[4] || 8082,
 RECORD_STREAM = false;

// Websocket Server
var socketServer = new WebSocket.Server({port: WEBSOCKET_PORT, perMessageDeflate: false});
socketServer.connectionCount = 0;
socketServer.on('connection', function(socket, upgradeReq) {
 socketServer.connectionCount++;
 console.log(
 'New WebSocket Connection: ',
 (upgradeReq || socket.upgradeReq).socket.remoteAddress,
 (upgradeReq || socket.upgradeReq).headers['user-agent'],
 '('+socketServer.connectionCount+' total)'
 );
 socket.on('close', function(code, message){
 socketServer.connectionCount--;
 console.log(
 'Disconnected WebSocket ('+socketServer.connectionCount+' total)'
 );
 });
});
socketServer.broadcast = function(data) {
 socketServer.clients.forEach(function each(client) {
 if (client.readyState === WebSocket.OPEN) {
 client.send(data);
 }
 });
};

// HTTP Server to accept incoming MPEG-TS Stream from ffmpeg
var streamServer = http.createServer( function(request, response) {
 var params = request.url.substr(1).split('/');

 if (params[0] !== STREAM_SECRET) {
 console.log(
 'Failed Stream Connection: '+ request.socket.remoteAddress + ':' +
 request.socket.remotePort + ' - wrong secret.'
 );
 response.end();
 }

 response.connection.setTimeout(0);
 console.log(
 'Stream Connected: ' +
 request.socket.remoteAddress + ':' +
 request.socket.remotePort
 );
 request.on('data', function(data){
 socketServer.broadcast(data);
 if (request.socket.recording) {
 request.socket.recording.write(data);
 }
 });
 request.on('end',function(){
 console.log('close');
 if (request.socket.recording) {
 request.socket.recording.close();
 }
 });

 // Record the stream to a local file?
 if (RECORD_STREAM) {
 var path = 'recordings/' + Date.now() + '.ts';
 request.socket.recording = fs.createWriteStream(path);
 }
})
// Keep the socket open for streaming
streamServer.headersTimeout = 0;
streamServer.listen(STREAM_PORT);

console.log('Listening for incoming MPEG-TS Stream on http://127.0.0.1:'+STREAM_PORT+'/<secret>');
console.log('Awaiting WebSocket connections on ws://127.0.0.1:'+WEBSOCKET_PORT+'/');
</secret></secret></some>


The front end code




 
 
 
 
 <code class="echappe-js"><script src='http://stackoverflow.com/feeds/tag/jsmpeg.min.js'></script>

 
 
 
 
 
<script>&#xA; let url;&#xA; let player;&#xA; let canvas = document.getElementById("video-canvas");&#xA; let ipAddr = "127.0.0.1:8082";&#xA; window.onload = async() => {&#xA; url = `ws://${ipAddr}`;&#xA; player = new JSMpeg.Player(url, { canvas: canvas, });&#xA; };&#xA;&#xA; </script>





The above code works fine and plays the video, but no audio is playing
Things I tried :


Changed the audio context state inside the player object from suspended to running


player.audioOut.context.onstatechange = async () => {
 console.log("Event triggered by audio");

 if (player.audioOut.context === "suspended") {
 await player.audioOut.context.resume();
 }
}



-
How can I rename a file from a txt file with Windows bat file ?
12 septembre 2022, par user1264599I have a batch script that renames a file to input.mkv so it can be processed by a string of other commands in the bat file with a final file called ProcessedVideo.mkv. I capture the OG file name using "dir *.mkv /b>OG_FileName.txt" before being renamed.


How can I rename the final processed mkv file to the name captured in the OG_FileName.txt and maybe add "_Added-Text.mkv" as the last part of my Batch Script ? (Adding text to the file name is not that important if it is too much trouble).


I really thought this would be easy but I'm defeated.


-
Realtime video processing with javacv on Android
7 août 2014, par moonieI wish to do realtime video processing on Android using opencv/javacv. My basic approach can be summarized as follow :
onCreate(), generating a new JavaCameraView
mCameraView = new JavaCameraView(this, mCameraIndex);
mCameraView.setCvCameraViewListener(this);
setContentView(mCameraView);when the user clicks a button, a ffmpegframe recorder is created
try{
final long currentTimeMillis = System.currentTimeMillis();
final String appName=getString(R.string.app_name);
final String galleryPath=Environment.getExternalStoragePublicDirectory(Environment.DIRECTORY_PICTURES).toString();
final String albumPath=galleryPath+"/"+appName;
final String photoPath=albumPath+"/"+currentTimeMillis+".avi";
FFmpegFrameRecorder recorder=FFmpegFrameRecorder.createDefault(photoPath, 640, 360);
recorder.setFrameRate(30);
recorder.start();
}catch(FrameRecorder.Exception e){
e.printStackTrace();
}then for each CameraFrame, use the following code to process and save the frame
public Mat onCameraFrame(final CvCameraViewFrame inputFrame){
final Mat rgba = inputFrame.rgba();
//...apply some filters on rgba
if(mIsTakingVideo){
try{
recorder.record(MatToIplImage(rgba,640,320));
}catch(FrameRecorder.Exception {
e.printStackTrace();
}
}
return rgba;
}
public IplImage MatToIplImage(Mat m){
Bitmap bmp=Bitmap.createBitmap(m.width(), m.height(), Config.ARGB_8888);
Utils.matToBitmap(m, bmp);
IplImage image=IplImage.create(m.width(),m.height(),IPL_DEPTH_8U,1);
bmp.copyPixelsToBuffer(image.getByteBuffer());
return image;}When the user clicks the button again, the recorder is stopped and released. However the video I create is an empty video. Any idea why ?
EDIT :
The video was empty because the format avi is not supported on my test phone...
Now the video is not empty but it has the following errors- The recorded video has two split windows instead of just one window
- The color is very different from the object I recorded
- The play rate is too fast.