
Recherche avancée
Médias (1)
-
The pirate bay depuis la Belgique
1er avril 2013, par
Mis à jour : Avril 2013
Langue : français
Type : Image
Autres articles (21)
-
Supporting all media types
13 avril 2011, parUnlike most software and media-sharing platforms, MediaSPIP aims to manage as many different media types as possible. The following are just a few examples from an ever-expanding list of supported formats : images : png, gif, jpg, bmp and more audio : MP3, Ogg, Wav and more video : AVI, MP4, OGV, mpg, mov, wmv and more text, code and other data : OpenOffice, Microsoft Office (Word, PowerPoint, Excel), web (html, CSS), LaTeX, Google Earth and (...)
-
ANNEXE : Les plugins utilisés spécifiquement pour la ferme
5 mars 2010, parLe site central/maître de la ferme a besoin d’utiliser plusieurs plugins supplémentaires vis à vis des canaux pour son bon fonctionnement. le plugin Gestion de la mutualisation ; le plugin inscription3 pour gérer les inscriptions et les demandes de création d’instance de mutualisation dès l’inscription des utilisateurs ; le plugin verifier qui fournit une API de vérification des champs (utilisé par inscription3) ; le plugin champs extras v2 nécessité par inscription3 (...)
-
Encoding and processing into web-friendly formats
13 avril 2011, parMediaSPIP automatically converts uploaded files to internet-compatible formats.
Video files are encoded in MP4, Ogv and WebM (supported by HTML5) and MP4 (supported by Flash).
Audio files are encoded in MP3 and Ogg (supported by HTML5) and MP3 (supported by Flash).
Where possible, text is analyzed in order to retrieve the data needed for search engine detection, and then exported as a series of image files.
All uploaded files are stored online in their original format, so you can (...)
Sur d’autres sites (3651)
-
make ffmpeg chose Nvidia CUDA over Intel QSV (Windows 10 with two video adapters)
3 avril 2024, par Bart LedermanI just set up a 'new' PC with built-in Intel video and an Nvida card : mostly to speed up video processing with ffmpeg and other programs. At first the built-in Intel was disabled, running only the Nvidia card. ffmpeg worked as expected, the CPU could be used for decoding and encoding.


However : VirtualDub, a program I use frequently, has a problem with Nvidia cards (at least on Windows 10). The display gets screwed up, previews don't work, and all sorts of other problems occur. I tried all of the various discussion boards, and nobody has a good solution. (The problem is apparently split between VirtualDub and Nvidia, as all other programs such as VideoLan, Avidemux, HandBrake, OBS studio, etc, all appear to work fine.)


So I re-enabled the on-board Intel adapter, and made that my primary and only video with a monitor. The Nvidia card is still there, but with no monitor attached. I really only need it for hardware acceleration.


HandBrake and OBS Studio found the card and used it with no problem.


However, my batch file that specified cuda for both decoding and encoding failed to run. The ffmpeg command that includes -hwaccel cuda resulted in :


[h264 @ 000002783beaa700] Hardware is lacking required capabilities 
[h264 @ 000002783beaa700] Failed setup for format cuda: hwaccel initialisation returned error.



I also tried -hwaccel nvenc, which is rejected. It's apparently not a synonym in this version of ffmpeg :


