
Recherche avancée
Médias (91)
-
Spitfire Parade - Crisis
15 mai 2011, par
Mis à jour : Septembre 2011
Langue : English
Type : Audio
-
Wired NextMusic
14 mai 2011, par
Mis à jour : Février 2012
Langue : English
Type : Video
-
Video d’abeille en portrait
14 mai 2011, par
Mis à jour : Février 2012
Langue : français
Type : Video
-
Sintel MP4 Surround 5.1 Full
13 mai 2011, par
Mis à jour : Février 2012
Langue : English
Type : Video
-
Carte de Schillerkiez
13 mai 2011, par
Mis à jour : Septembre 2011
Langue : English
Type : Texte
-
Publier une image simplement
13 avril 2011, par ,
Mis à jour : Février 2012
Langue : français
Type : Video
Autres articles (53)
-
Submit enhancements and plugins
13 avril 2011If you have developed a new extension to add one or more useful features to MediaSPIP, let us know and its integration into the core MedisSPIP functionality will be considered.
You can use the development discussion list to request for help with creating a plugin. As MediaSPIP is based on SPIP - or you can use the SPIP discussion list SPIP-Zone. -
Script d’installation automatique de MediaSPIP
25 avril 2011, parAfin de palier aux difficultés d’installation dues principalement aux dépendances logicielles coté serveur, un script d’installation "tout en un" en bash a été créé afin de faciliter cette étape sur un serveur doté d’une distribution Linux compatible.
Vous devez bénéficier d’un accès SSH à votre serveur et d’un compte "root" afin de l’utiliser, ce qui permettra d’installer les dépendances. Contactez votre hébergeur si vous ne disposez pas de cela.
La documentation de l’utilisation du script d’installation (...) -
Demande de création d’un canal
12 mars 2010, parEn fonction de la configuration de la plateforme, l’utilisateur peu avoir à sa disposition deux méthodes différentes de demande de création de canal. La première est au moment de son inscription, la seconde, après son inscription en remplissant un formulaire de demande.
Les deux manières demandent les mêmes choses fonctionnent à peu près de la même manière, le futur utilisateur doit remplir une série de champ de formulaire permettant tout d’abord aux administrateurs d’avoir des informations quant à (...)
Sur d’autres sites (9321)
-
How get video output on hardware acceleration with VAAPI on FFMPEG ?
14 mai 2019, par HellBloodFor my project I have to use hardware acceleration with
VAAPI
usingFFMPEG
, the problem is that withVAAPI
we have to use the"vaapi_retrieve_data"
function to download the GPU data. This is time consuming and I would like to be able to directly view the video via the GPU. The program is inC language
and aims to decode videos. Do you have a solution to recover the output data without going through the function ?
Thank you in advance :)
Have a good day -
How to use AMD hardware acceleration VAAPI when using ffmpeg in qtcreator ? [closed]
28 décembre 2024, par Ling Yunffmpeg version:4.2.2
env:QT creator


I passed this command in terminal :


ffmpeg -hwaccel vaapi -vaapi_device /dev/dri/renderD128 -i input.mp4 -vf format=yuv420p,hwupload -c:v h264_vaapi -b:v 1000k output.mp4



This can be accelerated, the CPU usage is very low
But when I want to use code to implement hardware accelerated encoding, it prompts :


cannot allocate memory(-12)



my c++ code :


av_hwdevice_ctx_create = (&hw_device_ctx,AV_HWDEVICE_TYPE_VAAPI,"/dev/dri/renderD128");



print :-12


I can be sure that I compiled ffmpeg correctly because I can enable vaapi hardware acceleration through the command and my graphics card has enough video memory.


Possible causes :
I introduced -lavcodec -lavformat -lavutil -lswscale in my qt pro file libs, but did not add -lva -lva-drm


Is it correct to add -lva -lva-drm after libs ?
What should I do ?


-
Libavcodec (FFMPEG) D3D11 hardware acceleration not outputting hardware frames
12 juin 2024, par luckybromaThe Problem


I'm trying to get FFMPEG to output D3D11 2D textures directly as Frames. As I understand, this is infact possible. The reasoning for this, is I can then decode the YUV format directly on the GPU and then display it without having to Marshall it back to the CPU.


My problem is that I can't get the decoder to actually output frames in the desired format, they are always software
YUV420J
.

Is this because I'm not initializing the decoder properly ? Or perhaps there is some other configuration I'm missing.



