
Recherche avancée
Médias (91)
-
Collections - Formulaire de création rapide
19 février 2013, par
Mis à jour : Février 2013
Langue : français
Type : Image
-
Les Miserables
4 juin 2012, par
Mis à jour : Février 2013
Langue : English
Type : Texte
-
Ne pas afficher certaines informations : page d’accueil
23 novembre 2011, par
Mis à jour : Novembre 2011
Langue : français
Type : Image
-
The Great Big Beautiful Tomorrow
28 octobre 2011, par
Mis à jour : Octobre 2011
Langue : English
Type : Texte
-
Richard Stallman et la révolution du logiciel libre - Une biographie autorisée (version epub)
28 octobre 2011, par
Mis à jour : Octobre 2011
Langue : English
Type : Texte
-
Rennes Emotion Map 2010-11
19 octobre 2011, par
Mis à jour : Juillet 2013
Langue : français
Type : Texte
Autres articles (83)
-
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 (...) -
Amélioration de la version de base
13 septembre 2013Jolie sélection multiple
Le plugin Chosen permet d’améliorer l’ergonomie des champs de sélection multiple. Voir les deux images suivantes pour comparer.
Il suffit pour cela d’activer le plugin Chosen (Configuration générale du site > Gestion des plugins), puis de configurer le plugin (Les squelettes > Chosen) en activant l’utilisation de Chosen dans le site public et en spécifiant les éléments de formulaires à améliorer, par exemple select[multiple] pour les listes à sélection multiple (...) -
Emballe médias : à quoi cela sert ?
4 février 2011, parCe plugin vise à gérer des sites de mise en ligne de documents de tous types.
Il crée des "médias", à savoir : un "média" est un article au sens SPIP créé automatiquement lors du téléversement d’un document qu’il soit audio, vidéo, image ou textuel ; un seul document ne peut être lié à un article dit "média" ;
Sur d’autres sites (7753)
-
NodeJS : Fail to write byte array input from webcam to ffmpeg spawn process
23 mai 2024, par Thanesh PrabaghanI'm using NodeJS server to display an HTML page which has webcam option. Once user visited to my NodeJS server, it will serve html page. User can allow webcam option and see webcam view on the page.


In the backend, I send webcam stream (byte array) using
socket.io
. I receive byte array successfully in backend with the help ofsocket.io
. BUT MY PROBLEM IS, I can't pipe this byte array to theffmpeg
spawn process. I don't know how to properly pipe this data to theffmpeg
. Once it done, all my problem will be solved.

On the other side, I have
node-media-server
as RTMP server to publish this stream to VLC player and other devices. Kindly help me to complete this task. I will attach all my code to this question. Kindly run this in your environment and answer the question.

MY HTML PAGE




 
 
 

 

 <code class="echappe-js"><script src="https://cdn.socket.io/4.7.5/socket.io.min.js" &#xA; integrity="integrity_code" &#xA; crossorigin="anonymous"></script>

 
 

 

<script>&#xA; const socket = io(&#x27;http://localhost:8080/&#x27;);&#xA; var video = document.getElementById("video");&#xA;&#xA; if (navigator.mediaDevices.getUserMedia) {&#xA; navigator.mediaDevices.getUserMedia({ video: true, audio:true })&#xA; .then(function (stream) {&#xA; const recorder = new MediaRecorder(stream);&#xA;&#xA; recorder.ondataavailable = event => {&#xA; socket.emit(&#x27;VideoStream&#x27;, event.data);&#xA; };&#xA; recorder.start(1000); &#xA; video.srcObject = stream;&#xA; }).catch(function (error) {&#xA; console.log("Something went wrong!");&#xA; });&#xA; } &#xA; </script>

 




FFMPEG IMPLEMENTATION


const express = require('express');
const app = express();
const http = require('http');
const server = http.createServer(app);
const { Server } = require("socket.io");
const io = new Server(server);
const path = require('node:path'); 
const { spawn } = require('node:child_process');

let cmd = spawn('ffmpeg.exe', [
 '-c:v', 'copy', '-preset', 'ultrafast', '-tune', 'zerolatency',
 '-c:a', 'aac', '-strict', '-2', '-ar', '44100', '-b:a', '64k',
 '-y',
 '-use_wallclock_as_timestamps', '1',
 '-async', '1',
 '-flush_packets', '1',
 '-rtbufsize', '1000',
 '-bufsize', '1000',
 '-f', 'flv',
 '-i','-',
 'rtmp://localhost:1935',
 ]);

app.use(express.static(path.join(__dirname, 'public')));