ffmpeg version 4.3.1-2021-01-01-full_build-www.gyan.dev Copyright (c) 2000-2021 the FFmpeg developers built with gcc 10.2.0 (Rev5, 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-libsrt --enable-libssh --enable-libzmq --enable-avisynth --enable-libbluray --enable-libcaca --enable-sdl2 --enable-libdav1d --enable-libzvbi --enable-librav1e --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-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. 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 libswscale 5. 7.100 / 5. 7.100 libswresample 3. 7.100 / 3. 7.100 libpostproc 55. 7.100 / 55. 7.100



When I use QSV acceleration on my other PC I have to do this :


-init_hw_device qsv=qsv -hwaccel qsv



so I tried


-init_hw_device cuda=cuda -hwaccel cuda



but that didn't work either.


I've seen comments about the ability to select the GPU if there is more than one board installed, using the -gpu option. However, when I try to use -gpu 0 or -gpu 1 I get :


Codec AVOption gpu (Selects which NVENC capable GPU to use. First GPU is 0, second is 1, and so on.) specified for input file #0 (xxx.avi) is not a decoding option.


I looked at :


https://github.com/FFmpeg/FFmpeg/commit/527a1e213167123d24d014bc0b956ef43d9d6542


to get more information on -init_hw_device, but I'm sorry to say that what's on that page makes no sense to me at all. There are no examples, and no explanation of how to actually select a device.


I looked at :


https://docs.nvidia.com/video-technologies/video-codec-sdk/ffmpeg-with-nvidia-gpu/


which has an 'example' of -init_hw_device, and I did a cut and paste of what they had there to my batch file, but it was rejected.


I also looked at :


How to to burn subtitles based image on video using ’overlay_cuda’, ffmpeg video filter


which has two examples of how to initialize a cuda device, and they don't work for me either. -init_hw_device cuda=cuda is accepted without error, but then -hwaccel cuda still fails. Trying to use the hw accelerated filter scale_cuda also fails.


So how do I get the Nvidia card to decode video when it's not the only graphics adapter ? I was able to decode video when only the Nvidia card was active, there "must" be a way to get to it now. I just need to know how to tell ffmpeg to use the card that is there. Since it has no problem finding the card for encoding, shouldn't it also still be able to find the card for decoding and filters ? Or am I really the first person ever to have both Intel and Nvidia graphics adapters working on my system and trying to use ffmpeg with hardware acceleration ?


=====================


Latest update.


I had tried the examples on the Nvidia FFmpeg transcoding guide web page, and as mentioned previously I still got errors. I did a cut and paste from that web page to my command window, and ffmpeg still did not find the correct graphics adapter.


However, I do have a work-around. I don't particularly like it, but it works.


First : Windows (10) does not understand the concept of a graphics adapter that doesn't have a monitor attached to it. Even though graphics processors (specifically Nvidia) are available without the actual video output and are used in supercomputers and elsewhere to do high speed stream processing, Windows will not let you access the card settings if there is no monitor attached. The Nvidia control center also will not allow you to access any of the card's settings, and you can't set processor affinity.


So I connected a second monitor, and set up the Nvidia card as the primary.


Now ffmpeg -hwaccel cuda works the first time. The command I was using before :


ffmpeg -hide_banner -hwaccel cuda -i "input.avi" -c:a copy -ac 1 -c:v h264_nvenc -preset hq -movflags faststart -qp 30 "output.mp4"



Was failing because it couldn't find the Nvidia adapter. This command now works correctly the first time and uses hardware acceleration for both decode and encode. (The audio portion is irrelevant, if I also re-encode the audio the results are the same.)


With scaling, the command was like this :


ffmpeg -hide_banner -hwaccel cuda -i "input.avi" -c:a copy -ac 1 -c:v h264_nvenc -preset hq -vf "scale=640:480" -movflags faststart -qp 30 "output.mp4"



This works. However :


ffmpeg -hide_banner -hwaccel cuda -i "input.avi" -c:a copy -ac 1 -c:v h264_nvenc -preset hq -vf "scale_cuda=640:480" -movflags faststart -qp 30 "output.mp4



Fails with


Impossible to convert between the formats supported by the filter 'graph 0 input from stream 0:0' and the filter 'auto_scaler_0'
Error reinitializing filters!
Failed to inject frame into filter network: Function not implemented
Error while processing the decoded data for stream #0:0



I was able to get around this, by rearranging things in what seems to be to be an unnecessarily convoluted syntax.


ffmpeg -hide_banner -hwaccel cuvid -hwaccel_output_format cuda -i "input.avi" -c:a aac -b:a 192k -ar 48000 -vf "scale_cuda=856:480" -c:v h264_nvenc -preset hq -movflags faststart -qp 26 "output.mp4"



Having to specify the output format twice seems weird, but Task Manager shows near 100% Video Decode activity, and the time it takes to do this indicates to me that the scale_cuda filter is being used.


I don't particularly like having to use a second monitor (If VirtualDub worked properly I probably wouldn't have to), but I'm willing to live with it. It appears that if you have two different video cards and you want to use hardware acceleration on one of them it has to be the primary.


I haven't tested if Intel QSV is still accessible, nor have I tried switching the order of the graphics adapters back to completely verify the source of the problem, and I'm not really planning to do so (unless some of you think that would be useful). I get the definite impression that few people, if any, have tried to get both an Nvidia and an Intel adapter to provide hardware video acceleration on the same system. I will try to access QSV to see if using both accelerators is an improvement.


I can live with the weird command line to get the cuda filters to work, but if anyone knows a better way to do it I think it would be helpful to post it here for future reference if anyone else runs into a similar problem. None of the examples of using cuda accelerated filters that I've found on any of the many web sites I've read worked exactly as given.


==================


The good news :


It's possible to use both Nvidia and QSV hardware in at least some cases.


This command works :


