
Recherche avancée
Médias (2)
-
Rennes Emotion Map 2010-11
19 octobre 2011, par
Mis à jour : Juillet 2013
Langue : français
Type : Texte
-
Carte de Schillerkiez
13 mai 2011, par
Mis à jour : Septembre 2011
Langue : English
Type : Texte
Autres articles (54)
-
Des sites réalisés avec MediaSPIP
2 mai 2011, parCette page présente quelques-uns des sites fonctionnant sous MediaSPIP.
Vous pouvez bien entendu ajouter le votre grâce au formulaire en bas de page. -
Les tâches Cron régulières de la ferme
1er décembre 2010, parLa gestion de la ferme passe par l’exécution à intervalle régulier de plusieurs tâches répétitives dites Cron.
Le super Cron (gestion_mutu_super_cron)
Cette tâche, planifiée chaque minute, a pour simple effet d’appeler le Cron de l’ensemble des instances de la mutualisation régulièrement. Couplée avec un Cron système sur le site central de la mutualisation, cela permet de simplement générer des visites régulières sur les différents sites et éviter que les tâches des sites peu visités soient trop (...) -
Publier sur MédiaSpip
13 juin 2013Puis-je poster des contenus à partir d’une tablette Ipad ?
Oui, si votre Médiaspip installé est à la version 0.2 ou supérieure. Contacter au besoin l’administrateur de votre MédiaSpip pour le savoir
Sur d’autres sites (9392)
-
Pointers returned by xlib don't match any existing window IDs
1er septembre 2022, par KroltanI'm using some X11 bindings to query some window information and later pass it to FFmpeg. FFmpeg expects a "window ID" given in hexadecimal notation.


This notation seems somewhat standard, as it is returned by programs like
xwininfo
orwmctrl
. I haven't found much information about it, but it seems to just be the hexadecimal representation of the window pointer ? If I take the ID string given by these programs and give it to FFmpeg, it is able to capture the window correctly :

$ xwininfo

xwininfo: Please select the window about which you
 would like information by clicking the
 mouse in that window.

xwininfo: Window id: 0x2800014 "Desktop — Plasma"

$ ffmpeg -f x11grab -window_id 0x2800014 -i :0+0,0 -f apng -vframes 1 out.png
# works fine



However, if I try listing all the windows in code :


var root = Window.None;
var parent = Window.None;
Xlib.XQueryTree(_display, Xlib.XDefaultRootWindow(_display), ref root, ref parent, out var children);

var ids = children
 .Select(ptr => $"0x{(ulong) ptr:x}")
 .ToArray();



I don't see
0x2800014
in the results (even disregardingleading zeroes), and if I try running FFmpeg on one of those results, it fails terribly :

$ ffmpeg -f x11grab -window_id 0x4400003 -i :0+0,0 -f apng -vframes 1

# snipped for brevity

Trailing option(s) found in the command: may be ignored.
[x11grab @ 0x55b811a8da40] Cannot get the image data event_error: response_type:0 error_code:8 sequence:10 resource_id:167772160 minor_code:4 major_code:130.
[x11grab @ 0x55b811a8da40] Continuing without shared memory.
[x11grab @ 0x55b811a8da40] Cannot get the image data event_error: response_type:0 error_code:8 sequence:11 resource_id:71303171 minor_code:0 major_code:73.
Input #0, x11grab, from ':0+0,0':
 Duration: N/A, bitrate: 38361 kb/s
 Stream #0:0: Video: rawvideo (BGR[0] / 0x524742), bgr0, 200x200, 38361 kb/s, 29.97 fps, 1000k tbr, 1000k tbn
At least one output file must be specified



So I must conclude my guess that they are hex pointers is incorrect, or that the
Window
type is not the pointer itself, but then the question stands, how can I get the actual window IDs so I can pass them to FFmpeg ?

-
PHP FFMPEG match Instagram aspect ratio requirements
19 mai 2021, par LinesofcodeAs stated here, the Instagram API requirements to upload a video are :


- Picture size
- - Maximum columns (horizontal pixels): 1920
- - Minimum aspect ratio [cols / rows]: 4 / 5
- - Maximum aspect ratio [cols / rows]: 16 / 9



I'm having some problems figuring it out if the aspect ratio matches. I grab the
width
andheight
of the video like this :

