
Recherche avancée
Médias (2)
-
GetID3 - Bloc informations de fichiers
9 avril 2013, par
Mis à jour : Mai 2013
Langue : français
Type : Image
-
GetID3 - Boutons supplémentaires
9 avril 2013, par
Mis à jour : Avril 2013
Langue : français
Type : Image
Autres articles (7)
-
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" ; -
Déploiements possibles
31 janvier 2010, parDeux types de déploiements sont envisageable dépendant de deux aspects : La méthode d’installation envisagée (en standalone ou en ferme) ; Le nombre d’encodages journaliers et la fréquentation envisagés ;
L’encodage de vidéos est un processus lourd consommant énormément de ressources système (CPU et RAM), il est nécessaire de prendre tout cela en considération. Ce système n’est donc possible que sur un ou plusieurs serveurs dédiés.
Version mono serveur
La version mono serveur consiste à n’utiliser qu’une (...) -
Menus personnalisés
14 novembre 2010, parMediaSPIP utilise le plugin Menus pour gérer plusieurs menus configurables pour la navigation.
Cela permet de laisser aux administrateurs de canaux la possibilité de configurer finement ces menus.
Menus créés à l’initialisation du site
Par défaut trois menus sont créés automatiquement à l’initialisation du site : Le menu principal ; Identifiant : barrenav ; Ce menu s’insère en général en haut de la page après le bloc d’entête, son identifiant le rend compatible avec les squelettes basés sur Zpip ; (...)
Sur d’autres sites (3768)
-
ffmpeg command not interpreted correcly from cron
16 avril 2022, par Andre Lörchneron my raspberry pi I'm trying to run a script every 30 minutes that restarts a video stream. Reason is the stream is consistently running into hickups after roughly 35 minutes and stops a few minutes after.
I tried fixing the root problem without any success so far, so an easier and valid workaround is to just restart the stream.


I created a script
restart_stream.sh
that kills the previous stream and immediately starts it again.

#!/bin/bash

killall -r libcamera-vid ffmpeg
libcamera-vid -t 0 --framerate 30 --width 1280 --height 720 -b 2000000 -o - --nopreview | ffmpeg -f h264 -thread_queue_size 4096 -i - -f pulse -ar 44100 -ac 2 -acodec pcm_s16le -thread_queue_size 4096 -i default -vcodec copy -acodec aac -ab 128k -fflags genpts -fflags igndts -f fifo -fifo_format flv -map 0:v -map 1:a? -drop_pkts_on_overflow 1 -attempt_recovery 1 -recovery_wait_time 2 rtmp://a.rtmp.youtube.com/live2/<key>
</key>


cron job


*/30 7-19 * * * /bin/restart_stream.sh >/tmp/stream.log 2>&1



Running this script manually from the ssh console works perfectly fine but once I run it from cron it fails with the following error


