Recherche avancée

Médias (1)

Mot : - Tags -/net art

Autres articles (106)

  • Les autorisations surchargées par les plugins

    27 avril 2010, par

    Mediaspip core
    autoriser_auteur_modifier() afin que les visiteurs soient capables de modifier leurs informations sur la page d’auteurs

  • Ajouter notes et légendes aux images

    7 février 2011, par

    Pour pouvoir ajouter notes et légendes aux images, la première étape est d’installer le plugin "Légendes".
    Une fois le plugin activé, vous pouvez le configurer dans l’espace de configuration afin de modifier les droits de création / modification et de suppression des notes. Par défaut seuls les administrateurs du site peuvent ajouter des notes aux images.
    Modification lors de l’ajout d’un média
    Lors de l’ajout d’un média de type "image" un nouveau bouton apparait au dessus de la prévisualisation (...)

  • Taille des images et des logos définissables

    9 février 2011, par

    Dans 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 (...)

Sur d’autres sites (9776)

  • FFmpeg add caption to top of video like memes

    25 juin 2018, par Praveen Tamil

    I’m trying to add a top section to a video like we do for image memes. I’m using drawtext option for that but the text is wrapped in output video.

    Let’s say I have a video and I need to add the caption like this to the whole video. How can i achieve this ?

    Expected output
    Expected video output

    Resulted outputResulted output

    I use below command for above result

    ffmpeg -ss 20 -i  D:\21-03-2018\15271618235b06a3df9d5cb.mp4 -filter_complex "[0:v]pad=iw:ih+50:0:50:color=white, drawtext=text='Meme Top Text will go here but it\\\\\'s a long text with multi line option. Line 1 text \n line 2 text \n line 3 text':fix_bounds=true:fontfile=Arial.ttf:fontsize=30:fontcolor=black:x=(w-tw)/2:y=(50-th)/2" -vframes 1 D:\21-03-2018\output.jpg
  • OpenCV Encoding to H264 changing original RGB pixel values for gray images

    13 janvier 2020, par CristoJV

    I have the following issue :
    I’m creating a uniform gray color video (for testing) using OpenCV VideoWriter. The output video will reproduce a constant image where all the pixels must have the same value x (25, 51, 76,... and so on).
    When I generate the video using MJPG Encoder :

    vw = cv2.VideoWriter('./videos/input/gray1.mp4',
           cv2.VideoWriter_fourcc(*'MJPG'),
           fps,(resolution[1],resolution[0]))

    and read the output using the VideoCapture class, everything just works fine. I got a frame array with all pixel values set to (25,51,76 and so on).
    However when I generate the video using HEV1 (H.265) or also H264 :

    vw = cv2.VideoWriter('./videos/input/gray1.mp4',
           cv2.VideoWriter_fourcc(*'HEV1'),
           fps,(resolution[1],resolution[0]))

    I run into the following issue. The frame I got in BGR format follows the next configuration :

    • The blue channel value is the expected value (x) minus 4 (25-4=21, 51-4=47, 76-4=72, and so on).
    • The green channel is the expected value (x) minus 1 (25-1=24, 51-1=50, 76-1=75).
    • The red channel is the expected value (x) minus 3 (25-3=22, 51-3=48, 76-3=73).

    Notice that the value is reduced with a constant value of 4,1,3, independently of the pixel value (so there is a constant effect).
    What I could explain is a pixel value dependable feature, instead of a fixed one.
    What is worse is that if I choose to generate a video with frames consisting in every color (pixel values [255 0 0],[0 255 0] and [0 0 255]) I get the corresponding outputs values ([251 0 0],[0 254 0] and [0 0 252])
    I though that this relation was related to the grayscale Y value, where :

    Y = 76/256 * RED + 150/256 * GREEN + 29/256 * BLUE

    But this coefficients are not related with the output obtained. Maybe the problem is the reading with VideoCapture ?

    EDIT :
    In case that I want to have the same output value for the pixels (Ej : [10,10,10] experimentally I have to create a img where the red and blue channel has the green channel value plus 2 :

    value = 10
    img = np.zeros((resolution[0],resolution[1],3),dtype=np.uint8)+value
       img[:,:,2]=img[:,:,2]+2
       img[:,:,1]=img[:,:,1]+0
       img[:,:,0]=img[:,:,0]+2

    Anyone has experience this issue ? It is related to the encoding process or just that OpenCV treats the image differently, prior encoding, depending on the fourcc parameter value ?

  • Python UnicodeEncodeError : 'charmap' codec can't encode when using GEOPY

    23 février 2021, par Tony Roczz

    I have been fiddling with python geopy and I tried the basic commands given in the documentation. But I am getting the UnicodeEncodeError when trying the raw command(to geolocate a query to an address and coordinates)

    



    print(location.raw)


    



    Error UnicodeEncodeError: &#x27;charmap&#x27; codec can&#x27;t encode character &#x27;\xa9&#x27; in position 83: character maps to <undefined></undefined>

    &#xA;&#xA;

    Then I tried the other way around (To find the address corresponding to a set of coordinates)

    &#xA;&#xA;

    print(location.address)    &#xA;

    &#xA;&#xA;

    I am getting the same error UnicodeEncodeError: &#x27;charmap&#x27; codec can&#x27;t encode character &#x27;\u0101&#x27; in position 10: character maps to <undefined></undefined>

    &#xA;&#xA;

    I tried print((location.address).encode("utf-8")) , now am not getting any error but the output printed is like this b&#x27;NH39, Mirz\xc4\x81pur

    &#xA;&#xA;

    and when using print((location.raw).encode("utf-8")) I am getting error

    &#xA;&#xA;

    AttributeError: &#x27;dict&#x27; object has no attribute &#x27;encode&#x27;&#xA;

    &#xA;&#xA;

    Can anyone tell me what is going on here and what I should do to get a proper output ?

    &#xA;&#xA;

    Edit :(After being marked as duplicate)

    &#xA;&#xA;

    Based on the solution given in this problem I am reporting on how it does not solve my problem

    &#xA;&#xA;

    What I wanted to know is why do I get the UnicodeEncodeError when trying out the basic sample codings given in the documentation and it did answer for that.

    &#xA;&#xA;

    If I want to use it an application how do I solve the error and I cannot have the application running on separate IDE or send the output to a external file since my application will function based on the output from geopy, I want the application to run in the terminal as my other applications do.

    &#xA;