Recherche avancée

Médias (0)

Mot : - Tags -/optimisation

Aucun média correspondant à vos critères n’est disponible sur le site.

Autres articles (81)

  • Organiser par catégorie

    17 mai 2013, par

    Dans MédiaSPIP, une rubrique a 2 noms : catégorie et rubrique.
    Les différents documents stockés dans MédiaSPIP peuvent être rangés dans différentes catégories. On peut créer une catégorie en cliquant sur "publier une catégorie" dans le menu publier en haut à droite ( après authentification ). Une catégorie peut être rangée dans une autre catégorie aussi ce qui fait qu’on peut construire une arborescence de catégories.
    Lors de la publication prochaine d’un document, la nouvelle catégorie créée sera proposée (...)

  • Récupération d’informations sur le site maître à l’installation d’une instance

    26 novembre 2010, par

    Utilité
    Sur le site principal, une instance de mutualisation est définie par plusieurs choses : Les données dans la table spip_mutus ; Son logo ; Son auteur principal (id_admin dans la table spip_mutus correspondant à un id_auteur de la table spip_auteurs)qui sera le seul à pouvoir créer définitivement l’instance de mutualisation ;
    Il peut donc être tout à fait judicieux de vouloir récupérer certaines de ces informations afin de compléter l’installation d’une instance pour, par exemple : récupérer le (...)

  • De l’upload à la vidéo finale [version standalone]

    31 janvier 2010, par

    Le chemin d’un document audio ou vidéo dans SPIPMotion est divisé en trois étapes distinctes.
    Upload et récupération d’informations de la vidéo source
    Dans un premier temps, il est nécessaire de créer un article SPIP et de lui joindre le document vidéo "source".
    Au moment où ce document est joint à l’article, deux actions supplémentaires au comportement normal sont exécutées : La récupération des informations techniques des flux audio et video du fichier ; La génération d’une vignette : extraction d’une (...)

Sur d’autres sites (4237)

  • ffmpeg transconding one input video stream and multiple output video streams in the same file

    13 mars 2013, par user2165262

    I am trying to transcode a single video file with 1 video stream and several audio streams to the file having same video stream in different bitrates/sizes with correct padding at the same time.

    the command I use is :

        ffmpeg -y -ss 600 -t 600 -i "INPUT.mkv" -map_chapters -1 -map 0:0 -c:v libx264 -keyint_min 48 -g 96 -bufsize 350k -b:v 350k -minrate 300k -maxrate 400k -profile:v baseline -level 3.0 -preset slow -vf "scale=iw*min(480/iw\,272/ih):ih*min(480/iw\,272/ih),pad=480:272 :(480-iw)/2 :(272-ih)/2" -map 0:0 -c:v libx264 -keyint_min 48 -g 96 -bufsize 650k -b:v 650k -minrate 500k -maxrate 800k -profile:v baseline -level 3.1 -preset slow -vf "scale=iw*min(640/iw\,360/ih):ih*min(640/iw\,360/ih),pad=640:360 :(640-iw)/2 :(360-ih)/2" -map 0:1 -c:a libfaac -b:a 32k -ar 44100 -f mpegts OUTPUT.m2ts
    

    ffmpeg creates two video streams, however the bitrate and resolution for all of them are taken from the last video arguments - i.e. both streams are 640x360 :

        Output #0, mpegts, to 'OUTPUT.m2ts' :
        Stream #0:0(eng) : Video : h264, yuv420p, 640x360 [SAR 559:560 DAR 559:315], q=-1—1, 650 kb/s,     Stream #0:1(eng) : Video : h264, yuv420p, 640x360 [SAR 559:560 DAR 559:315], q=-1—1, 650 kb/s, 90k tbn, 23.98 tbc (default)
        Stream #0:2(rus) : Audio : aac, 44100 Hz, 5.1, s16, 32 kb/s (default)
        Stream mapping :
        Stream #0:0 -> #0:0 (h264 -> libx264)
        Stream #0:0 -> #0:1 (h264 -> libx264)
        Stream #0:1 -> #0:2 (aac -> libfaac)
        Press [q] to stop, [?] for help
    

    Is it practically possible to make transcoding to several bitrates to the same file ?

  • Check audio and video codec from base64 video file in Django

    6 juillet 2024, par mahmudsajib

    I'm currently working on a Django project where I need to check the audio and video codec of a base64-encoded video file. To achieve this, I've implemented a function that decodes the base64 string into binary data and then attempts to load the video clip using MoviePy. However, I'm encountering an AttributeError: '_io.BytesIO' object has no attribute 'endswith' when trying to run the code.

    


    Here's the relevant part of the code :

    


    import base64
from io import BytesIO
from moviepy.editor import VideoFileClip

def get_video_codec_info(base64_data):
    # Decode base64 string into binary data
    _format, _file_str = base64_data.split(";base64,")
    binary_data = base64.b64decode(_file_str)

    # Load the video clip using MoviePy
    clip = VideoFileClip(BytesIO(binary_data))

    # Get information about the video codec
    codec_info = {
        'video_codec': clip.video_codec,
        'audio_codec': clip.audio_codec,
    }

    return codec_info


    


    The error occurs at the line clip = VideoFileClip(BytesIO(binary_data)) and it seems related to the use of BytesIO. I've tried to find a solution, but I'm stuck at the moment.

    


    Any suggestions on how to resolve this issue or alternative approaches to check the audio and video codec of a base64-encoded video file in Django would be greatly appreciated. Thanks !

    


  • FFmpeg - Turn a 1280x720 video into 720x1280 video and add blur

    6 janvier 2021, par offish

    I've searched around and found multiple solutions. I've found one that works well, but the final video ends up being too big which makes the rendering slow.

    


    I'm giving it a 1280x720 video and want it to turn out like shown here with 720x1280 as the resolution.

    


    -lavfi "[0:v]scale=256/81*iw:256/81*ih,boxblur=luma_radius=min(h\,w)/40:luma_power=3:chroma_radius=min(cw\,ch)/40:chroma_power=1[bg];[bg][0:v]overlay=(W-w)/2:(H-h)/2,setsar=1,crop=w=iw*81/256"


    


    This video ends up being 1280x2274 instead of 720x1280, everything else is fine except the speed and resolution.

    


    -lavfi [0:v]scale=16/9*iw:16/9*ih,boxblur=luma_radius=min(h\,w)/40:luma_power=3:chroma_radius=min(cw\,ch)/40:chroma_power=1[bg];[bg][0:v]overlay=(W-w)/2:(H-h)/2,setsar=1,crop=w=720:h=1280


    


    This cuts the original video, but ends up being 720x1280, faster than the first solution.

    


    -lavfi "[0:v]scale=256/81*iw:256/81*ih,boxblur=luma_radius=min(h\,w)/40:luma_power=3:chroma_radius=min(cw\,ch)/40:chroma_power=1[bg];[bg][0:v]overlay=(W-w)/2:(H-h)/2,setsar=1,crop=w=iw*81/256,scale=720:1280"


    


    This is the same as the first one, but it gets scaled again. It has the correct resolution, but is way to slow for my liking (only about 3.6 it/s, when I've tried other solutions which fluctuates around 35 it/s).

    


    I guess my scaling is wrong, but I don't understand what I should multiply and divide by, to get the result I'm looking for.

    


    Thanks.