
Recherche avancée
Médias (1)
-
Sintel MP4 Surround 5.1 Full
13 mai 2011, par
Mis à jour : Février 2012
Langue : English
Type : Video
Autres articles (72)
-
Personnaliser en ajoutant son logo, sa bannière ou son image de fond
5 septembre 2013, parCertains 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 ;
-
Websites made with MediaSPIP
2 mai 2011, parThis page lists some websites based on MediaSPIP.
-
Publier sur MédiaSpip
13 juin 2013Puis-je poster des contenus à partir d’une tablette Ipad ?
Oui, si votre Médiaspip installé est à la version 0.2 ou supérieure. Contacter au besoin l’administrateur de votre MédiaSpip pour le savoir
Sur d’autres sites (9834)
-
FFmpeg streaming stuck few minutes after start [closed]
19 février, par josue ramirezSorry for my english ! :D


I'm trying to make a live video stream from my webcam with ffmpeg using Node.


I get the images or frames from ffmpeg via pipe1 on the stdout event and send them via a socket-io client to my angular app to play the stream.


So far the stream starts fine and my angular app can play it fine, but after a certain time (8 minutes or so) ffmpeg stops sending data and the stream in my angular app stops and if I want to start the webcam again it's not possible anymore because it's apparently occupied by another process. I've been trying to figure out what's going on and what I've noticed is that the ffmpeg process just stops and the process is no longer visible with the
top
command (ubuntu), but the child process in node still shows a ffmpeg process as if it were a zombie process.

I've tried running ffmpeg from the terminal to save an mp4 file with the stream and in that case there is no problem, the recording doesn't stop even using pipe1. Only when I run ffmpeg from my Node app, the error occurs.


Does anyone have any idea what could be going on ?


This command is the one that is executed to send the data through pipe1 both from node and from the terminal but it only stops in Node


ffmpeg -f v4l2 -input_format mjpeg -video_size 800x600 -i /dev/video0 -q:v 4 -f image2pipe pipe1



The same thing happens when saving an mp4 video only in Node it fails


ffmpeg -f v4l2 -input_format mjpeg -video_size 800x600 -i /dev/video0 -q:v 4 video.mp4



This is my function that starts the streaming


export const startCamera = () => {
 logger.info('Starting camera ', cameraName);

 const inputFormat = process.platform === 'win32' ? 'dshow' : 'v4l2';

 const ffmpegArgs = [
 '-f', inputFormat, // Formato de entrada según la plataforma
 ];

 if (process.platform === 'linux') {
 ffmpegArgs.push(
 '-input_format', 'mjpeg', // Especificar el formato antes de video_size
 '-video_size', '800x600', // Tamaño de la imagen
 );
 }
 
 ffmpegArgs.push(
 '-i', cameraName, // Dispositivo de entrada
 '-vf', 'fps=15', // Fotogramas por segundo
 '-q:v', '10', // Calidad de video
 '-f', 'image2pipe', // Formato de salida
 'pipe:1' // Salida por stdout
 );

 try {
 logger.info('FFmpeg command: ffmpeg', ffmpegArgs.join(' '));
 ffmpeg = spawn('ffmpeg', ffmpegArgs);
 let cameraOpen = false;
 // Enviar los datos del fotograma a través del WebSocket
 ffmpeg.stdout.on('data', (chunk) => {
 logger.debug(`Sending chunk of ${chunk.length} bytes`);
 if (!cameraOpen) {
 cameraOpen = true;
 serialConnection.connect();
 logger.info('Camera started!!');
 }

 if (streamWS.isActive()) {
 streamWS.send(chunk);
 }
 });
 // Manejo de errores
 ffmpeg.stderr.on('error', (data) => {
 logger.error('FFmpeg Error:', data.toString());
 });

 ffmpeg.on('close', async () => {
 logger.info('Camera closed....', cameraName);
 if (!cameraOpen) {
 await commandWS.send(
 {
 command: COMMANDS.START_STREAM,
 isError: true,
 response: `Error al intentar iniciar la camara ${cameraName}, verificar que la camara se encuentre bien conectada.`,
 },
 COMMANDS_EVENTS.ROBOT_RESPONSE
 );
 }
 cameraOpen = false;
 await serialConnection.close();
 stopCamera();
 await streamWS.disconnectWS();
 });
 } catch (e) {
 logger.error('Error tryng to start the camera...', e);
 }
};



