Recherche avancée

Médias (1)

Mot : - Tags -/3GS

Autres articles (93)

  • Mediabox : ouvrir les images dans l’espace maximal pour l’utilisateur

    8 février 2011, par

    La visualisation des images est restreinte par la largeur accordée par le design du site (dépendant du thème utilisé). Elles sont donc visibles sous un format réduit. Afin de profiter de l’ensemble de la place disponible sur l’écran de l’utilisateur, il est possible d’ajouter une fonctionnalité d’affichage de l’image dans une boite multimedia apparaissant au dessus du reste du contenu.
    Pour ce faire il est nécessaire d’installer le plugin "Mediabox".
    Configuration de la boite multimédia
    Dès (...)

  • (Dés)Activation de fonctionnalités (plugins)

    18 février 2011, par

    Pour gérer l’ajout et la suppression de fonctionnalités supplémentaires (ou plugins), MediaSPIP utilise à partir de la version 0.2 SVP.
    SVP permet l’activation facile de plugins depuis l’espace de configuration de MediaSPIP.
    Pour y accéder, il suffit de se rendre dans l’espace de configuration puis de se rendre sur la page "Gestion des plugins".
    MediaSPIP est fourni par défaut avec l’ensemble des plugins dits "compatibles", ils ont été testés et intégrés afin de fonctionner parfaitement avec chaque (...)

  • Les autorisations surchargées par les plugins

    27 avril 2010, par

    Mediaspip core
    autoriser_auteur_modifier() afin que les visiteurs soient capables de modifier leurs informations sur la page d’auteurs

Sur d’autres sites (8302)

  • Where are there working exdamples for QSV enabled ffmpeg filters ?

    2 août 2021, par Bart Lederman

    I'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.)

    


  • FFmpeg - Issue scaling and overlaying image

    19 juillet 2019, par HB.

    Firstly, the screen dimensions of the device I’m using is 1080 x 2280 pixels, 19:9 ratio, this is important and will be explained later in the question.


    Few months ago I asked this question. The answer provided worked perfectly :

    "-i", video.mp4, "-i", image.png, "-filter_complex", "[0:v]pad=iw:2*trunc(iw*16/9/2):(ow-iw)/2:(oh-ih)/2[v0];[1:v][v0]scale2ref[v1][v0];[v0][v1]overlay=x=(W-w)/2:y=(H-h)/2[v]", "-map", "[v]", "-map", "0:a", "-c:v", "libx264", "-preset", "ultrafast", "-r", outFPS, output.mp4

    Shortly after I implemented and releasing this, I started getting messages from users complaining that the image that was placed on-top of the video is not at the same position after saving it.
    I noticed that in the command above the ratio for the pad is set for 16:9 ratio, in other words the above will not work on devices that has a screen ratio of 19:9.

    I then asked another question about this issue, and after a long conversation with @Gyan, the command is changed to the following :

    "-i", video.mp4, "-i", image.png, "-filter_complex", "[0:v]scale=iw*sar:ih,setsar=1,pad='max(iw\,2*trunc(ih*9/16/2))':'max(ih\,2*trunc(ow*16/9/2))':(ow-iw)/2:(oh-ih)/2[v0];[1:v][v0]scale2ref[v1][v0];[v0][v1]overlay=x=(W-w)/2:y=(H-h)/2[v]", "-map", "[v]", "-map", "0:a", "-c:v", "libx264", "-preset", "ultrafast", "-r", outFPS, output.mp4

    Testing on a device that has a 16:9 ratio works perfectly.


    Now testing with the device mentioned above, I replace the ratio in the command to the following (19/9/2 and 9/19/2) :

    "-i", video.mp4, "-i", image.png, "-filter_complex", "[0:v]scale=iw*sar:ih,setsar=1,pad='max(iw\,2*trunc(ih*9/19/2))':'max(ih\,2*trunc(ow*19/9/2))':(ow-iw)/2:(oh-ih)/2[v0];[1:v][v0]scale2ref[v1][v0];[v0][v1]overlay=x=(W-w)/2:y=(H-h)/2[v]", "-map", "[v]", "-map", "0:a", "-c:v", "libx264", "-preset", "ultrafast", "-r", outFPS, output.mp4

    Here is the result I get :

    I changed my players background to green to make it easier to see. The blue line is the image that I want to overlay

    Original video

    original

    After processing

    after

    Here is the issues with the above.

    • The line that was drawn on the original video is not scaled, but it is still at the correct position.
    • The video is no longer the original size, the width and hight is reduced and my players background can now be seen on the left and right of the video.

    Here is the result I’m trying to achieve :

    correct

    You will notice the following :

    • The video is not resized, it still has the same dimensions as the original.
    • The line that was drawn is still at the same position and is not scaled
    • Black padding was added to the top and bottom of the video, to fill the remaining space. The green background is no longer visible.

    Any advice to achieve the above would greatly be appreciated.

    I will be giving 300 bounty points to the user that can help me fix this.


    EDIT 1

    Here is an input video, image and the expected output as asked for in the comment section. This is using a device that has 16:9 aspect ratio and screen dimensions of 1920x1080.

    Here is another example of the expected output (I also included the input image and input video).


    EDIT 2

    I think it’s worth mentioning that the input image will always be the size/dimensions of the devices screen, so it will always have the same aspect ratio as the screen as well. The size/dimensions of input video will vary.

  • Excuting ffmpeg commands using Python to locate *.png failed

    18 mai 2023, par Leo

    The following command works well if I run it in the Bash terminal.

    


    ffmpeg -framerate 25 -pattern_type glob -i 'data/*.png' -i data/download_youtube/_-91nXXjrVo_cut.wav -c:v libx264 -pix_fmt yuv420p data/download_youtube/_-91nXXjrVo_out.mp4


    


    However, If i run it using os.system() using Python.

    


    os.system(r"ffmpeg -framerate 25 -pattern_type glob -i '/data/share/VFHQ/data/extracted_cropped_face_results/_-91nXXjrVo/Clip+_-91nXXjrVo+P0+C0+F1537-1825/*.png' -i /data/share/VFHQ/data/download_youtube/_-91nXXjrVo_cut.wav -c:v libx264 -pix_fmt yuv420p /data/share/VFHQ/data/download_youtube/out.mp4")


    


    I get Unknown encoder 'libx264'

    


    If I remove the quotation mark inside the commands

    


    os.system(r"ffmpeg -framerate 25 -pattern_type glob -i /data/share/VFHQ/data/extracted_cropped_face_results/_-91nXXjrVo/Clip+_-91nXXjrVo+P0+C0+F1537-1825/*.png -i /data/share/VFHQ/data/download_youtube/_-91nXXjrVo_cut.wav -c:v libx264 -pix_fmt yuv420p /data/share/VFHQ/data/download_youtube/out.mp4")


    


    I get Option pattern_type not found.

    


    So I tried subprocess.run(command,shell=True) , I get same results as shown above.

    


    Running 'subprocess.run()' without Shell will result in the following"

    


    subprocess.run(['ffmpeg', '-framerate', '25','-pattern_type', 'glob', '-i','/data/share/VFHQ/data/extracted_cropped_face_results/_-91nXXjrVo/Clip+_-91nXXjrVo+P0+C0+F1537-1825/*.png',
                '-i','/data/share/VFHQ/data/download_youtube/_-91nXXjrVo_cut.wav','-c:v','libx264','-pix_fmt','yuv420p','/data/share/VFHQ/data/download_youtube/_-91nXXjrVo_out.mp4'])



    


    [image2 @ 0x56001a8fee00] Could find no file with path '/data/share/VFHQ/data/extracted_cropped_face_results/_-91nXXjrVo/Clip+_-91nXXjrVo+P0+C0+F1537-1825/*.png' and index in the range 0-4
