
Recherche avancée
Autres articles (16)
-
MediaSPIP Init et Diogène : types de publications de MediaSPIP
11 novembre 2010, parÀ l’installation d’un site MediaSPIP, le plugin MediaSPIP Init réalise certaines opérations dont la principale consiste à créer quatre rubriques principales dans le site et de créer cinq templates de formulaire pour Diogène.
Ces quatre rubriques principales (aussi appelées secteurs) sont : Medias ; Sites ; Editos ; Actualités ;
Pour chacune de ces rubriques est créé un template de formulaire spécifique éponyme. Pour la rubrique "Medias" un second template "catégorie" est créé permettant d’ajouter (...) -
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 (...) -
Utilisation et configuration du script
19 janvier 2011, parInformations spécifiques à la distribution Debian
Si vous utilisez cette distribution, vous devrez activer les dépôts "debian-multimedia" comme expliqué ici :
Depuis la version 0.3.1 du script, le dépôt peut être automatiquement activé à la suite d’une question.
Récupération du script
Le script d’installation peut être récupéré de deux manières différentes.
Via svn en utilisant la commande pour récupérer le code source à jour :
svn co (...)
Sur d’autres sites (3352)
-
Moviepy is unable to load video
20 octobre 2024, par AlexUsing python 3.11.10 and moviepy 1.0.3 on ubuntu 24.04.1 (in a VirtualBox 7.1.3 on windows 10) I have problems to load a video clip. The test code is just


from moviepy.editor import VideoFileClip
clip = VideoFileClip("testvideo.ts")



but the error is


Traceback (most recent call last):
 File "/home/alex/.cache/pypoetry/virtualenvs/pypdzug-WqasAXAr-py3.11/lib/python3.11/site-packages/moviepy/video/io/ffmpeg_reader.py", line 285, in ffmpeg_parse_infos
 line = [l for l in lines if keyword in l][index]
 ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~^^^^^^^
IndexError: list index out of range

During handling of the above exception, another exception occurred:

Traceback (most recent call last):
 File "/home/alex/Repos/pypdzug/tester.py", line 5, in <module>
 clip = VideoFileClip("testvideo.ts")
 ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
 File "/home/alex/.cache/pypoetry/virtualenvs/pypdzug-WqasAXAr-py3.11/lib/python3.11/site-packages/moviepy/video/io/VideoFileClip.py", line 88, in __init__
 self.reader = FFMPEG_VideoReader(filename, pix_fmt=pix_fmt,
 ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
 File "/home/alex/.cache/pypoetry/virtualenvs/pypdzug-WqasAXAr-py3.11/lib/python3.11/site-packages/moviepy/video/io/ffmpeg_reader.py", line 35, in __init__
 infos = ffmpeg_parse_infos(filename, print_infos, check_duration,
 ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
 File "/home/alex/.cache/pypoetry/virtualenvs/pypdzug-WqasAXAr-py3.11/lib/python3.11/site-packages/moviepy/video/io/ffmpeg_reader.py", line 289, in ffmpeg_parse_infos
 raise IOError(("MoviePy error: failed to read the duration of file %s.\n"
OSError: MoviePy error: failed to read the duration of file testvideo.ts.
Here are the file infos returned by ffmpeg:

ffmpeg version 4.2.2-static https://johnvansickle.com/ffmpeg/ Copyright (c) 2000-2019 the FFmpeg developers
 built with gcc 8 (Debian 8.3.0-6)
 configuration: --enable-gpl --enable-version3 --enable-static --disable-debug --disable-ffplay --disable-indev=sndio --disable-outdev=sndio --cc=gcc --enable-fontconfig --enable-frei0r --enable-gnutls --enable-gmp --enable-libgme --enable-gray --enable-libaom --enable-libfribidi --enable-libass --enable-libvmaf --enable-libfreetype --enable-libmp3lame --enable-libopencore-amrnb --enable-libopencore-amrwb --enable-libopenjpeg --enable-librubberband --enable-libsoxr --enable-libspeex --enable-libsrt --enable-libvorbis --enable-libopus --enable-libtheora --enable-libvidstab --enable-libvo-amrwbenc --enable-libvpx --enable-libwebp --enable-libx264 --enable-libx265 --enable-libxml2 --enable-libdav1d --enable-libxvid --enable-libzvbi --enable-libzimg
 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
 libswscale 5. 5.100 / 5. 5.100
 libswresample 3. 5.100 / 3. 5.100
 libpostproc 55. 5.100 / 55. 5.100
</module>


It says it failed to read the duration of the file, but the file plays properly (with
mplayer
) andffmpeg -i testvideo.ts
returns

ffmpeg version 6.1.1-3ubuntu5 Copyright (c) 2000-2023 the FFmpeg developers
 built with gcc 13 (Ubuntu 13.2.0-23ubuntu3)
 configuration: --prefix=/usr --extra-version=3ubuntu5 --toolchain=hardened --libdir=/usr/lib/x86_64-linux-gnu --incdir=/usr/include/x86_64-linux-gnu --arch=amd64 --enable-gpl --disable-stripping --disable-omx --enable-gnutls --enable-libaom --enable-libass --enable-libbs2b --enable-libcaca --enable-libcdio --enable-libcodec2 --enable-libdav1d --enable-libflite --enable-libfontconfig --enable-libfreetype --enable-libfribidi --enable-libglslang --enable-libgme --enable-libgsm --enable-libharfbuzz --enable-libmp3lame --enable-libmysofa --enable-libopenjpeg --enable-libopenmpt --enable-libopus --enable-librubberband --enable-libshine --enable-libsnappy --enable-libsoxr --enable-libspeex --enable-libtheora --enable-libtwolame --enable-libvidstab --enable-libvorbis --enable-libvpx --enable-libwebp --enable-libx265 --enable-libxml2 --enable-libxvid --enable-libzimg --enable-openal --enable-opencl --enable-opengl --disable-sndio --enable-libvpl --disable-libmfx --enable-libdc1394 --enable-libdrm --enable-libiec61883 --enable-chromaprint --enable-frei0r --enable-ladspa --enable-libbluray --enable-libjack --enable-libpulse --enable-librabbitmq --enable-librist --enable-libsrt --enable-libssh --enable-libsvtav1 --enable-libx264 --enable-libzmq --enable-libzvbi --enable-lv2 --enable-sdl2 --enable-libplacebo --enable-librav1e --enable-pocketsphinx --enable-librsvg --enable-libjxl --enable-shared
 libavutil 58. 29.100 / 58. 29.100
 libavcodec 60. 31.102 / 60. 31.102
 libavformat 60. 16.100 / 60. 16.100
 libavdevice 60. 3.100 / 60. 3.100
 libavfilter 9. 12.100 / 9. 12.100
 libswscale 7. 5.100 / 7. 5.100
 libswresample 4. 12.100 / 4. 12.100
 libpostproc 57. 3.100 / 57. 3.100
Input #0, mpegts, from 'testvideo.ts':
 Duration: 00:10:10.13, start: 0.133333, bitrate: 3256 kb/s
 Program 1 
 Metadata:
 service_name : 2024-10-04 11:49:49.917
 service_provider: gvos-6.0
 Stream #0:0[0x100]: Video: h264 (High) ([27][0][0][0] / 0x001B), yuv420p(progressive), 1920x1080, 15 fps, 15 tbr, 90k tbn



Here the duration is clearly given to be 10 minutes and 10.13 seconds. So what could be the cause of this error/issue ?


-
I created a Python code to capture live video using FFmpeg, but the output screen only shows noise
16 octobre 2024, par chun3 hyunThe code below is Python code that made my computer screen video capture in real time via ffmpeg.


When I run the code below, it goes well until a new window named 'Captured Frame' is created. But this 'Captured Frame' window doesn't show the full screen of my computer, and the gray screen is generating a lot of noise.


import cv2
import numpy as np
import subprocess

def frame_capture():
 # Set FFmpeg command (capture desired window or area)
 ffmpeg_command = [
 'ffmpeg',
 '-f', 'gdigrab', # Windows screen capture (using gdigrab)
 '-framerate', '30', # Setting the Frame Speed
 '-i', 'desktop', # What to capture (for example, full screen)
 '-pix_fmt', 'bgr0',
 '-vcodec', 'rawvideo', # Video codec settings
 '-tune', 'zerolatency',
 '-an', # Disable audio
 '-sn', # Disable Caption
 '-f', 'rawvideo', '-'
 ]

 # Running the FFmpeg process
 process = subprocess.Popen(ffmpeg_command, stdout=subprocess.PIPE, bufsize=10**8)

 while True:
 # Read Frame from FFmpeg (Resolution Example: 1920x1080)
 raw_frame = process.stdout.read(1920 * 1080 * 3) # 1920x1080 resolution, BGR format
 if not raw_frame:
 break # Shut down the loop when you can no longer receive frames

 # Converting frame data to a numpy array
 frame = np.frombuffer(raw_frame, np.uint8).reshape((1080, 1920, 3))

 # Add frame processing code here
 # Example: Showing a frame on the screen
 cv2.imshow('Captured Frame', frame)

 # Press the 'q' key to end
 if cv2.waitKey(1) & 0xFF == ord('q'):
 break

 # End of process and release of resources
 process.stdout.close()
 process.wait()
 cv2.destroyAllWindows()
frame_capture()



What could I have done wrong ? When I directly input the FFmpeg command in the Windows command prompt(knows as 'cmd') as shown below to save the video (in .mp4 format), I can see that the screen is output normally in the saved file. It seems that FFmpeg itself is installed correctly, but I don't know what the cause is.


hwnd=132554 -pix_fmt yuv420p -vf "scale=iw-mod(iw\,2):ih-mod(ih\,2)" -draw_mouse 1 -t 10 output.mp4



The handle number written above was the handle of the active Chrome window on my computer.


My ffmpeg version is 2024-10-10-git-0f5592cfc7-full_build-www.gyan.dev My Python version is 3.12.4
My Windows version and build are as specified below.
:Windows 11 Home, 10.0.22631


Capturing the computer screen with FFmpeg. I tried it, but the output screen shows only noise.


-
ffmpeg fialing with "could not find coded parameters"
21 octobre 2024, par Angelorunning ffmpeg -i in a C# console app using Process, for certain files, the process gets stuck and runs forever


var oInfo = new ProcessStartInfo("ffmpeg.exe", "-i 176d2819-f1da-44eb-b33b-94eb1448194b.mov");
 oInfo.UseShellExecute = false;
 oInfo.CreateNoWindow = true;
 oInfo.RedirectStandardOutput = true;
 oInfo.RedirectStandardError = true;

 string output = string.Empty;
 StreamReader srOutput = null;

 //run the process
 Process proc = Process.Start(oInfo);
 proc.WaitForExit();
 srOutput = proc.StandardError;
 output = srOutput.ReadToEnd();
 proc.Close();



running from command line


ffmpeg.exe -i 176d2819-f1da-44eb-b33b-94eb1448194b.mov, getting an error as included in the below output


could not find codec parameters for stream 1 (Audio : none (apac / 0x63617061), 48000 Hz, 4 channels, 382 kb/s) : unknown codec
Consider increasing the value for the 'analyzeduration' (0) and 'probesize' (5000000) options
[aist#0:1/none @ 0000029b0e1b0040] Guessed Channel Layout : 4.0
Input #0, mov,mp4,m4a,3gp,3g2,mj2, from '176d2819-f1da-44eb-b33b-94eb1448194b.mov'


ffmpeg version N-117538-g9ce63e65d6-20241015 Copyright (c) 2000-2024 the FFmpeg developers
 built with gcc 14.2.0 (crosstool-NG 1.26.0.120_4d36f27)
 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-libfreetype --enable-libfribidi --enable-gmp --enable-libxml2 --enable-lzma --enable-fontconfig --enable-libharfbuzz --enable-libvorbis --enable-opencl --disable-libpulse --enable-libvmaf --disable-libxcb --disable-xlib --enable-amf --enable-libaom --enable-libaribb24 --enable-avisynth --enable-chromaprint --enable-libdav1d --enable-libdavs2 --enable-libdvdread --enable-libdvdnav --disable-libfdk-aac --enable-ffnvcodec --enable-cuda-llvm --enable-frei0r --enable-libgme --enable-libkvazaar --enable-libaribcaption --enable-libass --enable-libbluray --enable-libjxl --enable-libmp3lame --enable-libopus --enable-librist --enable-libssh --enable-libtheora --enable-libvpx --enable-libwebp --enable-libzmq --enable-lv2 --enable-libvpl --enable-openal --enable-libopencore-amrnb --enable-libopencore-amrwb --enable-libopenh264 --enable-libopenjpeg --enable-libopenmpt --enable-librav1e --enable-librubberband --enable-schannel --enable-sdl2 --enable-libsoxr --enable-libsrt --enable-libsvtav1 --enable-libtwolame --enable-libuavs3d --disable-libdrm --enable-vaapi --enable-libvidstab --enable-vulkan --enable-libshaderc --enable-libplacebo --enable-libvvenc --enable-libx264 --enable-libx265 --enable-libxavs2 --enable-libxvid --enable-libzimg --enable-libzvbi --extra-cflags=-DLIBTWOLAME_STATIC --extra-cxxflags= --extra-libs=-lgomp --extra-ldflags=-pthread --extra-ldexeflags= --cc=x86_64-w64-mingw32-gcc --cxx=x86_64-w64-mingw32-g++ --ar=x86_64-w64-mingw32-gcc-ar --ranlib=x86_64-w64-mingw32-gcc-ranlib --nm=x86_64-w64-mingw32-gcc-nm --extra-version=20241015
 libavutil 59. 43.100 / 59. 43.100
 libavcodec 61. 22.100 / 61. 22.100
 libavformat 61. 9.100 / 61. 9.100
 libavdevice 61. 4.100 / 61. 4.100
 libavfilter 10. 6.100 / 10. 6.100
 libswscale 8. 6.100 / 8. 6.100
 libswresample 5. 4.100 / 5. 4.100
 libpostproc 58. 4.100 / 58. 4.100
[mov,mp4,m4a,3gp,3g2,mj2 @ 000001b447c84e40] Could not find codec parameters for stream 1 (Audio: none (apac / 0x63617061), 48000 Hz, 4 channels, 382 kb/s): unknown codec
Consider increasing the value for the 'analyzeduration' (0) and 'probesize' (5000000) options
[aist#0:1/none @ 000001b44a6bf880] Guessed Channel Layout: 4.0
Input #0, mov,mp4,m4a,3gp,3g2,mj2, from '176d2819-f1da-44eb-b33b-94eb1448194b.mov':
 Metadata:
 major_brand : qt
 minor_version : 0
 compatible_brands: qt
 creation_time : 2024-10-14T07:34:17.000000Z
 com.apple.quicktime.full-frame-rate-playback-intent: 0
 com.apple.quicktime.make: Apple
 com.apple.quicktime.model: iPhone 16 Pro Max
 com.apple.quicktime.software: 18.0.1
 com.apple.quicktime.creationdate: 2024-10-14T16:18:36+1100
 com.apple.photos.originating.signature: AQMNJRMQrKK7im+Kjhixx6TqQyYm
 Duration: 00:00:32.60, start: 0.000000, bitrate: 15064 kb/s
 Stream #0:0[0x1](und): Audio: aac (LC) (mp4a / 0x6134706D), 48000 Hz, stereo, fltp, 130 kb/s (default)
 Metadata:
 creation_time : 2024-10-14T07:34:17.000000Z
 handler_name : Core Media Audio
 vendor_id : [0][0][0][0]
 Stream #0:1[0x2](und): Audio: none (apac / 0x63617061), 48000 Hz, 4.0, 382 kb/s
 Metadata:
 creation_time : 2024-10-14T07:34:17.000000Z
 handler_name : Core Media Audio
 vendor_id : [0][0][0][0]
 Stream #0:2[0x3](und): Video: h264 (High) (avc1 / 0x31637661), yuv420p(tv, bt709, progressive), 1920x1080, 14464 kb/s, 30 fps, 30 tbr, 600 tbn (default)
 Metadata:
 creation_time : 2024-10-14T07:34:17.000000Z
 handler_name : Core Media Video
 vendor_id : [0][0][0][0]
 encoder : H.264
 Stream #0:3[0x4](und): Data: none (mebx / 0x7862656D), 0 kb/s (default)
 Metadata:
 creation_time : 2024-10-14T07:34:17.000000Z
 handler_name : Core Media Metadata
 Stream #0:4[0x5](und): Data: none (mebx / 0x7862656D), 0 kb/s (default)
 Metadata:
 creation_time : 2024-10-14T07:34:17.000000Z
 handler_name : Core Media Metadata
 Stream #0:5[0x6](und): Data: none (mebx / 0x7862656D), 21 kb/s (default)
 Metadata:
 creation_time : 2024-10-14T07:34:17.000000Z
 handler_name : Core Media Metadata
 Stream #0:6[0x7](und): Data: none (mebx / 0x7862656D), 48 kb/s (default)
 Metadata:
 creation_time : 2024-10-14T07:34:17.000000Z
 handler_name : Core Media Metadata
 Stream #0:7[0x8](und): Data: none (mebx / 0x7862656D), 2 kb/s (default)
 Metadata:
 creation_time : 2024-10-14T07:34:17.000000Z
 handler_name : Core Media Metadata
 Stream #0:8[0x9](und): Data: none (mebx / 0x7862656D), 0 kb/s (default)
 Metadata:
 creation_time : 2024-10-14T07:34:17.000000Z
 handler_name : Core Media Metadata



This error does not happen on all files but only on a handful of files.