-
XABE : One or more errors occurred (FFmpeg)
22 mars 2021, par A FarmanbarI am trying to build video from images by below piece of code :


FFmpeg.SetExecutablesPath(dir);
FFmpeg.Conversions.New()
 .BuildVideoFromImages(files)
 .SetInputFrameRate(_video.Fps)
 .SetFrameRate(_video.Fps)
 .SetPixelFormat(PixelFormat.bgr24)
 .SetOutput(dir + "\\output.mp4").Start().Wait();



but I get below error


System.AggregateException: One or more errors occurred. (ffmpeg version n4.3.2-160-gfbb9368226 Copyright (c) 2000-2021 the FFmpeg developers
 built with gcc 9.3-win32 (GCC) 20200320
 configuration: --prefix=/ffbuild/prefix --pkg-config-flags=--static --pkg-config=pkg-config --cross-prefix=x86_64-w64-mingw32- --arch=x86_64 --target-os=mingw32 --enable-gpl --enable-version3 --disable-debug --disable-w32threads --enable-pthreads --enable-iconv --enable-zlib --enable-libxml2 --enable-libfreetype --enable-libfribidi --enable-gmp --enable-lzma --enable-fontconfig --enable-opencl --enable-libvmaf --disable-vulkan --enable-libvorbis --enable-amf --enable-libaom --enable-avisynth --enable-libdav1d --enable-libdavs2 --enable-ffnvcodec --enable-cuda-llvm --disable-libglslang --enable-libgme --enable-libass --enable-libbluray --enable-libmp3lame --enable-libopus --enable-libtheora --enable-libvpx --enable-libwebp --enable-lv2 --enable-libmfx --enable-libopencore-amrnb --enable-libopencore-amrwb --enable-libopenjpeg --enable-librav1e --enable-librubberband --enable-schannel --enable-sdl2 --enable-libsoxr --enable-libsrt --enable-libtwolame --enable-libvidstab --enable-libx264 --enable-libx265 --enable-libxavs2 --enable-libxvid --enable-libzimg --extra-cflags=-DLIBTWOLAME_STATIC --extra-cxxflags= --extra-ldflags=-pthread --extra-libs=-lgomp
 libavutil 56. 51.100 / 56. 51.100
 libavcodec 58. 91.100 / 58. 91.100
 libavformat 58. 45.100 / 58. 45.100
 libavdevice 58. 10.100 / 58. 10.100
 libavfilter 7. 85.100 / 7. 85.100
 libswscale 5. 7.100 / 5. 7.100
 libswresample 3. 7.100 / 3. 7.100
 libpostproc 55. 7.100 / 55. 7.100
[mjpeg @ 0000018b7067a780] bits 217 is invalid
[mjpeg @ 0000018b7067a780] bits 253 is invalid
[mjpeg @ 0000018b7067a780] bits 159 is invalid
[mjpeg @ 0000018b7067a780] bits 234 is invalid
[mjpeg @ 0000018b7067a780] unable to decode APP fields: Invalid data found when processing input
 Last message repeated 2 times
[mjpeg @ 0000018b7067a780] Found EOI before any SOF, ignoring
[mjpeg @ 0000018b7067a780] unable to decode APP fields: Invalid data found when processing input
 Last message repeated 1 times
[mjpeg @ 0000018b7067a780] No JPEG data found in image
[mjpeg @ 0000018b7067a780] bits 95 is invalid
[mjpeg @ 0000018b7067a780] Found EOI before any SOF, ignoring
[mjpeg @ 0000018b7067a780] bits 133 is invalid
[mjpeg @ 0000018b7067a780] bits 31 is invalid
[mjpeg @ 0000018b7067a780] dqt: invalid precision
[mjpeg @ 0000018b7067a780] unable to decode APP fields: Invalid data found when processing input
 Last message repeated 8 times
[mjpeg @ 0000018b7067a780] No JPEG data found in image
[mjpeg @ 0000018b7067a780] Found EOI before any SOF, ignoring
[mjpeg @ 0000018b7067a780] bits 105 is invalid
[image2 @ 0000018b72294f80] decoding for stream 0 failed
[image2 @ 0000018b72294f80] Could not find codec parameters for stream 0 (Video: mjpeg (Progressive), none(bt470bg/unknown/unknown), lossless): unspecified size
Consider increasing the value for the 'analyzeduration' and 'probesize' options
Input #0, image2, from 'C:\Users\a\AppData\Local\Temp\79b5fa99-f5a5-4788-b126-ef1549eb2086\img_%03d.jpg':
 Duration: 00:00:00.38, start: 0.000000, bitrate: N/A
 Stream #0:0: Video: mjpeg (Progressive), none(bt470bg/unknown/unknown), lossless, 29 fps, 29 tbr, 29 tbn, 29 tbc
File 'C:\Users\a\source\repos\ConsoleApp1\ConsoleApp1\bin\Debug\net5.0\output.mp4' already exists. Exiting.)
 ---> Xabe.FFmpeg.Exceptions.ConversionException: ffmpeg version n4.3.2-160-gfbb9368226 Copyright (c) 2000-2021 the FFmpeg developers
 built with gcc 9.3-win32 (GCC) 20200320
 configuration: --prefix=/ffbuild/prefix --pkg-config-flags=--static --pkg-config=pkg-config --cross-prefix=x86_64-w64-mingw32- --arch=x86_64 --target-os=mingw32 --enable-gpl --enable-version3 --disable-debug --disable-w32threads --enable-pthreads --enable-iconv --enable-zlib --enable-libxml2 --enable-libfreetype --enable-libfribidi --enable-gmp --enable-lzma --enable-fontconfig --enable-opencl --enable-libvmaf --disable-vulkan --enable-libvorbis --enable-amf --enable-libaom --enable-avisynth --enable-libdav1d --enable-libdavs2 --enable-ffnvcodec --enable-cuda-llvm --disable-libglslang --enable-libgme --enable-libass --enable-libbluray --enable-libmp3lame --enable-libopus --enable-libtheora --enable-libvpx --enable-libwebp --enable-lv2 --enable-libmfx --enable-libopencore-amrnb --enable-libopencore-amrwb --enable-libopenjpeg --enable-librav1e --enable-librubberband --enable-schannel --enable-sdl2 --enable-libsoxr --enable-libsrt --enable-libtwolame --enable-libvidstab --enable-libx264 --enable-libx265 --enable-libxavs2 --enable-libxvid --enable-libzimg --extra-cflags=-DLIBTWOLAME_STATIC --extra-cxxflags= --extra-ldflags=-pthread --extra-libs=-lgomp
 libavutil 56. 51.100 / 56. 51.100
 libavcodec 58. 91.100 / 58. 91.100
 libavformat 58. 45.100 / 58. 45.100
 libavdevice 58. 10.100 / 58. 10.100
 libavfilter 7. 85.100 / 7. 85.100
 libswscale 5. 7.100 / 5. 7.100
 libswresample 3. 7.100 / 3. 7.100
 libpostproc 55. 7.100 / 55. 7.100