[1:41:01.657471459] [2138] INFO RPI raspberrypi.cpp:1326 Registered camera /base/soc/i2c0mux/i2c@1/ov5647@36 to Unic>
[1:41:01.658232799] [2136] INFO Camera camera.cpp:1028 configuring streams: (0) 1280x720-YUV420
[1:41:01.659060988] [2138] INFO RPI raspberrypi.cpp:747 Sensor: /base/soc/i2c0mux/i2c@1/ov5647@36 - Selected sensor >
[1:41:01.698525343] [2145] INFO IPARPI raspberrypi.cpp:626 Request ctrl: Saturation = 1.000000
[1:41:01.698798789] [2145] INFO IPARPI raspberrypi.cpp:626 Request ctrl: Contrast = 1.000000
[1:41:01.698840990] [2145] INFO IPARPI raspberrypi.cpp:626 Request ctrl: Brightness = 0.000000
[1:41:01.698877617] [2145] INFO IPARPI raspberrypi.cpp:626 Request ctrl: AwbMode = 0
[1:41:01.698910745] [2145] INFO IPARPI raspberrypi.cpp:626 Request ctrl: Sharpness = 1.000000
[1:41:01.698947187] [2145] INFO IPARPI raspberrypi.cpp:626 Request ctrl: ExposureValue = 0.000000
[1:41:01.698983203] [2145] INFO IPARPI raspberrypi.cpp:626 Request ctrl: AeExposureMode = 0
[1:41:01.699014646] [2145] INFO IPARPI raspberrypi.cpp:626 Request ctrl: FrameDurationLimits = [ 33333, 33333 ]
[1:41:01.699050903] [2145] INFO IPARPI raspberrypi.cpp:626 Request ctrl: AeMeteringMode = 0
[1:41:01.699082938] [2145] INFO IPARPI raspberrypi.cpp:626 Request ctrl: NoiseReductionMode = 1
ffmpeg version 4.3.3-0+rpt2+deb11u1 Copyright (c) 2000-2021 the FFmpeg developers
 built with gcc 10 (Raspbian 10.2.1-6+rpi1)
 configuration: --prefix=/usr --extra-version=0+rpt2+deb11u1 --toolchain=hardened --incdir=/usr/include/arm-linux-gn>
 WARNING: library configuration mismatch
 avutil configuration: --prefix=/usr --extra-version=0+rpt2+deb11u1 --toolchain=hardened --incdir=/usr/include/>
 avcodec configuration: --prefix=/usr --extra-version=0+rpt2+deb11u1 --toolchain=hardened --incdir=/usr/include/>
 avformat configuration: --prefix=/usr --extra-version=0+rpt2+deb11u1 --toolchain=hardened --incdir=/usr/include/>
 avdevice configuration: --prefix=/usr --extra-version=0+rpt2+deb11u1 --toolchain=hardened --incdir=/usr/include/>
 avfilter configuration: --prefix=/usr --extra-version=0+rpt2+deb11u1 --toolchain=hardened --incdir=/usr/include/>
 avresample configuration: --prefix=/usr --extra-version=0+rpt2+deb11u1 --toolchain=hardened --incdir=/usr/include/>
 swscale configuration: --prefix=/usr --extra-version=0+rpt2+deb11u1 --toolchain=hardened --incdir=/usr/include/>
 swresample configuration: --prefix=/usr --extra-version=0+rpt2+deb11u1 --toolchain=hardened --incdir=/usr/include/>
 postproc configuration: --prefix=/usr --extra-version=0+rpt2+deb11u1 --toolchain=hardened --incdir=/usr/include/>
 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
 libavresample 4. 0. 0 / 4. 0. 0
 libswscale 5. 7.100 / 5. 7.100
 libswresample 3. 7.100 / 3. 7.100
 libpostproc 55. 7.100 / 55. 7.100
Input #0, h264, from 'pipe:':
 Duration: N/A, bitrate: N/A
 Stream #0:0: Video: h264 (High), yuv420p(progressive), 1280x720, 30 fps, 30 tbr, 1200k tbn, 60 tbc
default: No such process



It seems to interpret the command differently and not treat
default
within the ffmpeg call as a parameter.

-
FFmpeg return 'invalid argument' only for some runs, even though it is the same code
20 septembre 2021, par Gustavo MarinhoI have code in Python where I need to use FFmpeg to merge an audio and a video downloaded using pytube together :


for video in p.videos:
 video.streams.filter(file_extension='mp4',resolution='480p')[0].download(parent_dir+'/mp4/processing/video')
 print(video.streams.filter(only_audio=True)[1].download(parent_dir+'/mp4/processing/audio'))

 subprocess.run([

 r'c:\FFmpeg\bin\ffmpeg', '-i',
 os.path.join(parent_dir+'/mp4/processing/video',video.streams.filter(file_extension='mp4',resolution='480p')[0].default_filename)
 ,'-i',
 os.path.join(parent_dir+'/mp4/processing/audio',video.streams.filter(only_audio=True)[1].default_filename),
 '-c:v','copy','-c:a','copy',
 os.path.join(parent_dir+'/mp4',video.streams.filter(file_extension='mp4',resolution='480p')[0].title+'.mp4')

 ])



I thought the code was working perfectly, but in some cases, the FFmpeg returns "invalid argument", like this example :