The Details


I've been following the example for the most part, with a few minor differences :


- 

- I only have to deal with 1 format, raw h264, so I'm manually configuring the Decoder to use
AV_CODEC_ID_H264
- I've all ready initialized the D3DDevice and Context and so am using
av_hwdevice_ctx_init
overav_hwdevice_ctx_create
. (I have tried just usingav_hwdevice_ctx_create
and got the same results) - As mentioned earlier, I don't want to use
av_hwframe_transfer_data
because I want to keep the data on the GPU as a texture and immediately display it.








Here is my initialization code :


AVHWDeviceType type = AV_HWDEVICE_TYPE_D3D11VA;

 hw_pix_fmt = AV_PIX_FMT_D3D11;

 _codec = avcodec_find_decoder(AV_CODEC_ID_H264); // NOT SURE IF THIS IS THE HW SUPPORTED FMT
 
 int i;
 for (i = 0;; i++) {
 const AVCodecHWConfig* config = avcodec_get_hw_config(_codec, i);
 if (!config) {
 fprintf(stderr, "Decoder %s does not support device type %s.\n",
 _codec->name, av_hwdevice_get_type_name(type));
 return;
 }
 if (config->methods & AV_CODEC_HW_CONFIG_METHOD_HW_DEVICE_CTX &&
 config->device_type == type) {
 hw_pix_fmt = config->pix_fmt;
 break;
 }
 }

 if (!(_codecCtx = avcodec_alloc_context3(_codec))) {
 // ERROR!
 return;
 }

 _hw_device_ctx = av_hwdevice_ctx_alloc(type);

 _device_ctx = reinterpret_cast(_hw_device_ctx->data);
 _d3d11va_device_ctx = reinterpret_cast(_device_ctx->hwctx);
 _d3d11va_device_ctx->device = dev;

 _codecCtx->hw_device_ctx = av_buffer_ref(_hw_device_ctx);


 if (av_hwdevice_ctx_init(_codecCtx->hw_device_ctx) < 0) {
 return;
 }


 if (avcodec_open2(_codecCtx, _codec, NULL) < 0) {
 return;
 }

 _parser = av_parser_init(_codec->id);
 _packet = av_packet_alloc();



I'm doing the standard things to decode, and know it works because I've used software decoding just fine, but here it is anyway :


void Decoder::Load(std::vector data) {
 int data_size = data.size();

 int bytesRead = 0;
 int bytesParsed = 0;

 while (data_size > 0) {
 bytesParsed = av_parser_parse2(
 _parser,
 _codecCtx,
 &_packet->data,
 &_packet->size,
 (uint8_t*)&data[bytesRead],
 data.size() - bytesRead,
 AV_NOPTS_VALUE,
 AV_NOPTS_VALUE,
 0);

 bytesRead += bytesParsed;
 data_size -= bytesParsed;

 if (bytesParsed < 0) {
 //std::cout << "Error while parsing packet" << std::endl;
 return;
 }

 if (_packet->size) {
 int ret = avcodec_send_packet(_codecCtx, _packet);
 if (ret < 0) {
 //std::cout << "Error Sending Packet for Decoding" << std::endl;
 return;
 }

 while (ret >= 0) {
 AVFrame* frame = av_frame_alloc();
 ret = avcodec_receive_frame(_codecCtx, frame);

 if (frame->format != AV_PIX_FMT_D3D11) { // <--- THIS NEVER EVALUATES AS FALSE, IT'S ALWAYS THE YUV420J FORMAT, NOT THE HARDWARE FORMAT
 break;
 }

 if (ret == AVERROR(EAGAIN) || ret == AVERROR_EOF) {
 break;
 }
 else if (ret < 0) {
 //std::cout << "Error During Decoding" << std::endl;
 return;
 }

 _frameQueue.push(frame);
 }
 }
 }
}




How I built FFMPEG :


./../../sources/ffmpeg/configure \
 --prefix=./../../installed \
 --toolchain=msvc \
 --arch=x86_64 \
 --enable-yasm \
 --enable-asm \
 --enable-shared \
 --enable-dxva2 \
 --enable-d3d11va \
 --disable-static \
 --enable-gpl \
 --extra-ldflags="-LIBPATH:./../../installed/lib/" \
 --extra-cflags="-I./../../installed/include/"



- I only have to deal with 1 format, raw h264, so I'm manually configuring the Decoder to use