
Advanced search
Medias (91)
-
Les Miserables
9 December 2019, by
Updated: December 2019
Language: français
Type: Textual
-
VideoHandle
8 November 2019, by
Updated: November 2019
Language: français
Type: Video
-
Somos millones 1
21 July 2014, by
Updated: June 2015
Language: français
Type: Video
-
Un test - mauritanie
3 April 2014, by
Updated: April 2014
Language: français
Type: Textual
-
Pourquoi Obama lit il mes mails?
4 February 2014, by
Updated: February 2014
Language: français
-
IMG 0222
6 October 2013, by
Updated: October 2013
Language: français
Type: Picture
Other articles (31)
-
MediaSPIP Core : La Configuration
9 November 2010, byMediaSPIP Core fournit par défaut trois pages différentes de configuration (ces pages utilisent le plugin de configuration CFG pour fonctionner) : une page spécifique à la configuration générale du squelettes; une page spécifique à la configuration de la page d’accueil du site; une page spécifique à la configuration des secteurs;
Il fournit également une page supplémentaire qui n’apparait que lorsque certains plugins sont activés permettant de contrôler l’affichage et les fonctionnalités spécifiques de (...) -
Creating farms of unique websites
13 April 2011, byMediaSPIP platforms can be installed as a farm, with a single "core" hosted on a dedicated server and used by multiple websites.
This allows (among other things): implementation costs to be shared between several different projects / individuals rapid deployment of multiple unique sites creation of groups of like-minded sites, making it possible to browse media in a more controlled and selective environment than the major "open" (...) -
Personnaliser en ajoutant son logo, sa bannière ou son image de fond
5 September 2013, byCertains 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;
On other websites (8251)
-
FFMPEG ERROR on streaming video generated from MediaRecorder API on RTMP url
20 February 2024, by Prince MishraRef : https://www.mux.com/blog/the-state-of-going-live-from-a-browser


The above blog states my problem in detail and presented a solution also.
I am trying to implement the solution which is using socketio


Here is the description of the problem :


I want to capture the video and audio from the browser using


navigator.mediaDevices
 .getUserMedia({ video: true, audio: true })



and i am using the


const options = {
 mimeType: "video/webm;codecs=vp8",
};
const mediaRecorder = new MediaRecorder(stream, options);



to record the video chunk by chunk from the stream given by getusermedia and then using the socket io to send the video to the backend. Where I am using the ffmpeg to stream the chunks on rtmp url.


I am using the following ffmpeg commands :


const { spawn } = require('child_process');

const ffmpegProcess = spawn('ffmpeg', [
 '-i', 'pipe:0',
 '-c:v', 'libx264',
 '-preset', 'veryfast',
 '-tune', 'zerolatency',
 '-c:a', 'aac',
 '-ar', '44100',
 '-f', 'flv',
 rtmpurl
]);



And I am getting the following errors:








Can anyone help me how to fix this. I am new to FFmpeg.


Here is the complete frontend and Backend code :


Frontend (App.jsx) :



import { useEffect } from "react";
import "./App.css";
import io from "socket.io-client";

function App() {
 let video;

 useEffect(() => {
 video = document.getElementById("video");
 }, []);

 const socket = io("http://localhost:3050");
 socket.on("connect", () => {
 console.log("Connected to server");
 });

 let stream;
 navigator.mediaDevices
 .getUserMedia({ video: true, audio: true })
 .then((strea) => {
 video.srcObject = strea;
 stream = strea;
 const options = {
 mimeType: "video/webm;codecs=vp8",
 };
 const mediaRecorder = new MediaRecorder(stream, options);
 console.log(mediaRecorder);
 let chunks = [];

 mediaRecorder.ondataavailable = function (e) {
 chunks.push(e.data);
 console.log(e.data);
 };
 mediaRecorder.onstop = function (e) {
 const blob = new Blob(chunks, { type: "video/webm;codecs=vp8" });
 console.log("emitted");
 socket.emit("videoChunk", blob);
 chunks = [];
 // const videoURL = URL.createObjectURL(blob);
 // const a = document.createElement('a');
 // a.href = videoURL;
 // a.download = 'video.mp4';
 // a.click();
 window.URL.revokeObjectURL(videoURL);
 };
 mediaRecorder.start();
 setInterval(() => {
 mediaRecorder.stop();
 mediaRecorder.start();
 }, 2000);
 })
 .catch((error) => {
 console.error("Error accessing camera:", error);
 });

 // Capture video after 10 seconds

 return (
 <>
 <video width="640" height="480" autoplay="autoplay"></video>
 <button>Capture</button>
 >
 );
}

