
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 (6)
-
Les vidéos
21 avril 2011, parComme les documents de type "audio", Mediaspip affiche dans la mesure du possible les vidéos grâce à la balise html5 .
Un des inconvénients de cette balise est qu’elle n’est pas reconnue correctement par certains navigateurs (Internet Explorer pour ne pas le nommer) et que chaque navigateur ne gère en natif que certains formats de vidéos.
Son avantage principal quant à lui est de bénéficier de la prise en charge native de vidéos dans les navigateur et donc de se passer de l’utilisation de Flash et (...) -
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 -
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 (3529)
-
Can't set seeker in GSTREAMER cv2, python
29 avril, par Alperen ÖlçerI want to skip n seconds forward and backward in gstreamer cv2 capture for recorded videos. But when I use
cap_gstreamer.set(cv2.CAP_PROP_POS_FRAMES, fps*skip_second)
it resets seeker to beginning of video. How can I solve it ? I wrote an example, used recorded clock video.

import cv2

video_p = '/home/alperenlcr/Videos/clock.mp4'

cap_gstreamer = cv2.VideoCapture(video_p, cv2.CAP_GSTREAMER)
cap_ffmpeg = cv2.VideoCapture(video_p, cv2.CAP_FFMPEG)

fps = cap_gstreamer.get(cv2.CAP_PROP_FPS)
skip_second = 100

im1 = cv2.resize(cap_gstreamer.read()[1], (960, 540))
im1_ffmpeg = cv2.resize(cap_ffmpeg.read()[1], (960, 540))

cap_gstreamer.set(cv2.CAP_PROP_POS_FRAMES, fps*skip_second)
cap_ffmpeg.set(cv2.CAP_PROP_POS_FRAMES, fps*skip_second)

im2 = cv2.resize(cap_gstreamer.read()[1], (960, 540))
im2_ffmpeg = cv2.resize(cap_ffmpeg.read()[1], (960, 540))

merge_gstreamer = cv2.hconcat([im1, im2])
merge_ffmpeg = cv2.hconcat([im1_ffmpeg, im2_ffmpeg])

cv2.imshow(str(skip_second) + ' gstreamer', merge_gstreamer)
cv2.imshow(str(skip_second) + ' ffmpeg', merge_ffmpeg)
cv2.waitKey(0)
cv2.destroyAllWindows()

cap_gstreamer.release()
cap_ffmpeg.release()






My cv2 build is like :


>>> print(cv2.getBuildInformation())

