
Recherche avancée
Médias (1)
-
The Great Big Beautiful Tomorrow
28 octobre 2011, par
Mis à jour : Octobre 2011
Langue : English
Type : Texte
Autres articles (112)
-
Personnaliser en ajoutant son logo, sa bannière ou son image de fond
5 septembre 2013, parCertains thèmes prennent en compte trois éléments de personnalisation : l’ajout d’un logo ; l’ajout d’une bannière l’ajout d’une image de fond ;
-
Websites made with MediaSPIP
2 mai 2011, parThis page lists some websites based on MediaSPIP.
-
Creating farms of unique websites
13 avril 2011, parMediaSPIP platforms can be installed as a farm, with a single "core" hosted on a dedicated server and used by multiple websites.
This allows (among other things) : implementation costs to be shared between several different projects / individuals rapid deployment of multiple unique sites creation of groups of like-minded sites, making it possible to browse media in a more controlled and selective environment than the major "open" (...)
Sur d’autres sites (15305)
-
BGRA to YUV420 FFmpeg giving bad output
6 octobre 2020, par NewbieCoderMy purpose is a screen recorder. I am using the Windows DXGI API to receive screenshots and I'm encoding the screenshots into a video using libx264. Feeding BGRA images directly to libx264 is producing weird colors in the output video. So, to get correct colors, I am trying to convert the BGRA to YUV420p. To speed up encoding, I am also trying to downscale the BGRA image.


So I am getting an 1920x1080 BGRA image and I want to convert it to 1280x720 YUV420p. For this, I am using FFmpeg swscale library to do both the format conversion and downscaling.


The problem is that the output video is coming like 3 images in the same frame. Please see this video. https://imgur.com/a/EYimjrJ


I tried just BGRA to YUV conversion without any downscaling and it is working fine. But BGRA to YUV with downscaling is giving this problem.


What is the cause for this problem ? How do I fix it ?


Here is my code snippet :


uint8_t* Image;
x264_picture_t picIn, picOut;
x264_picture_alloc(&picIn, X264_CSP_I420, 1280, 720);

SwsContext* sws = sws_getContext(1920, 1080, AV_PIX_FMT_BGRA, 1280, 720, AV_PIX_FMT_YUV420P, SWS_BILINEAR, NULL, NULL, NULL);

while (true)
{
 take_screenshot(&Image);

 AVFrame BGRA;
 BGRA.linesize[0] = 1280 * 4;
 BGRA.data[0] = Image;
 sws_scale(sws, BGRA.data, BGRA.linesize, 0, 1080, picIn.img.plane, picIn.img.i_stride);

 nal_size = x264_encoder_encode(h, &nals, &nal_count, &picIn, &picOut);
 save_to_flv(nals, nal_size, nal_count);
}



Here are my libx264 parameters :


x264_param_default_preset(&param, preset, 0);
 param.i_csp = X264_CSP_I420;
 param.i_width = 1280;
 param.i_height = 720;
 param.i_fps_num = 30;
 param.i_fps_den = 1;
 param.rc.i_bitrate = 2500;
 param.i_bframe = 0;
 param.b_repeat_headers = 0;
 param.b_annexb = 1; 

 x264_param_apply_profile(&param, 0);
 h = x264_encoder_open(&param);



-
BGRA to YUV420 FFmpeg giving bad output
6 octobre 2020, par NewbieCoderMy purpose is a screen recorder. I am using the Windows DXGI API to receive screenshots and I'm encoding the screenshots into a video using libx264. Feeding BGRA images directly to libx264 is producing weird colors in the output video. So, to get correct colors, I am trying to convert the BGRA to YUV420p. To speed up encoding, I am also trying to downscale the BGRA image.


So I am getting an 1920x1080 BGRA image and I want to convert it to 1280x720 YUV420p. For this, I am using FFmpeg swscale library to do both the format conversion and downscaling.


