
Recherche avancée
Médias (1)
-
Bug de détection d’ogg
22 mars 2013, par
Mis à jour : Avril 2013
Langue : français
Type : Video
Autres articles (16)
-
Librairies et logiciels spécifiques aux médias
10 décembre 2010, parPour un fonctionnement correct et optimal, plusieurs choses sont à prendre en considération.
Il est important, après avoir installé apache2, mysql et php5, d’installer d’autres logiciels nécessaires dont les installations sont décrites dans les liens afférants. Un ensemble de librairies multimedias (x264, libtheora, libvpx) utilisées pour l’encodage et le décodage des vidéos et sons afin de supporter le plus grand nombre de fichiers possibles. Cf. : ce tutoriel ; FFMpeg avec le maximum de décodeurs et (...) -
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 (...) -
Les thèmes de MediaSpip
4 juin 20133 thèmes sont proposés à l’origine par MédiaSPIP. L’utilisateur MédiaSPIP peut rajouter des thèmes selon ses besoins.
Thèmes MediaSPIP
3 thèmes ont été développés au départ pour MediaSPIP : * SPIPeo : thème par défaut de MédiaSPIP. Il met en avant la présentation du site et les documents média les plus récents ( le type de tri peut être modifié - titre, popularité, date) . * Arscenic : il s’agit du thème utilisé sur le site officiel du projet, constitué notamment d’un bandeau rouge en début de page. La structure (...)
Sur d’autres sites (1691)
-
ffmpeg : Could not find tag for codec none in stream #1, codec not currently supported in container
30 avril 2024, par KracozebrI'm trying to record video from my ip camera stream with ffmpeg in command line


fmpeg -rtsp_transport tcp \
> -i rtsp://192.168.0.250/stream1 \
> -c copy \
> -map 0 \
> -f segment \
> -segment_time 60 \
> -segment_format mp4 \
> "/home/video/stream-%010d.mp4"



and got the next output :


ffmpeg version 4.2.4-1ubuntu0.1 Copyright (c) 2000-2020 the FFmpeg developers
 built with gcc 9 (Ubuntu 9.3.0-10ubuntu2)
 configuration: --prefix=/usr --extra-version=1ubuntu0.1 --toolchain=hardened --libdir=/usr/lib/x86_64-linux-gnu --incdir=/usr/include/x86_64-linux-gnu --arch=amd64 --enable-gpl --disable-stripping --enable-avresample --disable-filter=resample --enable-avisynth --enable-gnutls --enable-ladspa --enable-libaom --enable-libass --enable-libbluray --enable-libbs2b --enable-libcaca --enable-libcdio --enable-libcodec2 --enable-libflite --enable-libfontconfig --enable-libfreetype --enable-libfribidi --enable-libgme --enable-libgsm --enable-libjack --enable-libmp3lame --enable-libmysofa --enable-libopenjpeg --enable-libopenmpt --enable-libopus --enable-libpulse --enable-librsvg --enable-librubberband --enable-libshine --enable-libsnappy --enable-libsoxr --enable-libspeex --enable-libssh --enable-libtheora --enable-libtwolame --enable-libvidstab --enable-libvorbis --enable-libvpx --enable-libwavpack --enable-libwebp --enable-libx265 --enable-libxml2 --enable-libxvid --enable-libzmq --enable-libzvbi --enable-lv2 --enable-omx --enable-openal --enable-opencl --enable-opengl --enable-sdl2 --enable-libdc1394 --enable-libdrm --enable-libiec61883 --enable-nvenc --enable-chromaprint --enable-frei0r --enable-libx264 --enable-shared
 libavutil 56. 31.100 / 56. 31.100
 libavcodec 58. 54.100 / 58. 54.100
 libavformat 58. 29.100 / 58. 29.100
 libavdevice 58. 8.100 / 58. 8.100
 libavfilter 7. 57.100 / 7. 57.100
 libavresample 4. 0. 0 / 4. 0. 0
 libswscale 5. 5.100 / 5. 5.100
 libswresample 3. 5.100 / 3. 5.100
 libpostproc 55. 5.100 / 55. 5.100
Input #0, rtsp, from 'rtsp://192.168.0.250/stream1':
 Metadata:
 title : Session streamed by "nessyMediaServer"
 comment : h264
 Duration: N/A, start: 0.000000, bitrate: N/A
 Stream #0:0: Video: h264 (Main), yuvj420p(pc, bt709, progressive), 2048x1536 [SAR 1:1 DAR 4:3], 25 fps, 25 tbr, 90k tbn, 50 tbc
 Stream #0:1: Data: none
[segment @ 0x559e20000980] Opening '/home/video/stream-0000000000.mp4' for writing
[mp4 @ 0x559e1fffc180] Could not find tag for codec none in stream #1, codec not currently supported in container
Could not write header for output file #0 (incorrect codec parameters ?): Invalid argument
Stream mapping:
 Stream #0:0 -> #0:0 (copy)
 Stream #0:1 -> #0:1 (copy)
 Last message repeated 1 times




