
Recherche avancée
Autres articles (54)
-
Participer à sa traduction
10 avril 2011Vous pouvez nous aider à améliorer les locutions utilisées dans le logiciel ou à traduire celui-ci dans n’importe qu’elle nouvelle langue permettant sa diffusion à de nouvelles communautés linguistiques.
Pour ce faire, on utilise l’interface de traduction de SPIP où l’ensemble des modules de langue de MediaSPIP sont à disposition. ll vous suffit de vous inscrire sur la liste de discussion des traducteurs pour demander plus d’informations.
Actuellement MediaSPIP n’est disponible qu’en français et (...) -
Les statuts des instances de mutualisation
13 mars 2010, parPour des raisons de compatibilité générale du plugin de gestion de mutualisations avec les fonctions originales de SPIP, les statuts des instances sont les mêmes que pour tout autre objets (articles...), seuls leurs noms dans l’interface change quelque peu.
Les différents statuts possibles sont : prepa (demandé) qui correspond à une instance demandée par un utilisateur. Si le site a déjà été créé par le passé, il est passé en mode désactivé. publie (validé) qui correspond à une instance validée par un (...) -
L’agrémenter visuellement
10 avril 2011MediaSPIP est basé sur un système de thèmes et de squelettes. Les squelettes définissent le placement des informations dans la page, définissant un usage spécifique de la plateforme, et les thèmes l’habillage graphique général.
Chacun peut proposer un nouveau thème graphique ou un squelette et le mettre à disposition de la communauté.
Sur d’autres sites (9747)
-
Bye Bye FATE Machine
4 septembre 2010, par Multimedia Mike — FATE ServerThis is the computer that performed the lion’s share of FATE cycles for the past 1.5 years before Mans put a new continuous integration system into service. I’ve now decided to let the machine go. I can’t get over how odd this feels since this thing is technically the best machine I own.
It’s a small form factor Shuttle PC (SD37P2 v2) ; Core 2 Duo 2.13 GHz ; 2 GB RAM ; 400 GB SATA HD ; equipped with the only consistently functional optical drive in my house (uh oh). I used it as my primary desktop from March 2007 – November 2008, at which point I repurposed it for FATE cycles.
As mentioned, the craziest part is that this is technically the best computer in my house. My new EeePC 1201PN isn’t at quite the same level ; my old EeePC can’t touch it, of course ; the Mac Mini has a little more RAM but doesn’t stack up in nearly all other areas. But the Shuttle just isn’t seeing that much use since the usurpation. I had it running automated backup duty for multimedia.cx but that’s easy enough to move to another, lower-powered system.
Maybe the prognosticators are correct and the PC industry has matured to the point where raw computing power simply doesn’t matter anymore. I fancy myself as someone who knows how to put CPU power to work but even I don’t know what to do with the computing capacity I purchased over 3 years ago.
Where will the Shuttle go ? A good home, I trust– I know a family that just arrived in the country and could use a computer.
-
Issue with image using ffmpeg to combining it on PHP
8 mai 2017, par 7sega7I’m trying to combine images with ffmpeg on PHP.
First, I save the image with this and resizing then :
$imagen = file_get_contents($_SESSION['img']);
file_put_contents('img_prod.jpg', $imagen);
$img = resize_imagejpg('img_prod.jpg', 650,360);
imagejpeg($img, 'img_prod.jpg');Then I create a png with only a title or info. At the moment I’m giving the text with a form, later I’ll do with BD.
For this I’m using the imagettftext :titulo = explode("-", $_SESSION['title']);
$im = imagecreatetruecolor(400, 30);
$white= imagecolorallocate($im, 255, 255, 255);
$black= imagecolorallocate($im, 0, 0, 0);
imagefilledrectangle($im, 0, 0, 399, 29, $white);
$font= 'Comfortaa.ttf';
imagettftext($im, 10, 0, 15, 10, $black, $font, $titulo[$i]);
imagepng($im, "img_con_texto.png");
imagedestroy($im);What I’m doing here is, first I get the Title for my form, and with the explode, every time I read a "-", I put all the text in another line. I simplified this on the code quote por easy read.
Then I create the color, I filled the all rectangle with one color, pick the font and put the font, color font and the text on a image and destroy the variable for using again with another text.At the end, I use ffmpeg to put the image for "file_get_contents" and the image with the text.
echo shell_exec('ffmpeg -y -i marco.png -i img_prod.jpg -filter_complex "overlay=20:(main_h-overlay_h)/2" out_img_prod.jpg')
The "marco.png" it is just a white image with no contents. I open paint, change the resize pixels for 850/480 and saving that as marco.png.
Then I add the text on the right side with the last image :
echo shell_exec('ffmpeg -y -i out_img_prod.jpg -i img_con_texto.png -filter_complex "overlay=500:140" prod_title.jpg');
The issue is that, when I do this, the text have a light gray color on the background. When I create the img with the text, It have white background color and it is a .png So I don’t know why It have that gray background color.
This is the image from the last code :If I did the same with paint or gimp, adding mannualy the text on the image on the left, the background gray color dissapear so, It is possible to quit that light grey color ?
PD : I quit some code for a simple read, so maybe I miss to quit variables. Also, If the img is more smaller and the text don’t collide with the text, the light gray color still there.
-
Render an IDirect3DSurface9 from DXVA2 ?
18 janvier 2019, par TTGroupI got a
IDirect3DSurface9
fromDXVA2
video decoder using hardware acceleration.I’m try to Render this hardware
IDirect3DSurface9
on My Window via its handle. The following is my summary code.The first, I call
dxva2_init(AVCodecContext *s, HWND hwnd)
; withhwnd
is window’s handleint dxva2_init(AVCodecContext *s, HWND hwnd)
{
InputStream *ist = (InputStream *)s->opaque;
int loglevel = (ist->hwaccel_id == HWACCEL_AUTO) ? AV_LOG_VERBOSE : AV_LOG_ERROR;
DXVA2Context *ctx;
int ret;
if (!ist->hwaccel_ctx) {
ret = dxva2_alloc(s);
if (ret < 0)
return ret;
}
ctx = (DXVA2Context *)ist->hwaccel_ctx;
ctx->deviceHandle = hwnd;
if (s->codec_id == AV_CODEC_ID_H264 &&
(s->profile & ~FF_PROFILE_H264_CONSTRAINED) > FF_PROFILE_H264_HIGH) {
av_log(NULL, loglevel, "Unsupported H.264 profile for DXVA2 HWAccel: %d\n", s->profile);
return AVERROR(EINVAL);
}
if (ctx->decoder)
dxva2_destroy_decoder(s);
ret = dxva2_create_decoder(s);
if (ret < 0) {
av_log(NULL, loglevel, "Error creating the DXVA2 decoder\n");
return ret;
}
return 0;
}After Decoding successful, I got got a
IDirect3DSurface9
, and I Render it by following function.int dxva2_render(AVCodecContext *s, AVFrame *frame)
{
LPDIRECT3DSURFACE9 surface = (LPDIRECT3DSURFACE9)frame->data[3];
InputStream *ist = (InputStream *)s->opaque;
DXVA2Context *ctx = (DXVA2Context *)ist->hwaccel_ctx;
try
{
lockRenderCS.Enter();
HRESULT hr = ctx->d3d9device->Clear(0, NULL, D3DCLEAR_TARGET, D3DCOLOR_XRGB(255, 0, 0), 1.0f, 0);
if (hr != D3D_OK)
return 0;
hr = ctx->d3d9device->BeginScene();
if (hr != D3D_OK)
return 0;
hr = ctx->d3d9device->GetBackBuffer(0, 0, D3DBACKBUFFER_TYPE_MONO, &pBackBuffer);
if (hr != D3D_OK)
return 0;
hr = ctx->d3d9device->StretchRect(surface, NULL, pBackBuffer, NULL, D3DTEXF_LINEAR);
if (hr != D3D_OK)
return 0;
hr = ctx->d3d9device->EndScene();
if (hr != D3D_OK)
return 0;
hr = ctx->d3d9device->Present(NULL, NULL, NULL, NULL);
if (hr != D3D_OK)
return 0;
}
finally
{
lockRenderCS.Leave();
}
return 0;
}Note : All D3D function above :
Clear(), BeginScene(), GetBackBuffer(), StretchRect(), EndScene(), Present()
were return Successful. But the frame was not display on My Window.I Guess that, I miss some code for integrated My Window Handle with
DXVA2Context
. In this code I only assign :ctx->deviceHandle = hwnd;
in functiondxva2_init()
.I search many times, but so far I still cannot find the solution, Anyone can help me ?
Many Thanks !