ffmpeg -hide_banner -hwaccel dxva2 -i "input.avi" -c:a copy ^
 -c:v h264_qsv -vf "crop=1920:1044:0:0" -preset veryfast -profile:v high -level 4.1 -qp 22 "output.mp4"



Task Manager says Nvidia is decoding the input, and GPU-Z says Intel is also active, so it must be doing the encoding.


The bad news : I can't figure out a way to use both a CUDA filter and a standard filter in the same process.


This does not work :


ffmpeg -hide_banner -hwaccel cuvid -hwaccel_output_format cuda -i "input.avi" -c:a aac -b:a 192k -ar 48000 -vf "scale_cuda=856:480,crop=1280:696:0:24" -c:v h264_nvenc -preset hq -movflags faststart -qp 30 "output.mp4"



Reversing the order of scale_cuda and crop (with appropriate adjustments to the numbers) also does not work. There are errors about not being able to transfer the processing stream.


I will try the changes in the latest comment, but I think I may have tried it before and something didn't work. But I will check again.


In my web searches I have not found an example of 'mixed' filters.


I did see "-crop" and "-resize" on the Nvidia ffmpeg trancode web page similar to this :


–crop 0x36x0x0 –resize 1280x696



Once again, I did a cut and paste from the Nvidia web page to my command window and it didn't work. If there is a way to invoke the Nvidia command for these options that has been tested and found to actually work I would really like to see it.


-
Create a gif of given duration from a set of images with ffmpeg
7 septembre 2020, par LukeTheWalkerAt the moment I have a variable number of frame numerically ordered from
gif-00000.png
to the last frame namedgif-xxxxx.png
.

I'd like to create a gif using ffmpeg of exactly 25 seconds, which means changing according to the numbers of frames, the framerate of the gif.


Since I do not know the exact number of frames, is there an option to force the framerate to fit into a given duration ?


