
Recherche avancée
Médias (1)
-
Collections - Formulaire de création rapide
19 février 2013, par
Mis à jour : Février 2013
Langue : français
Type : Image
Autres articles (50)
-
Taille des images et des logos définissables
9 février 2011, parDans beaucoup d’endroits du site, logos et images sont redimensionnées pour correspondre aux emplacements définis par les thèmes. L’ensemble des ces tailles pouvant changer d’un thème à un autre peuvent être définies directement dans le thème et éviter ainsi à l’utilisateur de devoir les configurer manuellement après avoir changé l’apparence de son site.
Ces tailles d’images sont également disponibles dans la configuration spécifique de MediaSPIP Core. La taille maximale du logo du site en pixels, on permet (...) -
Configuration spécifique d’Apache
4 février 2011, parModules spécifiques
Pour la configuration d’Apache, il est conseillé d’activer certains modules non spécifiques à MediaSPIP, mais permettant d’améliorer les performances : mod_deflate et mod_headers pour compresser automatiquement via Apache les pages. Cf ce tutoriel ; mode_expires pour gérer correctement l’expiration des hits. Cf ce tutoriel ;
Il est également conseillé d’ajouter la prise en charge par apache du mime-type pour les fichiers WebM comme indiqué dans ce tutoriel.
Création d’un (...) -
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 (...)
Sur d’autres sites (5805)
-
Android sws_scale RGB Frame taking long time and cause of latency in the video
17 avril 2018, par AJitI am reading frames from FFMPEG and try to directly draw to surface window in Native android, If i scale image to exact size what we are getting from camera and apply YUV420P to RGBA it take 1ms to scale through
av_image_fill_arrays
but if i try to scale image what i need for surface, then i take 25 to 30ms to scale same frame. so latency is the problem.In below example getting YUV420P pixel format.
Low latency :[ 1ms by sws_scale]
swsContext = sws_getContext(videoCodecContext->width,
videoCodecContext->height,
videoCodecContext->pix_fmt,
videoCodecContext->width,
videoCodecContext->height,
AV_PIX_FMT_RGB0,
SWS_FAST_BILINEAR, NULL, NULL, NULL);
av_image_fill_arrays()
av_read_frame()
avcodec_decode_video2(
sws_scale(swsContext,
(const uint8_t *const *) videoFrame->data,
videoFrame->linesize,
0,
videoCodecContext->height,
pictureFrame->data,
pictureFrame->linesize);
ANativeWindow_lock()
Write all buffer bytes to window.
ANativeWindow_unlockAndPost()Low latency :[ 30ms by sws_scale]
[videoContext Width: 848 Height: 608]
swsContext = sws_getContext(videoCodecContext->width,
videoCodecContext->height,
videoCodecContext->pix_fmt,
1080,
608,
AV_PIX_FMT_RGB0,
SWS_FAST_BILINEAR, NULL, NULL, NULL);Whenever we change context width and height other then videoContext it will take more then 30ms and we are delaying the video.
TRY 1 : Pass the buffer from JNI to Java and create bitmap there to scale later on but createBitmap itself take 500ms so no useful.
TRY 2 : Direct YUV420P to RGB conversion. still long time then
sws_scale
.TRY 3 : Direct write YUV to window bites but it show without color(If anyone have solution here will might helpful).
TRY 4 : Use
yuvlib
, no luck.TRY 5 : Different color combinations and flags in swsContext.
Any help would appreciated.
-
ffmpeg av_read_frame is blocked long time
10 avril 2018, par geeeekwhile (av_read_frame(pFormatCtx, packet) >= 0) {
if (packet->stream_index == videoindex) {
ret = avcodec_decode_video2(pCodecCtx, pFrame, &got_picture, packet);
if (ret < 0) {
printf("Decode Error.\n");
return -1;
}
printf("Succeed to decode 1 frame! %d\n", tt++);
}
av_packet_unref(packet);
}I am using ffmpeg to provide live audio/video RTSP streaming in android.
But I have a trouble from blocking av_read_frame function forever.
Android Log :I/libnav: Succeed to decode 1 frame! 70
I/libnav: Succeed to decode 1 frame! 71
I/libnav: Succeed to decode 1 frame! 72
I/libnav: Succeed to decode 1 frame! 73
I/libnav: Succeed to decode 1 frame! 74
I/libnav: Succeed to decode 1 frame! 75
blocking forever...Thus I
have experimented some code stuffs. I have copied Android jni code about ffmpeg to pc(ubuntu). Above my code is worked without any blocking.Succeed to decode 21122 frame!
Succeed to decode 21123 frame!
Succeed to decode 21124 frame!
...
without blocking ...I guess that this problem is about delay. I have removed avcodec_decode_video2 call in android jni. my code is executed without any blocking.
I have found ffmpeg av_read_frame() need very long time to stop threads. But it can’t help me.
If you have a similiar problem, please help me.
-
Elixir long running background task doesn't complete, sometimes crashes
29 mars 2018, par KulixAs a little bit of background, I have an endpoint that is responsible for video upload. What I want to do, is copy the video file to a temporary location from the request, and spin up an asynchronous task (ffmpeg shell process) to transcode that video in the background so that my endpoint can return a 200 in a timely manner, and the response does not wait for ffmpeg to finish transcoding that video.
Here is my code from the controller.
def create(conn, %{"file" => file ... })
uuid = Video.uuid()
tmp_path = Application.get_env(:myapp, :video_tmp_path) <> "/" <> uuid
:ok = File.cp(file.path, tmp_path)
VideoService.process(tmp_path, final_path)The inside of VideoService looks like the following.
defmodule MyApp.Services do
defmodule VideoService do
def process(tmp_path, final_path) do
Task.start_link fn ->
System.cmd("ffmpeg", ["-i", tmp_path, final_path, "-hide_banner"])
File.rm(tmp_path)
end
end
end
endThe problem I am having here is that no matter what, nothing past the
System.cmd("ffmpeg")
call executes in theVideoService
, and sometimes theSystem.cmd
call doesn’t even spin up anffmpeg
process. Am I doing something wrong here ? What I need is a way to spin thisffmpeg
shell process out in the background from the controller / service and respond with a 200 on video upload. Thanks for help in advance. I am new to elixir / OTP, so I’m sure I’m doing something stupid.I also randomly see the following error
erl_child_setup: failed with error 32 on line 240