[mjpeg @ 0000018b7067a780] bits 217 is invalid
[mjpeg @ 0000018b7067a780] bits 253 is invalid
[mjpeg @ 0000018b7067a780] bits 159 is invalid
[mjpeg @ 0000018b7067a780] bits 234 is invalid
[mjpeg @ 0000018b7067a780] unable to decode APP fields: Invalid data found when processing input
 Last message repeated 2 times
[mjpeg @ 0000018b7067a780] Found EOI before any SOF, ignoring
[mjpeg @ 0000018b7067a780] unable to decode APP fields: Invalid data found when processing input
 Last message repeated 1 times
[mjpeg @ 0000018b7067a780] No JPEG data found in image
[mjpeg @ 0000018b7067a780] bits 95 is invalid
[mjpeg @ 0000018b7067a780] Found EOI before any SOF, ignoring
[mjpeg @ 0000018b7067a780] bits 133 is invalid
[mjpeg @ 0000018b7067a780] bits 31 is invalid
[mjpeg @ 0000018b7067a780] dqt: invalid precision
[mjpeg @ 0000018b7067a780] unable to decode APP fields: Invalid data found when processing input
 Last message repeated 8 times
[mjpeg @ 0000018b7067a780] No JPEG data found in image
[mjpeg @ 0000018b7067a780] Found EOI before any SOF, ignoring
[mjpeg @ 0000018b7067a780] bits 105 is invalid
[image2 @ 0000018b72294f80] decoding for stream 0 failed
[image2 @ 0000018b72294f80] Could not find codec parameters for stream 0 (Video: mjpeg (Progressive), none(bt470bg/unknown/unknown), lossless): unspecified size
Consider increasing the value for the 'analyzeduration' and 'probesize' options
Input #0, image2, from 'C:\Users\a\AppData\Local\Temp\79b5fa99-f5a5-4788-b126-ef1549eb2086\img_%03d.jpg':
 Duration: 00:00:00.38, start: 0.000000, bitrate: N/A
 Stream #0:0: Video: mjpeg (Progressive), none(bt470bg/unknown/unknown), lossless, 29 fps, 29 tbr, 29 tbn, 29 tbc