/data/share/VFHQ/data/extracted_cropped_face_results/_-91nXXjrVo/Clip+_-91nXXjrVo+P0+C0+F1537-1825/*.png: No such file or directory


    



    


    With out the quotation marks on the picture directory :

    


    CompletedProcess(args=['ffmpeg', '-framerate', '25', '-pattern_type', 'glob', '-i', '/data/share/VFHQ/data/extracted_cropped_face_results/_-91nXXjrVo/Clip+_-91nXXjrVo+P0+C0+F1537-1825/*.png', '-i', '/data/share/VFHQ/data/download_youtube/_-91nXXjrVo_cut.wav', '-c:v', 'libx264', '-pix_fmt', 'yuv420p', '/data/share/VFHQ/data/download_youtube/_-91nXXjrVo_out.mp4'], returncode=1)


    


    Unknown encoder 'libx264'

    


    with quotation marks around the picture directory (also the correct way to run in the terminal) :

    


    subprocess.run(['ffmpeg', '-framerate', '25','-pattern_type', 'glob', '-i',"'/data/share/VFHQ/data/extracted_cropped_face_results/_-91nXXjrVo/Clip+_-91nXXjrVo+P0+C0+F1537-1825/*.png'",
                '-i','/data/share/VFHQ/data/download_youtube/_-91nXXjrVo_cut.wav','-c:v','libx264','-pix_fmt','yuv420p','/data/share/VFHQ/data/download_youtube/_-91nXXjrVo_out.mp4'])


    


    '/data/share/VFHQ/data/extracted_cropped_face_results/_-91nXXjrVo/Clip+_-91nXXjrVo+P0+C0+F1537-1825/*.png': No such file or directory

    



    


    It was later found out that I have 2versions of ffmpeg. One is 4.3 the other is 4.4.2
The thing is running a subprocess with quotation marks (I know it is incorrect as it has been explained) will call v4.4.2. Running it without quotation marks will call the v4.3 ffmpeg.

    


    Also from V4.3 log, it suggests Reading option '-c:v' ... matched as option 'c' (codec name) with argument 'libx264'. but in the end

    


    [wav @ 0x55eaef48b240] After avformat_find_stream_info() pos: 204878 bytes read:294990 seeks:1 frames:50
Guessed Channel Layout for Input Stream #1.0 : stereo
Input #1, wav, from '/data/share/VFHQ/data/download_youtube/_-91nXXjrVo_cut.wav':
  Metadata:
    encoder         : Lavf58.45.100
  Duration: 00:00:11.44, bitrate: 1536 kb/s
    Stream #1:0, 50, 1/48000: Audio: pcm_s16le ([1][0][0][0] / 0x0001), 48000 Hz, stereo, s16, 1536 kb/s
Successfully opened the file.
Parsing a group of options: output url /data/share/VFHQ/data/download_youtube/_-91nXXjrVo_out.mp4.
Applying option c:v (codec name) with argument libx264.
Applying option pix_fmt (set pixel format) with argument yuv420p.
Successfully parsed a group of options.
Opening an output file: /data/share/VFHQ/data/download_youtube/_-91nXXjrVo_out.mp4.
Unknown encoder 'libx264'
[AVIOContext @ 0x55eaef487fc0] Statistics: 294990 bytes read, 1 seeks