Recherche avancée

Médias (1)

Mot : - Tags -/belgique

Autres articles (27)

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

  • Configuration spécifique d’Apache

    4 février 2011, par

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

  • Encodage et transformation en formats lisibles sur Internet

    10 avril 2011

    MediaSPIP transforme et ré-encode les documents mis en ligne afin de les rendre lisibles sur Internet et automatiquement utilisables sans intervention du créateur de contenu.
    Les vidéos sont automatiquement encodées dans les formats supportés par HTML5 : MP4, Ogv et WebM. La version "MP4" est également utilisée pour le lecteur flash de secours nécessaire aux anciens navigateurs.
    Les documents audios sont également ré-encodés dans les deux formats utilisables par HTML5 :MP3 et Ogg. La version "MP3" (...)

Sur d’autres sites (3468)

  • ffmpeg : is it nessesary to create a copy of original AVCodecContext to call avcodec_decode_video2 ?

    8 décembre 2015, par cgwic

    Should i use copy :

    videoCodecCtx = avcodec_alloc_context3(videoDecoder);
    avcodec_copy_context(videoCodecCtx, formatContext->streams[videoStreamIndex]->codec);
    ret = avcodec_open2(videoCodecCtx, videoDecoder, NULL);
    if (videoStreamIndex < 0) {
       avErrorMsg("Error opening video codec context", ret);
       goto exit;
    }

    or simply use existing codec context from AVFormatContext :

    videoCodecCtx = formatContext->streams[videoStreamIndex]->codec;
    ret = avcodec_open2(videoCodecCtx, videoDecoder, NULL);
    if (videoStreamIndex < 0) {
       avErrorMsg("Error opening video codec context", ret);
       goto exit;
    }

    In my case both works fine, but in old Dranger tutorial he creates a copy.
    And updated code uses existing AVCodecContext.

  • How do I combine PyTube audio and video streams in a Flask app and let the user download as one file without storing on the web server ?

    10 avril 2022, par AJB9384

    I'm building a YouTube downloader as a side project in Flask. It allows users to input a url and download the video without storing anything on the server I'm hosting on

    


    Lower quality videos can be sent to the user easily as they from PyTube as one file. I use the code below :

    


    import os
import flask
from flask import redirect, url_for, session, send_file
import requests

import pytube
from pytube import YouTube
from io import BytesIO

@app.route('/pull_videos', methods = ['GET', 'POST'])
def pull_videos(): 
  buffer=BytesIO()
  yt_test=YouTube('https://www.youtube.com/watch?v=NNNPgIfK2YE')
  video = yt_test.streams.get_by_itag(251)

  video.stream_to_buffer(buffer)
  buffer.seek(0)

  return send_file(buffer, as_attachment=True, download_name="Test video")


    


    However, I struggle when trying to pull in higher quality videos as they come in as separate audio and videos streams (see documentation here : https://pytube.io/en/latest/user/streams.html#)

    


    I am trying to use ffmpeg to combine the two and then send to the user, but the code below isn't working as expected and throws an error :

    


    Code :

    


    import os
import flask
from flask import redirect, url_for, session, send_file
import requests
import ffmpeg

import pytube
from pytube import YouTube
from io import BytesIO

@app.route('/pull_videos', methods = ['GET', 'POST'])
def pull_videos(): 
  buffer=BytesIO()
  
  video = yt_test.streams.get_by_itag(137)
  input_video = ffmpeg.input(video)
  
  audio = yt_test.streams.get_by_itag(137)
  input_audio = ffmpeg.input(audio)
  
  combined = ffmpeg.concat(input_video, input_audio, v=1, a=1)
  combined.stream_to_buffer(buffer)
  buffer.seek(0)

  return send_file(buffer, as_attachment=True, download_name="Test video")


    


    Error : AttributeError : 'FilterableStream' object has no attribute 'stream_to_buffer'

    


    How could I combine these audio and video streams from PyTube into one file for the user to download without storing on the server ?

    


  • How do I use gpg to verify an ffmpeg source snapshot download ? [closed]

    2 novembre 2024, par Neddie

    I downloaded two files :

    


    ffmpeg-snapshot.tar.bz2
ffmpeg-devel.asc


    


    The .asc file looks like this :

    


    -----BEGIN PGP PUBLIC KEY BLOCK-----

    


    mQENBE22rV0BCAC3DzRmA2XlhrqYv9HKoEvNHHf+PzosmCTHmYhWHDqvBxPkSvCl
...
+x8ETJgPoNK3kQoDagApj4qAt83Ayac3HzNIuEJ7LdvfINIOprujnJ9vH4n04XLg
I4EZ
=Rjbw
-----END PGP PUBLIC KEY BLOCK-----

    


    The command

    


    gpg --show-keys ffmpeg-devel.asc


    


    gives

    


    pub   rsa2048 2011-04-26 [SC]
      FCF986EA15E6E293A5644F10B4322F04D67658D8
uid                      FFmpeg release signing key <ffmpeg-devel@ffmpeg.org>
sub   rsa2048 2011-04-26 [E]


    


    The command

    


    gpg --verify ffmpeg-devel.asc ffmpeg-snapshot.tar.bz2


    


    gives output

    


    gpg: verify signatures failed: Unexpected error


    


    I tried decompressing the bz2 file and then

    


    gpg --verify ffmpeg-devel.asc ffmpeg-snapshot.tar


    


    and got the same error.

    


    What am I missing ?