ffmpeg version 4.4-full_build-www.gyan.dev Copyright (c) 2000-2021 the FFmpeg developers
 built with gcc 10.2.0 (Rev6, Built by MSYS2 project)
 configuration: --enable-gpl --enable-version3 --enable-static --disable-w32threads --disable-autodetect --enable-fontconfig --enable-iconv --enable-gnutls --enable-libxml2 --enable-gmp --enable-lzma --enable-libsnappy --enable-zlib --enable-librist --enable-libsrt --enable-libssh --enable-libzmq --enable-avisynth --enable-libbluray --enable-libcaca --enable-sdl2 --enable-libdav1d --enable-libzvbi --enable-librav1e --enable-libsvtav1 --enable-libwebp --enable-libx264 --enable-libx265 --enable-libxvid --enable-libaom --enable-libopenjpeg --enable-libvpx --enable-libass --enable-frei0r --enable-libfreetype --enable-libfribidi --enable-libvidstab --enable-libvmaf --enable-libzimg --enable-amf --enable-cuda-llvm --enable-cuvid --enable-ffnvcodec --enable-nvdec --enable-nvenc --enable-d3d11va --enable-dxva2 --enable-libmfx --enable-libglslang --enable-vulkan --enable-opencl --enable-libcdio --enable-libgme --enable-libmodplug --enable-libopenmpt --enable-libopencore-amrwb --enable-libmp3lame --enable-libshine --enable-libtheora --enable-libtwolame --enable-libvo-amrwbenc --enable-libilbc --enable-libgsm --enable-libopencore-amrnb --enable-libopus --enable-libspeex --enable-libvorbis --enable-ladspa --enable-libbs2b --enable-libflite --enable-libmysofa --enable-librubberband --enable-libsoxr --enable-chromaprint
 libavutil 56. 70.100 / 56. 70.100
 libavcodec 58.134.100 / 58.134.100
 libavformat 58. 76.100 / 58. 76.100
 libavdevice 58. 13.100 / 58. 13.100
 libavfilter 7.110.100 / 7.110.100
 libswscale 5. 9.100 / 5. 9.100
 libswresample 3. 9.100 / 3. 9.100
 libpostproc 55. 9.100 / 55. 9.100
Input #0, mov,mp4,m4a,3gp,3g2,mj2, from 'D:/videos/mp4/processing/video\Dropkick Murphys - Rose Tattoo (Video).mp4':
 Metadata:
 major_brand : dash
 minor_version : 0
 compatible_brands: iso6avc1mp41
 creation_time : 2020-04-04T10:16:52.000000Z
 Duration: 00:05:26.08, start: 0.000000, bitrate: 557 kb/s
 Stream #0:0(und): Video: h264 (Main) (avc1 / 0x31637661), yuv420p(tv, bt709, progressive), 854x480 [SAR 1:1 DAR 427:240], 7 kb/s, 23.98 fps, 23.98 tbr, 24k tbn, 47.95 tbc (default)
 Metadata:
 creation_time : 2020-04-04T10:16:52.000000Z
 handler_name : ISO Media file produced by Google Inc.
 vendor_id : [0][0][0][0]
Input #1, mov,mp4,m4a,3gp,3g2,mj2, from 'D:/videos/mp4/processing/audio\Dropkick Murphys - Rose Tattoo (Video).mp4':
 Metadata:
 major_brand : dash
 minor_version : 0
 compatible_brands: iso6mp41
 creation_time : 2020-04-04T10:16:00.000000Z
 Duration: 00:05:26.12, start: 0.000000, bitrate: 129 kb/s
 Stream #1:0(eng): Audio: aac (LC) (mp4a / 0x6134706D), 44100 Hz, stereo, fltp, 3 kb/s (default)
 Metadata:
 creation_time : 2020-04-04T10:16:00.000000Z
 handler_name : ISO Media file produced by Google Inc.
 vendor_id : [0][0][0][0]
D:/videos/mp4\Dropkick Murphys - "Rose Tattoo" (Video).mp4: Invalid argument



For some reason, the FFmpeg say that my output name is invalid, but I don't understand why, given that I ran the code multiple times before and it worked perfectly.


-
Where are there working exdamples for QSV enabled ffmpeg filters ?
2 août 2021, par Bart LedermanI'm re-posting this question in a modified form because I'm told that stack overflow doesn't allow anyone to ask for the location of documentation. So now I'm not asking for documentation, I just want working examples of how the QSV enabled filters are used, with a specific question on why async doesn't work with vpp_qsv .


I have a PC running Windows which is QSV capable. I've found the codec and at least one QSV filter which really speed up decoding and encoding AVC (x264) videos.