General configuration for OpenCV 4.8.1 =====================================
 Version control: 4.8.1-dirty

 Extra modules:
 Location (extra): /home/alperenlcr/SourceInstalls/opencv_contrib/modules
 Version control (extra): 4.8.1

 Platform:
 Timestamp: 2024-12-02T13:44:58Z
 Host: Linux 6.8.0-49-generic x86_64
 CMake: 3.22.1
 CMake generator: Unix Makefiles
 CMake build tool: /usr/bin/gmake
 Configuration: RELEASE

 CPU/HW features:
 Baseline: SSE SSE2 SSE3
 requested: SSE3
 Dispatched code generation: SSE4_1 SSE4_2 FP16 AVX AVX2 AVX512_SKX
 requested: SSE4_1 SSE4_2 AVX FP16 AVX2 AVX512_SKX
 SSE4_1 (18 files): + SSSE3 SSE4_1
 SSE4_2 (2 files): + SSSE3 SSE4_1 POPCNT SSE4_2
 FP16 (1 files): + SSSE3 SSE4_1 POPCNT SSE4_2 FP16 AVX
 AVX (8 files): + SSSE3 SSE4_1 POPCNT SSE4_2 AVX
 AVX2 (37 files): + SSSE3 SSE4_1 POPCNT SSE4_2 FP16 FMA3 AVX AVX2
 AVX512_SKX (8 files): + SSSE3 SSE4_1 POPCNT SSE4_2 FP16 FMA3 AVX AVX2 AVX_512F AVX512_COMMON AVX512_SKX

 C/C++:
 Built as dynamic libs?: NO
 C++ standard: 11
 C++ Compiler: /usr/bin/c++ (ver 10.5.0)
 C++ flags (Release): -fsigned-char -ffast-math -W -Wall -Wreturn-type -Wnon-virtual-dtor -Waddress -Wsequence-point -Wformat -Wformat-security -Wmissing-declarations -Wundef -Winit-self -Wpointer-arith -Wshadow -Wsign-promo -Wuninitialized -Wsuggest-override -Wno-delete-non-virtual-dtor -Wno-comment -Wimplicit-fallthrough=3 -Wno-strict-overflow -fdiagnostics-show-option -Wno-long-long -pthread -fomit-frame-pointer -ffunction-sections -fdata-sections -msse -msse2 -msse3 -fvisibility=hidden -fvisibility-inlines-hidden -O3 -DNDEBUG -DNDEBUG
 C++ flags (Debug): -fsigned-char -ffast-math -W -Wall -Wreturn-type -Wnon-virtual-dtor -Waddress -Wsequence-point -Wformat -Wformat-security -Wmissing-declarations -Wundef -Winit-self -Wpointer-arith -Wshadow -Wsign-promo -Wuninitialized -Wsuggest-override -Wno-delete-non-virtual-dtor -Wno-comment -Wimplicit-fallthrough=3 -Wno-strict-overflow -fdiagnostics-show-option -Wno-long-long -pthread -fomit-frame-pointer -ffunction-sections -fdata-sections -msse -msse2 -msse3 -fvisibility=hidden -fvisibility-inlines-hidden -g -O0 -DDEBUG -D_DEBUG
 C Compiler: /usr/bin/cc
 C flags (Release): -fsigned-char -ffast-math -W -Wall -Wreturn-type -Waddress -Wsequence-point -Wformat -Wformat-security -Wmissing-declarations -Wmissing-prototypes -Wstrict-prototypes -Wundef -Winit-self -Wpointer-arith -Wshadow -Wuninitialized -Wno-comment -Wimplicit-fallthrough=3 -Wno-strict-overflow -fdiagnostics-show-option -Wno-long-long -pthread -fomit-frame-pointer -ffunction-sections -fdata-sections -msse -msse2 -msse3 -fvisibility=hidden -O3 -DNDEBUG -DNDEBUG
 C flags (Debug): -fsigned-char -ffast-math -W -Wall -Wreturn-type -Waddress -Wsequence-point -Wformat -Wformat-security -Wmissing-declarations -Wmissing-prototypes -Wstrict-prototypes -Wundef -Winit-self -Wpointer-arith -Wshadow -Wuninitialized -Wno-comment -Wimplicit-fallthrough=3 -Wno-strict-overflow -fdiagnostics-show-option -Wno-long-long -pthread -fomit-frame-pointer -ffunction-sections -fdata-sections -msse -msse2 -msse3 -fvisibility=hidden -g -O0 -DDEBUG -D_DEBUG
 Linker flags (Release): -Wl,--exclude-libs,libippicv.a -Wl,--exclude-libs,libippiw.a -Wl,--gc-sections -Wl,--as-needed -Wl,--no-undefined 
 Linker flags (Debug): -Wl,--exclude-libs,libippicv.a -Wl,--exclude-libs,libippiw.a -Wl,--gc-sections -Wl,--as-needed -Wl,--no-undefined 
 ccache: NO
 Precompiled headers: NO
 Extra dependencies: /usr/lib/x86_64-linux-gnu/libjpeg.so /usr/lib/x86_64-linux-gnu/libpng.so /usr/lib/x86_64-linux-gnu/libtiff.so /usr/lib/x86_64-linux-gnu/libz.so /usr/lib/x86_64-linux-gnu/libfreetype.so /usr/lib/x86_64-linux-gnu/libharfbuzz.so Iconv::Iconv m pthread cudart_static dl rt nppc nppial nppicc nppidei nppif nppig nppim nppist nppisu nppitc npps cublas cudnn cufft -L/usr/lib/x86_64-linux-gnu -L/usr/lib/cuda/lib64
 3rdparty dependencies: libprotobuf ade ittnotify libwebp libopenjp2 IlmImf quirc ippiw ippicv

 OpenCV modules:
 To be built: aruco bgsegm bioinspired calib3d ccalib core cudaarithm cudabgsegm cudafeatures2d cudafilters cudaimgproc cudalegacy cudaobjdetect cudaoptflow cudastereo cudawarping cudev datasets dnn dnn_objdetect dnn_superres dpm face features2d flann freetype fuzzy gapi hfs highgui img_hash imgcodecs imgproc intensity_transform line_descriptor mcc ml objdetect optflow phase_unwrapping photo plot python3 quality rapid reg rgbd saliency shape stereo stitching structured_light superres surface_matching text tracking ts video videoio videostab wechat_qrcode xfeatures2d ximgproc xobjdetect xphoto
 Disabled: cudacodec world
 Disabled by dependency: -
 Unavailable: alphamat cvv hdf java julia matlab ovis python2 sfm viz
 Applications: tests perf_tests examples apps
 Documentation: NO
 Non-free algorithms: NO

 GUI: GTK2
 QT: NO
 GTK+: YES (ver 2.24.33)
 GThread : YES (ver 2.72.4)
 GtkGlExt: NO
 OpenGL support: NO
 VTK support: NO

 Media I/O: 
 ZLib: /usr/lib/x86_64-linux-gnu/libz.so (ver 1.2.11)
 JPEG: /usr/lib/x86_64-linux-gnu/libjpeg.so (ver 80)
 WEBP: build (ver encoder: 0x020f)
 PNG: /usr/lib/x86_64-linux-gnu/libpng.so (ver 1.6.37)
 TIFF: /usr/lib/x86_64-linux-gnu/libtiff.so (ver 42 / 4.3.0)
 JPEG 2000: build (ver 2.5.0)
 OpenEXR: build (ver 2.3.0)
 HDR: YES
 SUNRASTER: YES
 PXM: YES
 PFM: YES

 Video I/O:
 DC1394: NO
 FFMPEG: YES
 avcodec: YES (58.134.100)
 avformat: YES (58.76.100)
 avutil: YES (56.70.100)
 swscale: YES (5.9.100)
 swresample: YES (3.9.100)
 GStreamer: YES (1.20.3)
 v4l/v4l2: YES (linux/videodev2.h)

 Parallel framework: TBB (ver 2021.5 interface 12050)

 Trace: YES (with Intel ITT)

 Other third-party libraries:
 Intel IPP: 2021.8 [2021.8.0]
 at: /home/alperenlcr/SourceInstalls/opencv/build/3rdparty/ippicv/ippicv_lnx/icv
 Intel IPP IW: sources (2021.8.0)
 at: /home/alperenlcr/SourceInstalls/opencv/build/3rdparty/ippicv/ippicv_lnx/iw
 VA: NO
 Lapack: NO
 Eigen: NO
 Custom HAL: NO
 Protobuf: build (3.19.1)
 Flatbuffers: builtin/3rdparty (23.5.9)

 NVIDIA CUDA: YES (ver 11.5, CUFFT CUBLAS NVCUVID NVCUVENC FAST_MATH)
 NVIDIA GPU arch: 86
 NVIDIA PTX archs:

 cuDNN: YES (ver 8.6.0)

 OpenCL: YES (no extra features)
 Include path: /home/alperenlcr/SourceInstalls/opencv/3rdparty/include/opencl/1.2
 Link libraries: Dynamic load

 ONNX: NO

 Python 3:
 Interpreter: /usr/bin/python3 (ver 3.10.12)
 Libraries: /usr/lib/x86_64-linux-gnu/libpython3.10.so (ver 3.10.12)
 numpy: /usr/lib/python3/dist-packages/numpy/core/include (ver 1.21.5)
 install path: lib/python3.10/dist-packages/cv2/python-3.10

 Python (for build): /usr/bin/python3

 Java: 
 ant: NO
 Java: NO
 JNI: NO
 Java wrappers: NO
 Java tests: NO

 Install to: /usr/local