The problem is that the output video is coming like 3 images in the same frame. Please see this video. https://imgur.com/a/EYimjrJ


I tried just BGRA to YUV conversion without any downscaling and it is working fine. But BGRA to YUV with downscaling is giving this problem.


What is the cause for this problem ? How do I fix it ?


Here is my code snippet :


uint8_t* Image;
x264_picture_t picIn, picOut;
x264_picture_alloc(&picIn, X264_CSP_I420, 1280, 720);

SwsContext* sws = sws_getContext(1920, 1080, AV_PIX_FMT_BGRA, 1280, 720, AV_PIX_FMT_YUV420P, SWS_BILINEAR, NULL, NULL, NULL);

while (true)
{
 take_screenshot(&Image);

 AVFrame BGRA;
 BGRA.linesize[0] = 1280 * 4;
 BGRA.data[0] = Image;
 sws_scale(sws, BGRA.data, BGRA.linesize, 0, 1080, picIn.img.plane, picIn.img.i_stride);

 nal_size = x264_encoder_encode(h, &nals, &nal_count, &picIn, &picOut);
 save_to_flv(nals, nal_size, nal_count);
}



Here are my libx264 parameters :


x264_param_default_preset(&param, preset, 0);
 param.i_csp = X264_CSP_I420;
 param.i_width = 1280;
 param.i_height = 720;
 param.i_fps_num = 30;
 param.i_fps_den = 1;
 param.rc.i_bitrate = 2500;
 param.i_bframe = 0;
 param.b_repeat_headers = 0;
 param.b_annexb = 1; 

 x264_param_apply_profile(&param, 0);
 h = x264_encoder_open(&param);



-
Android gcc 4.6 crash on __check_for_sync8_kernelhelper - ARM - FFmpeg
3 août 2013, par user2646692I'm compiling ffmpeg with gcc 4.6 (as this is default on ndk r9) for armv7-a devices and a weird crash occurs on certain devices that didn't happen when running code compiled with gcc 4.4.3.
this is the backtrace :
08-02 18:36:08.200: I/sec_anm_ahi_output(1535): setParameters(stop_output_streamtype=1)
08-02 18:36:08.360: I/DEBUG(18804): #00 pc 000162a0 /system/lib/libc.so (__libc_android_abort)
08-02 18:36:08.360: I/DEBUG(18804): #01 pc 00418334 /data/data/com.ffmpeg.android/lib/libffmpeg.so (__check_for_sync8_kernelhelper)
08-02 18:36:08.360: I/DEBUG(18804): libc base address: afd00000After searching on google, it seems the problem is in 64-bit atomic as it seems my compiled code it's not using dmb instructions instead it's calling kernelhelper :
https://code.google.com/p/android/issues/detail?id=41297
http://www.ogre3d.org/forums/viewtopic.php?f=21&t=78199
The workaround it's to compile for armv7-a, but I'm already doing this with the same results. These are the flags I'm using :
CPU=armv7-a
OPTIMIZE_CFLAGS="-march=$CPU -mcpu=cortex-a8 -mfpu=neon -mfloat-abi=softfp -mthumb -D__thumb__"
EXTRA_LDFLAGS="-Wl,--fix-cortex-a8 -march=armv7-a"
PREFIX=./android/$CPU
EXTRA_CONFIGURE=""I have also tried with these, but with same results :
CPU=armv7-a
OPTIMIZE_CFLAGS="-march=$CPU -mcpu=cortex-a8 -mfpu=neon -mfloat-abi=softfp -mthumb -D__thumb__"
EXTRA_LDFLAGS="-Wl,--fix-cortex-a8 -march=armv7-a"
PREFIX=./android/$CPU
EXTRA_CONFIGURE="--disable-armv5te --disable-armv6 --disable-armv6t2"I have tested on different devices and these are the results :
Nexus 4 - No Crash
Nexus 7 - No crash
Galaxy sII - Crash
Galaxy Ace 2 - Crash
I would appreciate any help.
Thanks.