$ffprobe = \FFMpeg\FFProbe::create();
$video = $ffprobe->streams($file)->videos()->first();
$width = $video->get('width');
$height = $video->get('height');



And then I know the ratio by dividing the
width
byheight
.

The Instagram requirements about Portrait & Landscape videos are :


Portrait - min: 0.8 ; max: 0.99
Landscape - min: 1.01 ; max: 1.78



So why does a video of 848x480 (aspect ratio of 1.76) fails to upload to Instagram by returning "The video format is not supported" and how can I be completely sure that the aspect ratio matches the requirements before trying to upload ?


Edit


The full validation of Instagram requirements :


$video = $ffprobe->streams($file)->videos()->first();
$audio = $ffprobe->streams($file)->audios()->first();
$codec = $video->get('codec_name');
$frameRate = eval('return ' . $video->get('avg_frame_rate') . ';'); // 30/1 -> 30
$width = $video->get('width');
$height = $video->get('height');
$duration = $video->get('duration');

$ratio = round($width / $height, 3);

// Portrait
if ($width < $height)
 if ($ratio < 0.8 || $ratio > 0.99)
 return false;
 
// Landscape
if ($width > $height)
 if ($ratio < 1.01 || $ratio > 1.78)
 return false;


if (!in_array($codec, ['h264', 'hevc']))
 return false;

if ($frameRate < 23 || $frameRate > 60)
 return false;

if ($width > 1920)
 return false;

if ($duration < 3 || $duration > 60)
 return false;

if ($audio)
{
 $aCodec = $audio->get('codec_name');

 if ($aCodec != 'aac')
 return false;
}

return true;



Sample not uploading into Instagram :



-
FFmpeg and QuickTime Player dimensions of video do not match [duplicate]
31 mai 2020, par GRSI have a
video.mp4
, which I scaled using FFmpeg to getout.mp4
. The new video has the following probe :


{'streams': [{'index': 0,
 'codec_name': 'h264',
 'codec_long_name': 'H.264 / AVC / MPEG-4 AVC / MPEG-4 part 10',
 'profile': 'High',
 'codec_type': 'video',
 'codec_time_base': '1/50',
 'codec_tag_string': 'avc1',
 'codec_tag': '0x31637661',
 'width': 886,
 'height': 1920,
 'coded_width': 896,
 'coded_height': 1920,
 'has_b_frames': 2,
 'sample_aspect_ratio': '5120:1329',
 'display_aspect_ratio': '16:9',
 'pix_fmt': 'yuv420p',
 'level': 40,
 'chroma_location': 'left',
 'refs': 1,
 'is_avc': 'true',
 'nal_length_size': '4',
 'r_frame_rate': '25/1',
 'avg_frame_rate': '25/1',
 'time_base': '1/12800',
 'start_pts': 0,
 'start_time': '0.000000',
 'duration_ts': 384512,
 'duration': '30.040000',
 'bit_rate': '490832',
 'bits_per_raw_sample': '8',
 'nb_frames': '751',
 'disposition': {'default': 1,
 'dub': 0,
 'original': 0,
 'comment': 0,
 'lyrics': 0,
 'karaoke': 0,
 'forced': 0,
 'hearing_impaired': 0,
 'visual_impaired': 0,
 'clean_effects': 0,
 'attached_pic': 0,
 'timed_thumbnails': 0},
 'tags': {'language': 'und', 'handler_name': 'VideoHandler'}}],
 'format': {'filename': 'out.mp4',
 'nb_streams': 1,
 'nb_programs': 0,
 'format_name': 'mov,mp4,m4a,3gp,3g2,mj2',
 'format_long_name': 'QuickTime / MOV',
 'start_time': '0.000000',
 'duration': '30.040000',
 'size': '1852948',
 'bit_rate': '493461',
 'probe_score': 100,
 'tags': {'major_brand': 'isom',
 'minor_version': '512',
 'compatible_brands': 'isomiso2avc1mp41',
 'encoder': 'Lavf58.20.100'}}}




I am expecting my video player to say the video is 886 x 1920, however, it is 3413:1920.




What could be the error ? I am using
pix_frmt=yuva420p
andcodec=libx264
to create the video.


The error is that my ascpect ratio remains 16:9, which is the original input video, when it should automatically change to 9:19. E.g.
3413 = 1920 * 16 / 9
. So why isn't the ascpect ratio changed when the video is scaled ?