-----------------------------------------------------------------




-
How to tell ffmpeg that /tmp/phpFm6H79 is a safe file name ?
28 août 2023, par hanshenrikHow do I tell ffmpeg that
/tmp/phpFm6H79
is a safe filename ?

When I do


ffmpeg -y -f concat -i '/tmp/phpFm6H79' -c:v:libx264 -vsync vfr '/home/hans/projects/test/output2.mp4'



I get (*only the last 2 lines are interesting)


ffmpeg version 4.4.2-0ubuntu0.22.04.1 Copyright (c) 2000-2021 the FFmpeg developers
 built with gcc 11 (Ubuntu 11.2.0-19ubuntu1)
 configuration: --prefix=/usr --extra-version=0ubuntu0.22.04.1 --toolchain=hardened --libdir=/usr/lib/x86_64-linux-gnu --incdir=/usr/include/x86_64-linux-gnu --arch=amd64 --enable-gpl --disable-stripping --enable-gnutls --enable-ladspa --enable-libaom --enable-libass --enable-libbluray --enable-libbs2b --enable-libcaca --enable-libcdio --enable-libcodec2 --enable-libdav1d --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-librabbitmq --enable-librubberband --enable-libshine --enable-libsnappy --enable-libsoxr --enable-libspeex --enable-libsrt --enable-libssh --enable-libtheora --enable-libtwolame --enable-libvidstab --enable-libvorbis --enable-libvpx --enable-libwebp --enable-libx265 --enable-libxml2 --enable-libxvid --enable-libzimg --enable-libzmq --enable-libzvbi --enable-lv2 --enable-omx --enable-openal --enable-opencl --enable-opengl --enable-sdl2 --enable-pocketsphinx --enable-librsvg --enable-libmfx --enable-libdc1394 --enable-libdrm --enable-libiec61883 --enable-chromaprint --enable-frei0r --enable-libx264 --enable-shared
 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
[concat @ 0x55b070e9ff40] Unsafe file name '/tmp/phpbshsmF'
/tmp/phpFm6H79: Operation not permitted



The filepath is generated with PHP's
tmpfile()
like

