Recherche avancée

Médias (91)

Autres articles (18)

  • Personnaliser en ajoutant son logo, sa bannière ou son image de fond

    5 septembre 2013, par

    Certains 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 ;

  • Ecrire une actualité

    21 juin 2013, par

    Présentez les changements dans votre MédiaSPIP ou les actualités de vos projets sur votre MédiaSPIP grâce à la rubrique actualités.
    Dans le thème par défaut spipeo de MédiaSPIP, les actualités sont affichées en bas de la page principale sous les éditoriaux.
    Vous pouvez personnaliser le formulaire de création d’une actualité.
    Formulaire de création d’une actualité Dans le cas d’un document de type actualité, les champs proposés par défaut sont : Date de publication ( personnaliser la date de publication ) (...)

  • Publier sur MédiaSpip

    13 juin 2013

    Puis-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 (4406)

  • Noobs approach to automate x264 cmd

    16 novembre 2012, par nightcrawler

    so here is my script to loop through specific video extensions » add a manual profile » generate necessary *.bat & finally a final 'loader' batch file to execute previous *.bat files sequentially & necessary logging (this gives quiet a deal of freedom if you so want)

    ::==
    :: gets lines into vars c1 v2 v...
    @echo off
    :: user input required
    cd /d "d:\Trainers\out\"
    setLocal EnableDelayedExpansion
    dir /B /O:N | findstr ".wmv$ " >filename.txt
    echo. >log.txt
    :: user input required
    for /f "tokens=* delims= " %%a in ('type filename.txt ^|findstr ".wmv$"') do (
    set /a n+=1
    echo. >file!n!.bat
    set in=%in%%%a
    :: user input required
    set out=!in:.wmv=.mp4!
    :: user input required
    set v=x264 --crf 23  --level 3.1 --tune film -o "d:\Trainers\out\!in!" "d:\Trainers\out\!out!"
    echo. !v!>file!n!.bat
    )
    dir /B /O:N | findstr ".bat$ " >x264_home.txt
    for /f "tokens=* delims= " %%a in (x264_home.txt) do (
    set /a n+=1
    :: mtee is an external library Google it
    set "z=call %%a | mtee /d/c/t/+ log.txt"
    echo. !z! >> x264_home.bat
    )
    echo. @echo off > newFile.bat
    type x264_home.bat >> newFile.bat
    type newFile.bat > x264_home.bat
    del newFile.bat,x264_home.txt,filename.txt
    echo. pause >> x264_home.bat
    echo. @echo All Operation done... >> x264_home.bat
    :: user input required
    move "d:\Trainers\out\*.bat" "d:\Program Files\x264_auto\test\"
    :: user input required
    move "d:\Trainers\out\log.txt" "d:\Program Files\x264_auto\test\"
    ::==

    Now the above code which is fairly easy to understand (bcz its written by a noob) run perfectly & create necessary files. For instance one of the file1.bat looks like this :

    x264 --crf 23  --level 3.1 --tune film --preset veryslow --deblock -2:-1 --zones 24233,25324,q=20 --acodec aac --abitrate 80 -o "d:\Trainers\out\1.wmv" "d:\Trainers\out\1.mp4"

    ...& the loader .bat file looks like

    @echo off
    call file1.bat | mtee /d/c/t/+ log.txt
    call file2.bat | mtee /d/c/t/+ log.txt
    call file3.bat | mtee /d/c/t/+ log.txt
    @echo All Operation done...

    You see this is a quiet flexible approach in that you can use special filestr » set another loop » set another profile. Furthermore every batch file can be latter edited especiialy when you heavily use --zone x264 feature
    I am successful because there is no error in any output ...but its the x264.exe (provider/compiler x264GUI) throws error which it otherwise don't ?

    d:\Program Files\x264_auto\test>x264 --crf 23  --level 3.1 --tune film --preset
    veryslow --deblock -2:-1 --zones 24233,25324,q=20 --acodec aac --abitrate 80 -o
    "d:\Trainers\out\1.wmv" "d:\Trainers\out\1.mp4"
    ffms [error]: could not create index
    lavf [error]: could not open input file
    raw [error]: raw input requires a resolution.
    x264 [error]: could not open input file `d:\Trainers\out\1.mp4' via any method!

    its the x264 thats the culprit perhaps a senior guide is required here

  • What’s So Hard About Building ?

    10 septembre 2011, par Multimedia Mike — Programming

    I finally had a revelation as to why so building software can be so difficult– because build systems are typically built on programming languages that you don’t normally use in your day to day programming activities. If the project is simple enough, the build system usually takes care of the complexities. If there are subtle complexities — and there always are — then you can to figure out how to customize the build system to meet your needs.

    First, there’s the Makefile. It’s easy to forget that the syntax which comprises a Makefile pretty well qualifies as a programming language. I wonder if it’s Turing-complete ? But writing and maintaining Makefiles manually is arduous and many systems have been created to generate Makefiles for you. At the end of the day, running ‘make’ still requires the presence of a Makefile and in the worst case scenario, you’re going to have to inspect and debug what was automatically generated for that Makefile.

    So there is the widespread GNU build system, a.k.a., “the autotools”, named due to its principle components such as autoconf and automake. In this situation, you have no fewer than 3 distinct languages at work. You write your general build instructions using a set of m4 macros (language #1). These get processed by the autotools in order to generate a shell script (language #2) called configure. When this is executed by the user, it eventually generates a Makefile (language #3).

    Over the years, a few challengers have attempted to dethrone autotools. One is CMake which configures a project using its own custom programming language that you will need to learn. Configuration generates a standard Makefile. So there are 2 languages involved in this approach.

    Another option is SCons, which is Python-based, top to bottom. Only one programming language is involved in the build system ; there’s no Makefile generated and run. Until I started writing this, I was guessing that the Python component generated a Makefile, but no.

    That actually makes SCons look fairly desirable, at least if your only metric when choosing a build system is to minimize friction against rarely-used programming languages.

    I should also make mention of a few others : Apache Ant is a build system in which the build process is described by an XML file. XML doesn’t qualify as a programming language (though that apparently doesn’t stop some people from using it as such). I see there’s also qmake, related to the Qt system. This system uses its own custom syntax.

  • opencv ffmpeg vaapi 1080p resolution not working

    18 avril 2023, par yeo

    I want to use hardware acceleration with opencv manual build.
My gpu uses an i965 intel cpu built-in graphics card, and it is a debain11 environment.

    


    [OPENCV:FFMPEG:40] Reinit context to 1920x1088, pix_fmt: vaapi_vld


    


    If you look at some of the error messages below, it seems that the original file is 1920x1080 because it is converted to 1088 while reinit.
I've read that vaapi_vld reads 16 bits at a time.
In fact, it seems to work when the original file is changed to 1920x1072.
Is there a way to fix it without changing the original file resolution ?
Please advise seniors.
Sorry for my poor English skills
Thank you

    


    manual build CMAKE option

    


    "-DCMAKE_VERBOSE_MAKEFILE=ON -DWITH_VA_INTEL=ON -DWITH_VA=ON -DOPENCV_FFMPEG_ENABLE_LIBAVDEVICE=ON -DOPENCV_ENABLE_GLX=ON -DOPENCV_FFMPEG_SKIP_BUILD_CHECK=ON -DWITH_OPENVINO=ON -DWITH_INF_ENGINE=ON"



    


    build infomation

    


      OpenCV modules:
    To be built:                 calib3d core dnn features2d flann gapi highgui imgcodecs imgproc ml objdetect photo python3 stitching video videoio
    Disabled:                    world
    Disabled by dependency:      -
    Unavailable:                 java python2 ts
    Applications:                -
    Documentation:               NO
    Non-free algorithms:         NO

  GUI:                           GTK3
    GTK+:                        YES (ver 3.24.24)
      GThread :                  YES (ver 2.66.8)
      GtkGlExt:                  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 62)
    WEBP:                        /usr/lib/x86_64-linux-gnu/libwebp.so (ver encoder: 0x020e)
    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.2.0)
    JPEG 2000:                   build (ver 2.4.0)
    OpenEXR:                     build (ver 2.3.0)
    HDR:                         YES
    SUNRASTER:                   YES
    PXM:                         YES
    PFM:                         YES
  Video I/O:
    DC1394:                      YES (2.2.6)
    FFMPEG:                      YES
      avcodec:                   YES (58.91.100)
      avformat:                  YES (58.45.100)
      avutil:                    YES (56.51.100)
      swscale:                   YES (5.7.100)
      avresample:                YES (4.0.0)
    GStreamer:                   YES (1.18.4)
    v4l/v4l2:                    YES (linux/videodev2.h)

  Parallel framework:            pthreads

  Trace:                         YES (with Intel ITT)

  Other third-party libraries:
    Intel IPP:                   2020.0.0 Gold [2020.0.0]
    VA:                          YES
    Lapack:                      NO
    Eigen:                       NO
    Custom HAL:                  NO
    Protobuf:                    build (3.19.1)

  OpenCL:                        YES (INTELVA)
    Include path:                /home/xxx
    Link libraries:              Dynamic load

  Python 3:
    Interpreter:                 /usr/bin/python3 (ver 3.9.2)
    Libraries:                   /usr/lib/x86_64-linux-gnu/libpython3.9.so (ver 3.9.2)
    numpy:                       /home/../include (ver 1.19.3)
    install path:                python/cv2/python-3


    


    vainfo

    


    libva info: VA-API version 1.10.0
libva info: User environment variable requested driver 'i965'
libva info: Trying to open /usr/lib/x86_64-linux-gnu/dri/i965_drv_video.so
libva info: Found init function __vaDriverInit_1_8
libva info: va_openDriver() returns 0
vainfo: VA-API version: 1.10 (libva 2.10.0)
vainfo: Driver version: Intel i965 driver for Intel(R) Haswell Mobile - 2.4.1
vainfo: Supported profile and entrypoints
      VAProfileMPEG2Simple            : VAEntrypointVLD
      VAProfileMPEG2Simple            : VAEntrypointEncSlice
      VAProfileMPEG2Main              : VAEntrypointVLD
      VAProfileMPEG2Main              : VAEntrypointEncSlice
      VAProfileH264ConstrainedBaseline: VAEntrypointVLD
      VAProfileH264ConstrainedBaseline: VAEntrypointEncSlice
      VAProfileH264Main               : VAEntrypointVLD
      VAProfileH264Main               : VAEntrypointEncSlice
      VAProfileH264High               : VAEntrypointVLD
      VAProfileH264High               : VAEntrypointEncSlice
      VAProfileH264MultiviewHigh      : VAEntrypointVLD
      VAProfileH264MultiviewHigh      : VAEntrypointEncSlice
      VAProfileH264StereoHigh         : VAEntrypointVLD
      VAProfileH264StereoHigh         : VAEntrypointEncSlice
      VAProfileVC1Simple              : VAEntrypointVLD
      VAProfileVC1Main                : VAEntrypointVLD
      VAProfileVC1Advanced            : VAEntrypointVLD
      VAProfileNone                   : VAEntrypointVideoProc
      VAProfileJPEGBaseline           : VAEntrypointVLD


    


    import os
import cv2

os.environ["OPENCV_FFMPEG_CAPTURE_OPTIONS"] = "hw_decoders_any;vaapi,vdpau" +

cap = cv2.VideoCapture(file_name,cv2.CAP_FFMPEG(cv2.CAP_PROP_HW_ACCELERATION,cv2.VIDEO_ACCELERATION_ANY))  



    


    error code

    


    [ INFO:0@0.187] global /home/u/opencv-python/opencv/modules/videoio/src/videoio_registry.cpp (223) VideoBackendRegistry VIDEOIO: Enabled backends(8, sorted by priority): FFMPEG(1000); GSTREAMER(990); INTEL_MFX(980); V4L2(970); CV_IMAGES(960); CV_MJPEG(950); FIREWIRE(940); UEYE(930)
[OPENCV:FFMPEG:40] Reinit context to 1920x1088, pix_fmt: yuv420p
[OPENCV:FFMPEG:40] Trying to use DRM render node for device 0.
[OPENCV:FFMPEG:40] libva: VA-API version 1.10.0
libva: User environment variable requested driver 'i965'
libva: Trying to open /usr/lib/x86_64-linux-gnu/dri/i965_drv_video.so
libva: Found init function __vaDriverInit_1_8
libva: va_openDriver() returns 0
Initialised VAAPI connection: version 1.10
[OPENCV:FFMPEG:40] VAAPI driver: Intel i965 driver for Intel(R) Haswell Mobile - 2.4.1.
[OPENCV:FFMPEG:40] Driver not found in known nonstandard list, using standard behaviour.
[ INFO:0@0.228] global /home/u/opencv-python/opencv/modules/videoio/src/cap_ffmpeg_hw.hpp (276) hw_check_device FFMPEG: Using vaapi video acceleration on device: Intel i965 driver for Intel(R) Haswell Mobile - 2.4.1
[ INFO:0@0.228] global /home/u/opencv-python/opencv/modules/videoio/src/cap_ffmpeg_hw.hpp (566) hw_create_device FFMPEG: Created video acceleration context (av_hwdevice_ctx_create) for vaapi on device 'default'
[ INFO:0@0.228] global /home/u/opencv-python/opencv/modules/core/src/ocl.cpp (1186) haveOpenCL Initialize OpenCL runtime...
[ INFO:0@0.228] global /home/u/opencv-python/opencv/modules/core/src/ocl.cpp (1192) haveOpenCL OpenCL: found 0 platforms
File open : ./videoplayback1.mp4
[OPENCV:FFMPEG:40] Reinit context to 1920x1088, pix_fmt: vaapi_vld
[OPENCV:FFMPEG:16] Failed to read image from surface 0x4000014: 18 (invalid parameter).
[ERROR:0@0.245] global /home/u/opencv-python/opencv/modules/videoio/src/cap_ffmpeg_impl.hpp (1575) retrieveFrame Error copying data from GPU to CPU (av_hwframe_transfer_data)
Play video ... size=1920x1080, file=./videoplayback1.mp4
[OPENCV:FFMPEG:16] Failed to read image from surface 0x4000012: 18 (invalid parameter).
[ERROR:0@0.277] global /home/u/opencv-python/opencv/modules/videoio/src/cap_ffmpeg_impl.hpp (1575) retrieveFrame Error copying data from GPU to CPU (av_hwframe_transfer_data)
OpenCV(4.6.0) Error: Assertion failed (!image.empty()) in imencode, file /home/u/opencv-python/opencv/modules/imgcodecs/src/loadsave.cpp, line 976
err =  OpenCV(4.6.0) /home/u/opencv-python/opencv/modules/imgcodecs/src/loadsave.cpp:976: error: (-215:Assertion failed) !image.empty() in function 'imencode'



    


    I tried to do video capture by ffmpeg hwacceleration with opencv, but an error message occurred