app.get('/', (req, res) => {
 res.sendFile(path.join(__dirname + 'index.html'));
});

io.on('connection', (socket) => {
 socket.on("VideoStream", (data) => {
 cmd.stdin.write(data);
 });
});

server.listen(8080, () => {
 console.log('listening on *:8080');
});

```
**NODE MEDIA SERVER IMPLEMENTATION**

```
const NodeMediaServer = require('node-media-server');

const config = {
 rtmp: {
 port: 1935,
 chunk_size: 60000,
 gop_cache: true,
 ping: 30,
 ping_timeout: 60
 },
 http: {
 port: 8000,
 allow_origin: '*'
 }
};

var nms = new NodeMediaServer(config)
nms.run();
```





-
How to sync network audio with a different network video and play it with chewie
26 mars 2023, par Rudra SharmaI am trying to stream a reddit videos on my app. For that reason I am using Reddit API but it is only giving the video url like 'redd.it/mpym0z9q8opa1/DASH_1080.mp4 ?source=fallback' with no audio but after some research I found out that we can get audio url by editing video url 'redd.it/mpym0z9q8opa1/DASH_audio.mp4 ?source=fallback'.


Now I have both audio and video url with me how can I sync them on network and stream them on my app using chewie package (video player).


This my code so far


import 'dart:async';
import 'dart:convert';
import 'package:http/http.dart' as http;
import 'package:flutter/material.dart';
import 'package:video_player/video_player.dart';
import 'package:chewie/chewie.dart';

void main() => runApp(MyApp());

class MyApp extends StatelessWidget {
 @override
 Widget build(BuildContext context) {
 return MaterialApp(
 title: 'Reddit Videos',
 theme: ThemeData(
 primarySwatch: Colors.blue,
 visualDensity: VisualDensity.adaptivePlatformDensity,
 ),
 home: VideoPlayerScreen(),
 );
 }
}

class VideoPlayerScreen extends StatefulWidget {
 @override
 _VideoPlayerScreenState createState() => _VideoPlayerScreenState();
}

class _VideoPlayerScreenState extends State<videoplayerscreen> {
 final List<string> _videoUrls = [];

 @override
 void initState() {
 super.initState();
 _loadVideos();
 }

 Future<void> _loadVideos() async {
 try {
 final videoUrls =
 await RedditApi.getVideoUrlsFromSubreddit('aww');

 setState(() {
 _videoUrls.addAll(videoUrls);
 });
 } catch (e) {
 print(e);
 }
 }

 @override
 Widget build(BuildContext context) {
 return Scaffold(
 appBar: AppBar(
 title: Text('Reddit Videos'),
 ),
 body: SafeArea(
 child: _videoUrls.isNotEmpty
 ? _buildVideosList()
 : Center(child: CircularProgressIndicator()),
 ),
 );
 }

 Widget _buildVideosList() {
 return ListView.builder(
 itemCount: _videoUrls.length,
 itemBuilder: (context, index) {
 return Padding(
 padding: const EdgeInsets.all(8.0),
 child: Chewie(
 controller: ChewieController(
 videoPlayerController: VideoPlayerController.network(
 _videoUrls[index],
 ),
 aspectRatio: 9 / 16,
 autoPlay: true,
 looping: true,
 autoInitialize: true,
 ),
 ),
 );
 },
 );
 }
}

class RedditApi {
 static const String BASE_URL = 'https://www.reddit.com';
 static const String CLIENT_ID = 'id';
 static const String CLIENT_SECRET = 'secret';

 static Future> getVideoUrlsFromSubreddit(
 String subredditName) async {
 final response = await http.get(
 Uri.parse('$BASE_URL/r/$subredditName/top.json?limit=10'),
 headers: {'Authorization': 'Client-ID $CLIENT_ID'});

 if (response.statusCode == 200) {
 final jsonData = jsonDecode(response.body);
 final postsData = jsonData['data']['children'];

 final videoUrls = <string>[];

 for (var postData in postsData) {
 if (postData['data']['is_video']) {
 videoUrls.add(postData['data']['media']['reddit_video']
 ['fallback_url']);
 }
 }

 return videoUrls;
 } else {
 throw Exception("Failed to load videos from subreddit");
 }
 }
}
</string></void></string></videoplayerscreen>


I think the code is self explainatory about what I am trying to achieve (Trying to make a client for reddit).


-
How to stream and play video automatically using PHP FFmpeg Video Streaming libray
21 août 2020, par kikabi francisAm currently new to ffmpeg video streaming and working on a project to stream mp4 videos using ffmpeg libray https://github.com/aminyazdanpanah/PHP-FFmpeg-video-streaming and Video player https://videojs.com/ using DASH.
Am currently starting the streaming to mpd using commandline, with streaming.php.
I want to start streaming automatically when dash.html with video playing.
and i want to switch between different video qualities on the player, currently it play the same quality set in streaming.php
Here is my code



 
 
 
 
 
 
 
 
 <video height="480" data-setup="'{"liveui":" class="video-js vjs-default-skin" controls="controls"></video>
 <code class="echappe-js"><script src='http://stackoverflow.com/feeds/tag/app/js/plugins/node/video.js/dist/video.js'></script>

<script src='http://stackoverflow.com/feeds/tag/app/js/plugins/switcher/videojs-resolution-switcher.js'></script>

 
<script src='http://stackoverflow.com/feeds/tag/app/js/plugins/node/dashjs/dist/dash.all.min.js'></script>

 
 
<script src='http://stackoverflow.com/feeds/tag/app/js/plugins/node/videojs-contrib-dash/dist /videojs-dash.js'></script>

 
<script>&#xA;&#xA; var player = videojs(&#x27;example-video&#x27;);&#xA;&#xA; player.ready(function() {&#xA; player.updateSrc([&#xA; {&#xA; src: &#x27;http://localhost/MovieWeb/media/stream/dash-stream.mpd&#x27;,&#xA; type: &#x27;application/dash&#x2B;xml&#x27;,&#xA; label: &#x27;144p&#x27;,&#xA; res: 144&#xA; },&#xA; {&#xA; src: &#x27;http://localhost/MovieWeb/media/stream/dash-stream.mpd&#x27;,&#xA; type: &#x27;application/dash&#x2B;xml&#x27;,&#xA; label: &#x27;240p&#x27;,&#xA; res: 240&#xA; },&#xA; {&#xA; src: &#x27;http://localhost/MovieWeb/media/stream/dash-stream.mpd&#x27;,&#xA; type: &#x27;application/dash&#x2B;xml&#x27;,&#xA; label: &#x27;360p&#x27;,&#xA; res: 360&#xA; },&#xA; {&#xA; src: &#x27;http://localhost/MovieWeb/media/stream/dash-stream.mpd&#x27;,&#xA; type: &#x27;application/dash&#x2B;xml&#x27;,&#xA; label: &#x27;480p&#x27;,&#xA; res: 480&#xA; },&#xA; {&#xA; src: &#x27;http://localhost/MovieWeb/media/stream/dash-stream.mpd&#x27;,&#xA; type: &#x27;application/dash&#x2B;xml&#x27;,&#xA; label: &#x27;720p&#x27;,&#xA; res: 720&#xA; },&#xA; {&#xA; src: &#x27;http://localhost/MovieWeb/media/stream/dash-stream.mpd&#x27;,&#xA; type: &#x27;application/dash&#x2B;xml&#x27;,&#xA; label: &#x27;1080p&#x27;,&#xA; res: 1080&#xA; }&#xA; ])&#xA; &#xA; player.play();&#xA; });&#xA; player.videoJsResolutionSwitcher();&#xA; </script>

 
 


//video.php
< ?php
require ('api/libs/ffmpeg_video_stream/vendor/autoload.php') ;
use Streaming\Representation ;
$r_144p = (new Representation)->setKiloBitrate(95)->setResize(256, 144) ;
$r_240p = (new Representation)->setKiloBitrate(150)->setResize(426, 240) ;
$r_360p = (new Representation)->setKiloBitrate(276)->setResize(640, 360) ;
$r_480p = (new Representation)->setKiloBitrate(750)->setResize(854, 480) ;
$r_720p = (new Representation)->setKiloBitrate(2048)->setResize(1280, 720) ;
$r_1080p = (new Representation)->setKiloBitrate(4096)->setResize(1920, 1080) ;
$config = [
 'ffmpeg.binaries' => 'C :/ffmpeg/bin/ffmpeg.exe',
 'ffprobe.binaries' => 'C :/ffmpeg/bin/ffprobe.exe',
 'timeout' => 3600, // The timeout for the underlying process
 'ffmpeg.threads' => 12, // The number of threads that FFmpeg should use
 ] ;
$ffmpeg = Streaming\FFMpeg::create($config) ;
$video = $ffmpeg->open('media/videos/dir686840/1080p_video.mp4') ;
$video->dash()
 ->setAdaption('id=0,streams=v id=1,streams=a')
 ->x264()
 ->addRepresentations([$r_360p])
 ->save('media/stream/dash-stream.mpd') ;
 ?>


Thank you very much !!