export default App;



Backend Code :


const express = require('express');
const http = require('http');
const socketIo = require('socket.io');
const { spawn } = require('child_process');

const app = express();

const server = http.createServer(app);
const io = socketIo(server, {
 cors: {
 origin: "*",
 methods: ["GET", "POST"]
 }, maxhttpBufferSize: 1e8
 });

 const rtmpurl = 'rtmp://localhost/live/test';

io.on('connection', (socket) => {
 console.log('A user connected');

 const ffmpegProcess = spawn('ffmpeg', [
 '-i', 'pipe:0',
 '-c:v', 'libx264',
 '-preset', 'veryfast',
 '-tune', 'zerolatency',
 '-c:a', 'aac',
 '-ar', '44100',
 '-f', 'flv',
 rtmpurl
 ]);


 ffmpegProcess.stdin.on('error', (e) => {
 console.log(e);
 });
 
 ffmpegProcess.stderr.on('data', (data) => {
 console.log(data.toString());
 });

 ffmpegProcess.on('close', (code) => {
 console.log(`child process exited with code ${code}`);
 });


 socket.on('videoChunk', (chunk) => {
 console.log(chunk)
 ffmpegProcess.stdin.write(chunk);

 });

 socket.on('disconnect', () => {
 console.log('User disconnected');
 ffmpegProcess.stdin.end();
 });
});

const PORT = process.env.PORT || 3050;

app.get('/test', (req, res) => {
 res.send('Hello from /test route!');
});


server.listen(PORT, () => {
 console.log(`Server is running on port ${PORT}`);
});