Tried some different options like
-c:v libx265
or-c:v libx264
but it does not works the output is a little different. But the main error is the same :

Could not find tag for codec none in stream #1, codec not currently supported in container
Could not write header for output file #0 (incorrect codec parameters ?): Invalid argument



UPD : Tried the next command :


ffmpeg -rtsp_transport tcp \
 -i rtsp://192.168.0.250/stream1 \
 -c copy \
 -map 0 \
 -f segment \
 -segment_time 60 \
 -segment_format avi \
 "/home/video/stream-%010d.avi"



It started to record video but with errors :


fmpeg version 4.2.4-1ubuntu0.1 Copyright (c) 2000-2020 the FFmpeg developers
 built with gcc 9 (Ubuntu 9.3.0-10ubuntu2)
 configuration: --prefix=/usr --extra-version=1ubuntu0.1 --toolchain=hardened --libdir=/usr/lib/x86_64-linux-gnu --incdir=/usr/include/x86_64-linux-gnu --arch=amd64 --enable-gpl --disable-stripping --enable-avresample --disable-filter=resample --enable-avisynth --enable-gnutls --enable-ladspa --enable-libaom --enable-libass --enable-libbluray --enable-libbs2b --enable-libcaca --enable-libcdio --enable-libcodec2 --enable-libflite --enable-libfontconfig --enable-libfreetype --enable-libfribidi --enable-libgme --enable-libgsm --enable-libjack --enable-libmp3lame --enable-libmysofa --enable-libopenjpeg --enable-libopenmpt --enable-libopus --enable-libpulse --enable-librsvg --enable-librubberband --enable-libshine --enable-libsnappy --enable-libsoxr --enable-libspeex --enable-libssh --enable-libtheora --enable-libtwolame --enable-libvidstab --enable-libvorbis --enable-libvpx --enable-libwavpack --enable-libwebp --enable-libx265 --enable-libxml2 --enable-libxvid --enable-libzmq --enable-libzvbi --enable-lv2 --enable-omx --enable-openal --enable-opencl --enable-opengl --enable-sdl2 --enable-libdc1394 --enable-libdrm --enable-libiec61883 --enable-nvenc --enable-chromaprint --enable-frei0r --enable-libx264 --enable-shared
 libavutil 56. 31.100 / 56. 31.100
 libavcodec 58. 54.100 / 58. 54.100
 libavformat 58. 29.100 / 58. 29.100
 libavdevice 58. 8.100 / 58. 8.100
 libavfilter 7. 57.100 / 7. 57.100
 libavresample 4. 0. 0 / 4. 0. 0
 libswscale 5. 5.100 / 5. 5.100
 libswresample 3. 5.100 / 3. 5.100
 libpostproc 55. 5.100 / 55. 5.100
Input #0, rtsp, from 'rtsp://192.168.0.250/stream1':
 Metadata:
 title : Session streamed by "nessyMediaServer"
 comment : h265
 Duration: N/A, start: 0.000000, bitrate: N/A
 Stream #0:0: Video: hevc (Main), yuvj420p(pc, bt709), 2048x1536 [SAR 1:1 DAR 4:3], 25 fps, 25 tbr, 90k tbn, 25 tbc
 Stream #0:1: Data: none
[segment @ 0x562200721d80] Opening '/home/evgeniy/video/stream-0000000000.avi' for writing
Output #0, segment, to '/home/video/stream-%010d.avi':
 Metadata:
 title : Session streamed by "nessyMediaServer"
 comment : h265
 encoder : Lavf58.29.100
 Stream #0:0: Video: hevc (Main), yuvj420p(pc, bt709), 2048x1536 [SAR 1:1 DAR 4:3], q=2-31, 25 fps, 25 tbr, 25 tbn, 25 tbc
 Stream #0:1: Data: none
Stream mapping:
 Stream #0:0 -> #0:0 (copy)
 Stream #0:1 -> #0:1 (copy)
Press [q] to stop, [?] for help
[segment @ 0x562200721d80] Timestamps are unset in a packet for stream 0. This is deprecated and will stop working in the future. Fix your code to set the timestamps properly
[segment @ 0x562200721d80] Non-monotonous DTS in output stream 0:0; previous: 202, current: 202; changing to 203. This may result in incorrect timestamps in the output file.
...
[segment @ 0x562200721d80] Non-monotonous DTS in output stream 0:0; previous: 748, current: 748; changing to 749. This may result in incorrect timestamps in the output file.
[segment @ 0x562200721d80] Opening '/home/video/stream-0000000001.avi' for writing
[avi @ 0x56220077d800] Too large number of skipped frames 5417887 > 6000001x 
av_interleaved_write_frame(): Invalid argument
[avi @ 0x56220077d800] Too large number of skipped frames 5407879 > 60000
frame= 1505 fps= 25 q=-1.0 Lsize=N/A time=00:01:00.24 bitrate=N/A speed=1.01x 
video:5314kB audio:0kB subtitle:0kB other streams:359kB global headers:0kB muxing overhead: unknown
Conversion failed!




-
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();
```