But the experience is extremely aggravating, as I cannot find a list anywhere that I can find on what the filters and arguments actually are.


The closest I've come for vpp_qsv is this :


https://github.com/FFmpeg/FFmpeg/blob/master/libavfilter/vf_vpp_qsv.c


It's a good start, but it has no examples of what the arguments actually are.
Source code doesn't explain how the filters actually work. However, this source code does say that async_depth is a valid qualifier.


The few examples I've been able to find in various places (including stackoverflow) do not work.


By experimentation, I've found that this works :


ffmpeg -hide_banner -init_hw_device qsv=qsv -hwaccel qsv -i "input.mts" -c:a aac -c:v h264_qsv -preset veryslow -vf "vpp_qsv=cw=628:cx=0:w=640:h=480" -q:v 30 "output.mp4"


I can add other things to the filter. For example :


"vpp_qsv=deinterlace=2:cw=628:cx=0:w=640:h=480"


will work. However, this will NOT work :


"vpp_qsv=cw=628:cx=0:w=640:h=480:async_depth=4"


even though there are examples posted that say it will.


[Parsed_vpp_qsv_0 @ 0000000005bff8c0] Option 'async_depth' not found [AVFilterGraph @ 0000000007327dc0] Error initializing filter 'vpp_qsv' with args 'cw=628:cx=0:w=640:h=480:async_depth=4' Error reinitializing filters ! Failed to inject frame into filter network : Option not found Error while processing the decoded data for stream #0:0


I also have been unable to find good examples of using more than one QSV enabled filter at the same time.


I'm using the newest version of ffmpeg I can find :


I :\ffmpeg -version ffmpeg version 4.4-full_build-www.gyan.dev Copyright (c) 2000-2021 the FFmpeg developers built with gcc 10.2.0 (Rev6, Built by MSYS2 project) configuration : —enable-gpl —enable-version3 —enable-static —disable-w32threads —disable-autodetect —enable-fontconfig —enable-iconv —enable-gnutls —enable-libxml 2 —enable-gmp —enable-lzma —enable-libsnappy —enable-zlib —enable-librist —enable-libsrt —enable-libssh —enable-libzmq —enable-avisynth —enable-libbluray —enab le-libcaca —enable-sdl2 —enable-libdav1d —enable-libzvbi —enable-librav1e —enable-libsvtav1 —enable-libwebp —enable-libx264 —enable-libx265 —enable-libxvid —ena ble-libaom —enable-libopenjpeg —enable-libvpx —enable-libass —enable-frei0r —enable-libfreetype —enable-libfribidi —enable-libvidstab —enable-libvmaf —enable-lib zimg —enable-amf —enable-cuda-llvm —enable-cuvid —enable-ffnvcodec —enable-nvdec —enable-nvenc —enable-d3d11va —enable-dxva2 —enable-libmfx —enable-libglslang - -enable-vulkan —enable-opencl —enable-libcdio —enable-libgme —enable-libmodplug —enable-libopenmpt —enable-libopencore-amrwb —enable-libmp3lame —enable-libshine - -enable-libtheora —enable-libtwolame —enable-libvo-amrwbenc —enable-libilbc —enable-libgsm —enable-libopencore-amrnb —enable-libopus —enable-libspeex —enable-libv orbis —enable-ladspa —enable-libbs2b —enable-libflite —enable-libmysofa —enable-librubberband —enable-libsoxr —enable-chromaprint libavutil 56. 70.100 / 56. 70.100 libavcodec 58.134.100 / 58.134.100 libavformat 58. 76.100 / 58. 76.100 libavdevice 58. 13.100 / 58. 13.100 libavfilter 7.110.100 / 7.110.100 libswscale 5. 9.100 / 5. 9.100 libswresample 3. 9.100 / 3. 9.100 libpostproc 55. 9.100 / 55. 9.100


and the output of "ffmpeg -filters" says I have the various QSV enabled filters on my system.


I have searched dozens and dozens of sites including Intel and ffmpeg.org and I cannot find a clear explanation of how the various QSV enabled filters work, with examples that will actually execute on my system. Could someone please point me to where this filter is explained ? (This is NOT, I repeat, NOT a banned request for documentation. I'm asking how to use a specific qualifier in a specific filter.)