-
Error compiling and building DashEncoder code and how to play the .mpd file when generated [closed]
11 April 2013, by niuuI'm trying to build the DashEncoder code which I downloaded from github https://github.com/slederer/DASHEncoder. Well, I followed all the instructions given in the how to compile dash file. installed Gpac n X264 and compiled both successfully. Then did make of Dashencoder and ran it as ./Dashencoder. But I found some issues in it. Got this log :
==========DASH ENCODER===============
Unknown option in resourcefile : sql-pw :
current encoder x264
YES
x264 encoding @ 300 kbps: Pass 1
x264: x264 —profile baseline —preset slow —verbose —fps 24 —vbv-maxrate 300 —vbv-bufsize 600 —scenecut 0 —keyint 48 —output /opt/lampp/htdocs/tests_updates/sintel_trailer_2k_480p24_300kbit.h264 /home/niu/sintel_trailer_2k_480p24.y4m >out.txt 2>&1
mkdir: cannot create directory/opt/lampp/htdocs/tests_updates/sintel_300kbit': File exists
cp: omitting directory/opt/lampp/htdocs/tests_updates/'
copy audio: cp /opt/lampp/htdocs/tests_updates/ /opt/lampp/htdocs/tests_updates/sintel_300kbit/MP4Box multiplexing Video: /opt/lampp/htdocs/tests_updates/sintel_300kbit/sintel_trailer_2k_480p24_300kbit.h264
mp4box: MP4Box -add /opt/lampp/htdocs/tests_updates/sintel_300kbit/sintel_trailer_2k_480p24_300kbit.h264 /opt/lampp/htdocs/tests_updates/sintel_300kbit/sintel_trailer_2k_480p24_300kbit.mp4
AVC-H264 import - frame size 854 x 480 at 24.000 FPS
AVC Import results: 1253 samples - Slices: 27 I 1226 P 0 B - 1 SEI - 27 IDR
Saving to /opt/lampp/htdocs/tests_updates/sintel_300kbit/sintel_trailer_2k_480p24_300kbit.mp4: 0.500 secs Interleaving
MP4Box multiplexing Audio:/opt/lampp/htdocs/tests_updates/sintel_300kbit/
mp4box: MP4Box -add /opt/lampp/htdocs/tests_updates/sintel_300kbit/ /opt/lampp/htdocs/tests_updates/sintel_300kbit/sintel_trailer_2k_480p24_300kbit.mp4
Unknown input file type
Unknown input file type
Error importing /opt/lampp/htdocs/tests_updates/sintel_300kbit/: Bad Parameter
MP4Box Cleaning ...
mp4box: MP4Box -no-sys /opt/lampp/htdocs/tests_updates/sintel_300kbit/sintel_trailer_2k_480p24_300kbit.mp4
Saving /opt/lampp/htdocs/tests_updates/sintel_300kbit/sintel_trailer_2k_480p24_300kbit.mp4: 0.500 secs Interleaving
MP4Box segmentation: /opt/lampp/htdocs/tests_updates/sintel_300kbit/sintel_trailer_2k_480p24_300kbit.h264
mp4box: MP4Box -frag 2000 -dash 2000 -rap -segment-name /opt/lampp/htdocs/tests_updates/sintel_300kbit/sintel /opt/lampp/htdocs/tests_updates/sintel_300kbit/sintel_trailer_2k_480p24_300kbit.mp4
DASH-ing file: 2.00s segments 2.00s fragments single sidx per segment
Spliting segments at GOP boundaries
[DASH] Generating MPD at time 2013-03-16T16:40:03Z
DASHing file /opt/lampp/htdocs/tests_updates/sintel_300kbit/sintel_trailer_2k_480p24_300kbit.mp4
terminate called after throwing an instance of 'std::out_of_range'
what(): basic_string::substr
Error: Unable to open MPD file!Aborted
Why is this error at the end? and also one folder got created in my /opt/lampp/htdocs/tests_updates/sintel_300kbit. which has two types of files : 27 files of .m4s extension 1 file -sintelinit.mp4 1 file- sintel_trailer_2k_480p24_300kbit.mp4 , which when played in vlc player played the video bt no audio! &1 file- sintel_trailer_2k_480p24_300kbit.h264 which cannot be opened.
No .mpd file was created.
Also I want to know aft creating that .mpd file how will i be able to test it on my android client say media player.
I am damn confused with all this happening. Please help
-
cap.isOpened(): returns false in CentOS for Python 3 and OpenCV 3.1.0
29 October 2017, by Mona JalalSo cap from opencv 3 doesn’t work in CentOS. I had no problem in OSX or Windows 7 which I tried initially.
Here is the example code:import cv2
cap = cv2.VideoCapture('/home/grad3/jalal/PycharmProjects/hw4_cs585/Concession_LAN_800k.mp4',cv2.CAP_FFMPEG)
if not cap.isOpened():
print('not opened')
while True:
ret,frame = cap.read()
if ret == False:
print('frame empty')
break
cv2.imshow('frame', frame)
if cv2.waitKey(1) == ord('q'):
breakAnd I get:
/usr/local/anaconda3/bin/python /home/grad3/jalal/PycharmProjects/hw4_cs585/test.py
not opened
frame empty
Process finished with exit code 0I can open the video using ffplay vid_name and also here is the result of https://pastebin.com/YGk2DDCi here https://pastebin.com/HSyHSsEZ (ffmpeg codecs). How should I fix this?
I have opencv 3.1.0 and here’s some sys info.
$ uname -a
Linux goku.bu.edu 3.10.0-693.5.2.el7.x86_64 #1 SMP Fri Oct 20 20:32:50 UTC 2017 x86_64 x86_64 x86_64 GNU/Linuxand
$ lsb_release -a
LSB Version: :core-4.1-amd64:core-4.1-noarch
Distributor ID: CentOS
Description: CentOS Linux release 7.4.1708 (Core)
Release: 7.4.1708
Codename: Core
cv2. getBuildInformation()
General configuration for OpenCV 3.1.0 =====================================
Version control: unknown
Platform:
Host: Linux 4.8.0-46-generic x86_64
CMake: 3.6.3
CMake generator: Unix Makefiles
CMake build tool: /usr/bin/gmake
Configuration: Release
C/C++:
Built as dynamic libs?: YES
C++ Compiler: /opt/rh/devtoolset-2/root/usr/bin/c++ (ver 4.8.2)
C++ flags (Release): -I/cs/software/anaconda3/include -fsigned-char -W -Wall -Werror=return-type -Werror=non-virtual-dtor -Werror=address -Werror=sequence-point -Wformat -Werror=format-security -Wmissing-declarations -Wundef -Winit-self -Wpointer-arith -Wshadow -Wsign-promo -Wno-narrowing -Wno-delete-non-virtual-dtor -fdiagnostics-show-option -Wno-long-long -pthread -fomit-frame-pointer -msse -msse2 -mno-avx -msse3 -mno-ssse3 -mno-sse4.1 -mno-sse4.2 -ffunction-sections -fvisibility=hidden -fvisibility-inlines-hidden -fopenmp -O3 -DNDEBUG -DNDEBUG
C++ flags (Debug): -I/cs/software/anaconda3/include -fsigned-char -W -Wall -Werror=return-type -Werror=non-virtual-dtor -Werror=address -Werror=sequence-point -Wformat -Werror=format-security -Wmissing-declarations -Wundef -Winit-self -Wpointer-arith -Wshadow -Wsign-promo -Wno-narrowing -Wno-delete-non-virtual-dtor -fdiagnostics-show-option -Wno-long-long -pthread -fomit-frame-pointer -msse -msse2 -mno-avx -msse3 -mno-ssse3 -mno-sse4.1 -mno-sse4.2 -ffunction-sections -fvisibility=hidden -fvisibility-inlines-hidden -fopenmp -g -O0 -DDEBUG -D_DEBUG
C Compiler: /opt/rh/devtoolset-2/root/usr/bin/cc
C flags (Release): -I/cs/software/anaconda3/include -fsigned-char -W -Wall -Werror=return-type -Werror=non-virtual-dtor -Werror=address -Werror=sequence-point -Wformat -Werror=format-security -Wmissing-declarations -Wmissing-prototypes -Wstrict-prototypes -Wundef -Winit-self -Wpointer-arith -Wshadow -Wno-narrowing -fdiagnostics-show-option -Wno-long-long -pthread -fomit-frame-pointer -msse -msse2 -mno-avx -msse3 -mno-ssse3 -mno-sse4.1 -mno-sse4.2 -ffunction-sections -fvisibility=hidden -fopenmp -O3 -DNDEBUG -DNDEBUG
C flags (Debug): -I/cs/software/anaconda3/include -fsigned-char -W -Wall -Werror=return-type -Werror=non-virtual-dtor -Werror=address -Werror=sequence-point -Wformat -Werror=format-security -Wmissing-declarations -Wmissing-prototypes -Wstrict-prototypes -Wundef -Winit-self -Wpointer-arith -Wshadow -Wno-narrowing -fdiagnostics-show-option -Wno-long-long -pthread -fomit-frame-pointer -msse -msse2 -mno-avx -msse3 -mno-ssse3 -mno-sse4.1 -mno-sse4.2 -ffunction-sections -fvisibility=hidden -fopenmp -g -O0 -DDEBUG -D_DEBUG
Linker flags (Release):
Linker flags (Debug):
Precompiled headers: YES
Extra dependencies: /cs/software/anaconda3/lib/libjpeg.so /cs/software/anaconda3/lib/libpng.so /cs/software/anaconda3/lib/libtiff.so /cs/software/anaconda3/lib/libhdf5.so /usr/lib64/librt.so /usr/lib64/libpthread.so /cs/software/anaconda3/lib/libz.so /usr/lib64/libdl.so /usr/lib64/libm.so dl m pthread rt
3rdparty dependencies: libwebp libjasper IlmImf libprotobuf
OpenCV modules:
To be built: core flann hdf imgproc ml photo reg surface_matching video dnn fuzzy imgcodecs shape videoio highgui objdetect plot superres xobjdetect xphoto bgsegm bioinspired dpm face features2d line_descriptor saliency text calib3d ccalib datasets rgbd stereo structured_light tracking videostab xfeatures2d ximgproc aruco optflow stitching python3
Disabled: world contrib_world
Disabled by dependency: -
Unavailable: cudaarithm cudabgsegm cudacodec cudafeatures2d cudafilters cudaimgproc cudalegacy cudaobjdetect cudaoptflow cudastereo cudawarping cudev java python2 ts viz cvv matlab sfm
GUI:
QT: NO
GTK+: NO
GThread : NO
GtkGlExt: NO
OpenGL support: NO
VTK support: NO
Media I/O:
ZLib: /cs/software/anaconda3/lib/libz.so (ver 1.2.8)
JPEG: /cs/software/anaconda3/lib/libjpeg.so (ver 80)
WEBP: build (ver 0.3.1)
PNG: /cs/software/anaconda3/lib/libpng.so (ver 1.6.27)
TIFF: /cs/software/anaconda3/lib/libtiff.so (ver 42 - 4.0.6)
JPEG 2000: build (ver 1.900.1)
OpenEXR: build (ver 1.7.1)
GDAL: NO
Video I/O:
DC1394 1.x: NO
DC1394 2.x: NO
FFMPEG: NO
codec: NO
format: NO
util: NO
swscale: NO
resample: NO
gentoo-style: NO
GStreamer: NO
OpenNI: NO
OpenNI PrimeSensor Modules: NO
OpenNI2: NO
PvAPI: NO
GigEVisionSDK: NO
UniCap: NO
UniCap ucil: NO
V4L/V4L2: YES/YES
XIMEA: NO
Xine: NO
gPhoto2: NO
Parallel framework: OpenMP
Other third-party libraries:
Use IPP: 9.0.1 [9.0.1]
at: /opt/conda/conda-bld/opencv_1491943704081/work/opencv-3.1.0/3rdparty/ippicv/unpack/ippicv_lnx
Use IPP Async: NO
Use VA: NO
Use Intel VA-API/OpenCL: NO
Use Eigen: YES (ver 3.2.8)
Use Cuda: NO
Use OpenCL: NO
Use custom HAL: NO
Python 2:
Interpreter: (ver 3.5.3)
Python 3:
Interpreter: /cs/software/anaconda3/bin/python (ver 3.5.3)
Libraries: /cs/software/anaconda3/lib/libpython3.5m.so (ver 3.5.3)
numpy: /cs/software/anaconda3/lib/python3.5/site-packages/numpy/core/include (ver 1.12.1)
packages path: /cs/software/anaconda3/lib/python3.5/site-packages
Python (for build):
Java:
ant: NO
JNI: NO
Java wrappers: NO
Java tests: NO
Matlab: NO
Tests and samples:
Tests: NO
Performance tests: NO
C/C++ Examples: NO
Install path: /cs/software/anaconda3
cvconfig.h is in: /opt/conda/conda-bld/opencv_1491943704081/work/opencv-3.1.0/build
-----------------------------------------------------------------UPDATE: tried .avi and .flv formats and the same problem!