$ffmpegInputTxtFileHandle = tmpfile();
$ffmpegInputTxtFilePath = stream_get_meta_data($ffmpegInputTxtFileHandle)['uri'];



The code should be threadsafe, so using hardcoded paths is not really viable, and using
tmpfile()
is very convenient, it takes care of automatically deleting the file when the script exit, even if php crashes, so I'd rather tell ffmpeg that it is safe, than change it to something other thantmpfile()
, is it possible ? how ?

I tried using this fugly workaround to get it to end with ".txt"


$ffmpegInputTxtFileHandle = tmpfile();
 $ffmpegInputTxtFilePath = stream_get_meta_data($ffmpegInputTxtFileHandle)['uri'] . ".txt";
 fclose($ffmpegInputTxtFileHandle);
 $ffmpegInputTxtFileHandle = fopen($ffmpegInputTxtFilePath, 'w+b');
 register_shutdown_function(function () use ($ffmpegInputTxtFileHandle, $ffmpegInputTxtFilePath) {
 @fclose($ffmpegInputTxtFileHandle);
 @unlink($ffmpegInputTxtFilePath);
 });



but it even says that
/tmp/phpFm6H79.txt
is an unsafe filename :'(

-
when i built ffmpeg to push raspberry pi 4 camera stream to my sever,I get Unknown input format : 'h264' ERROR
26 janvier 2021, par IOKE Baiinput :




raspivid -o - -t 0 -vf -hf -fps 10 -b 500000 | ffmpeg -re -ar 44100
-ac 2 -acodec pcm_s16le -f s16le -ac 2 -i /dev/zero -f h264 -i - -vcodec copy -acodec aac -ab 128k -g 50 -strict experimental -f flv rtmp ://111.111.111.111/live/stream




output :






ffmpeg version N-100793-gc7016e35a6 Copyright (c) 2000-2021
the FFmpeg developers
built with gcc 8 (Raspbian 8.3.0-6+rpi1)
configuration : —extra-ldflags=-latomic —enable-gpl —enable-version3 —enable-nonfree
—enable-static —disable-shared —prefix=/usr/local —disable-opencl —disable-thumb —disable-pic —disable-stripping
—enable-small —enable-ffmpeg —enable-ffplay —enable-ffprobe —disable-doc —disable-htmlpages —disable-podpages —disable-txtpages —disable-manpages —disable-everything —enable-libx264 —enable-encoder=libx264 —enable-encoder=h264
—enable-decoder=h264 —enable-decoder=pcm_s16le —enable-encoder=aac —enable-decoder=aac —enable-encoder=ac3 —enable-decoder=ac3 —enable-encoder=rawvideo —enable-decoder=rawvideo —enable-encoder=mjpeg —enable-decoder=mjpeg —enable-demuxer=concat —enable-muxer=flv —enable-demuxer=flv —enable-demuxer=live_flv —enable-muxer=hls —enable-muxer=segment —enable-muxer=stream_segment —enable-muxer=mov —enable-demuxer=mov —enable-muxer=mp4 —enable-muxer=mpegts —enable-demuxer=mpegts —enable-demuxer=mpegvideo —enable-muxer=matroska —enable-demuxer=matroska —enable-muxer=wav —enable-demuxer=wav —enable-muxer='pcm*' —enable-demuxer='pcm*' —enable-muxer=rawvideo —enable-demuxer=rawvideo —enable-muxer=rtsp —enable-demuxer=rtsp —enable-muxer=rtsp —enable-demuxer=sdp —enable-muxer=fifo —enable-muxer=tee —enable-parser=h264 —enable-parser=aac —enable-protocol=file —enable-protocol=tcp —enable-protocol=rtmp —enable-protocol=cache —enable-protocol=pipe —enable-filter=aresample —enable-filter=allyuv —enable-filter=scale —enable-libfreetype —enable-indev=v4l2 —enable-indev=alsa —enable-omx —enable-omx-rpi —enable-encoder=h264_omx —enable-mmal —enable-hwaccel=h264_mmal —enable-decoder=h264_mmal
libavutil 56. 63.101 / 56. 63.101
libavcodec 58.118.100 / 58.118.100
libavformat 58. 65.101 / 58. 65.101
libavdevice 58. 11.103 / 58. 11.103
libavfilter 7. 97.100 / 7. 97.100
libswscale 5. 8.100 / 5. 8.100
libswresample 3. 8.100 / 3. 8.100
libpostproc 55. 8.100 / 55. 8.100
Guessed Channel Layout for Input Stream #0.0 : stereo
Input #0, s16le, from '/dev/zero' :
Duration : N/A, bitrate : 1411 kb/s
Stream #0:0 : Audio : pcm_s16le, 44100 Hz, stereo, s16, 1411 kb/s






ERROR




Unknown input format : 'h264'