File 'C:\Users\a\source\repos\ConsoleApp1\ConsoleApp1\bin\Debug\net5.0\output.mp4' already exists. Exiting.
 at Xabe.FFmpeg.FFmpegWrapper.<>c__DisplayClass11_0.<runprocess>b__0()
 at System.Threading.Tasks.Task`1.InnerInvoke()
 at System.Threading.Tasks.Task.<>c.<.cctor>b__277_0(Object obj)
 at System.Threading.ExecutionContext.RunInternal(ExecutionContext executionContext, ContextCallback callback, Object state)
--- End of stack trace from previous location ---
 at System.Threading.ExecutionContext.RunInternal(ExecutionContext executionContext, ContextCallback callback, Object state)
 at System.Threading.Tasks.Task.ExecuteWithThreadLocal(Task& currentTaskSlot, Thread threadPoolThread)
--- End of stack trace from previous location ---
 at Xabe.FFmpeg.Conversion.Start(String parameters, CancellationToken cancellationToken)
 --- End of inner exception stack trace ---
 at System.Threading.Tasks.Task.Wait(Int32 millisecondsTimeout, CancellationToken cancellationToken)
 at System.Threading.Tasks.Task.Wait()
 at ConsoleApp1.Program.Main(String[] args) in C:\Users\a\source\repos\ConsoleApp1\ConsoleApp1\Program.cs:line 79
</runprocess>


-
Error importing VideoFileClip from moviepy : AttributeError : 'PermissionError' object has no attribute 'message'
11 mars 2017, par TahlilI’m using jupyter notebook. I have also tried from anaconda console as well.
Tried importing with both the ways shown below
from moviepy.editor import VideoFileClip
from moviepy.video.io.VideoFileClip import VideoFileClipBoth of them gave me same error. Full trace is below
AttributeError Traceback (most recent call last)
in <module>()
6 import glob
7 import math
----> 8 from moviepy.editor import VideoFileClip
9 from moviepy.video.io.VideoFileClip import VideoFileClip
C:\Program Files\Anaconda3\lib\site-packages\moviepy\editor.py in <module>()
20 # Clips
21
---> 22 from .video.io.VideoFileClip import VideoFileClip
23 from .video.io.ImageSequenceClip import ImageSequenceClip
24 from .video.io.downloader import download_webfile
C:\Program Files\Anaconda3\lib\site-packages\moviepy\video\io\VideoFileClip.py in <module>()
1 import os
2
----> 3 from moviepy.video.VideoClip import VideoClip
4 from moviepy.audio.io.AudioFileClip import AudioFileClip
5 from moviepy.Clip import Clip
C:\Program Files\Anaconda3\lib\site-packages\moviepy\video\VideoClip.py in <module>()
18
19 import moviepy.audio.io as aio
---> 20 from .io.ffmpeg_writer import ffmpeg_write_image, ffmpeg_write_video
21 from .io.ffmpeg_tools import ffmpeg_merge_video_audio
22 from .io.gif_writers import (write_gif,
C:\Program Files\Anaconda3\lib\site-packages\moviepy\video\io\ffmpeg_writer.py in <module>()
13 DEVNULL = open(os.devnull, 'wb')
14
---> 15 from moviepy.config import get_setting
16 from moviepy.tools import verbose_print
17
C:\Program Files\Anaconda3\lib\site-packages\moviepy\config.py in <module>()
49 success, err = try_cmd([FFMPEG_BINARY])
50 if not success:
---> 51 raise IOError(err.message +
52 "The path specified for the ffmpeg binary might be wrong")
53
AttributeError: 'PermissionError' object has no attribute 'message'
</module></module></module></module></module></module>Python version info
Python 3.5.2 |Anaconda custom (64-bit)| (default, Jul 5 2016, 11:41:13) [MSC v.1900 64 bit (AMD64)] on win32
Type "help", "copyright", "credits" or "license" for more information.Running ffmpeg -version in a console gives me
ffmpeg version N-83507-g8fa18e0 Copyright (c) 2000-2017 the FFmpeg developers
built with gcc 5.4.0 (GCC)
configuration: --enable-gpl --enable-version3 --enable-cuda --enable-cuvid --enable-d3d11va --enable-dxva2 --enable-libmfx --enable-nvenc --enable-avisynth --enable-bzlib --enable-fontconfig --enable-frei0r --enable-gnutls --enable-iconv --enable-libass --enable-libbluray --enable-libbs2b --enable-libcaca --enable-libfreetype --enable-libgme --enable-libgsm --enable-libilbc --enable-libmodplug --enable-libmp3lame --enable-libopencore-amrnb --enable-libopencore-amrwb --enable-libopenh264 --enable-libopenjpeg --enable-libopus --enable-librtmp --enable-libsnappy --enable-libsoxr --enable-libspeex --enable-libtheora --enable-libtwolame --enable-libvidstab --enable-libvo-amrwbenc --enable-libvorbis --enable-libvpx --enable-libwavpack --enable-libwebp --enable-libx264 --enable-libx265 --enable-libxavs --enable-libxvid --enable-libzimg --enable-lzma --enable-zlib
libavutil 55. 47.100 / 55. 47.100
libavcodec 57. 80.100 / 57. 80.100
libavformat 57. 66.102 / 57. 66.102
libavdevice 57. 2.100 / 57. 2.100
libavfilter 6. 73.100 / 6. 73.100
libswscale 4. 3.101 / 4. 3.101
libswresample 2. 4.100 / 2. 4.100
libpostproc 54. 2.100 / 54. 2.100I’m running 64 bit version of Windows 10.
I can’t find any solution anywhere and its driving me crazy ! Seems like its not finding the ffmpeg binary but I have put it in C :\ffmpeg\bin and added this to path environment variable. Followed the instruction from here.