-
ffmpeg : how to correctly program input framerate calculation, given desired video length duration and output framerate ?
19 septembre 2015, par user89Let us say that I have
n
pictures named asimgXY.png
(whereXY
represent the numbers0
ton-1
, properly padded with zeros).From these, I would like to create a video that is
t
seconds long, that has an (output) framerateR
.I want to figure out what the input framerate should be, so I do the following calculation :
-
time spent per frame :
t_per_frame = t/n
-
input framerate :
1/t_per_frame = n/t
However, when I then try to create a movie using the following command :
ffmpeg -framerate n/t -i img%02d.png -r 30 test_output.mp4
I don’t get a movie that is
t
seconds long, and only two of the frames end up getting displayed. Why is this the case ?The following questions were unhelpful :
How to successfully use ffmpeg to convert images into videos
Turning images into videos with ffmpeg
I think I am misunderstanding what is meant by input framerate, and what is meant by output framerate. Could you help clarify ? I am using a Python script to call ffmpeg, as documented here : http://zulko.github.io/blog/2013/09/27/read-and-write-video-frames-in-python-using-ffmpeg/
Here’s the output from the following manually executed command :
ffmpeg -framerate 24/5 -i img%02d.png -c:v libx264 -r 30 -pix_fmt yuv420p test_output.mp4
ffmpeg version N-75204-g314bc20 Copyright (c) 2000-2015 the FFmpeg developers
built with gcc 4.9.3 (GCC)
configuration: --enable-gpl --enable-version3 --disable-w32threads --enable-av
isynth --enable-bzlib --enable-fontconfig --enable-frei0r --enable-gnutls --enab
le-iconv --enable-libass --enable-libbluray --enable-libbs2b --enable-libcaca --
enable-libdcadec --enable-libfreetype --enable-libgme --enable-libgsm --enable-l
ibilbc --enable-libmodplug --enable-libmp3lame --enable-libopencore-amrnb --enab
le-libopencore-amrwb --enable-libopenjpeg --enable-libopus --enable-librtmp --en
able-libschroedinger --enable-libsoxr --enable-libspeex --enable-libtheora --ena
ble-libtwolame --enable-libvidstab --enable-libvo-aacenc --enable-libvo-amrwbenc
--enable-libvorbis --enable-libvpx --enable-libwavpack --enable-libwebp --enabl
e-libx264 --enable-libx265 --enable-libxavs --enable-libxvid --enable-lzma --ena
ble-decklink --enable-opencl --enable-zlib
libavutil 55. 2.100 / 55. 2.100
libavcodec 57. 1.100 / 57. 1.100
libavformat 57. 0.100 / 57. 0.100
libavdevice 57. 0.100 / 57. 0.100
libavfilter 6. 1.100 / 6. 1.100
libswscale 4. 0.100 / 4. 0.100
libswresample 2. 0.100 / 2. 0.100
libpostproc 54. 0.100 / 54. 0.100
Input #0, image2, from 'img%02d.png':
Duration: 00:00:00.42, start: 0.000000, bitrate: N/A
Stream #0:0: Video: png, rgb24(pc), 800x400, 4.80 tbr, 4.80 tbn, 4.80 tbc
File 'test_output.mp4' already exists. Overwrite ? [y/N] y
[libx264 @ 0000000004f16ba0] using cpu capabilities: MMX2 SSE2Fast SSSE3 SSE4.2
AVX FMA3 AVX2 LZCNT BMI2
[libx264 @ 0000000004f16ba0] profile High, level 3.0
[libx264 @ 0000000004f16ba0] 264 - core 148 r2597 e86f3a1 - H.264/MPEG-4 AVC cod
ec - Copyleft 2003-2015 - http://www.videolan.org/x264.html - options: cabac=1 r
ef=3 deblock=1:0:0 analyse=0x3:0x113 me=hex subme=7 psy=1 psy_rd=1.00:0.00 mixed
_ref=1 me_range=16 chroma_me=1 trellis=1 8x8dct=1 cqm=0 deadzone=21,11 fast_pski
p=1 chroma_qp_offset=-2 threads=12 lookahead_threads=2 sliced_threads=0 nr=0 dec
imate=1 interlaced=0 bluray_compat=0 constrained_intra=0 bframes=3 b_pyramid=2 b
_adapt=1 b_bias=0 direct=1 weightb=1 open_gop=0 weightp=2 keyint=250 keyint_min=
25 scenecut=40 intra_refresh=0 rc_lookahead=40 rc=crf mbtree=1 crf=23.0 qcomp=0.
60 qpmin=0 qpmax=69 qpstep=4 ip_ratio=1.40 aq=1:1.00
Output #0, mp4, to 'test_output.mp4':
Metadata:
encoder : Lavf57.0.100
Stream #0:0: Video: h264 (libx264) ([33][0][0][0] / 0x0021), yuv420p, 800x40
0, q=-1--1, 30 fps, 15360 tbn, 30 tbc
Metadata:
encoder : Lavc57.1.100 libx264
Stream mapping:
Stream #0:0 -> #0:0 (png (native) -> h264 (libx264))
Press [q] to stop, [?] for help
frame= 12 fps=0.0 q=-1.0 Lsize= 3kB time=00:00:00.33 bitrate= 62.2kbits
/s dup=10 drop=0
video:2kB audio:0kB subtitle:0kB other streams:0kB global headers:0kB muxing ove
rhead: 60.557274%
[libx264 @ 0000000004f16ba0] frame I:1 Avg QP:10.12 size: 566
[libx264 @ 0000000004f16ba0] frame P:3 Avg QP:18.10 size: 62
[libx264 @ 0000000004f16ba0] frame B:8 Avg QP:13.75 size: 22
[libx264 @ 0000000004f16ba0] consecutive B-frames: 8.3% 0.0% 25.0% 66.7%
[libx264 @ 0000000004f16ba0] mb I I16..4: 99.4% 0.0% 0.6%
[libx264 @ 0000000004f16ba0] mb P I16..4: 0.0% 0.0% 0.0% P16..4: 0.0% 0.0
% 0.0% 0.0% 0.0% skip:99.9%
[libx264 @ 0000000004f16ba0] mb B I16..4: 0.0% 0.0% 0.0% B16..8: 0.1% 0.0
% 0.0% direct: 0.0% skip:99.9% L0:37.5% L1:62.5% BI: 0.0%
[libx264 @ 0000000004f16ba0] 8x8 transform intra:0.0% inter:0.0%
[libx264 @ 0000000004f16ba0] coded y,uvDC,uvAC intra: 0.6% 0.0% 0.0% inter: 0.0%
0.0% 0.0%
[libx264 @ 0000000004f16ba0] i16 v,h,dc,p: 96% 0% 4% 0%
[libx264 @ 0000000004f16ba0] i4 v,h,dc,ddl,ddr,vr,hd,vl,hu: 29% 18% 36% 2% 2%
3% 3% 5% 1%
[libx264 @ 0000000004f16ba0] i8c dc,h,v,p: 100% 0% 0% 0%
[libx264 @ 0000000004f16ba0] Weighted P-Frames: Y:0.0% UV:0.0%
[libx264 @ 0000000004f16ba0] ref P L0: 50.0% 50.0%
[libx264 @ 0000000004f16ba0] kb/s:18.50 -