Recherche avancée

Médias (1)

Mot : - Tags -/embed

Autres articles (103)

  • MediaSPIP 0.1 Beta version

    25 avril 2011, par

    MediaSPIP 0.1 beta is the first version of MediaSPIP proclaimed as "usable".
    The zip file provided here only contains the sources of MediaSPIP in its standalone version.
    To get a working installation, you must manually install all-software dependencies on the server.
    If you want to use this archive for an installation in "farm mode", you will also need to proceed to other manual (...)

  • Personnaliser en ajoutant son logo, sa bannière ou son image de fond

    5 septembre 2013, par

    Certains 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 ;

  • Multilang : améliorer l’interface pour les blocs multilingues

    18 février 2011, par

    Multilang est un plugin supplémentaire qui n’est pas activé par défaut lors de l’initialisation de MediaSPIP.
    Après son activation, une préconfiguration est mise en place automatiquement par MediaSPIP init permettant à la nouvelle fonctionnalité d’être automatiquement opérationnelle. Il n’est donc pas obligatoire de passer par une étape de configuration pour cela.

Sur d’autres sites (12052)

  • doc : Rename avtools-common-opts to fftools-common opts

    9 septembre 2013, par Timothy Gu
    doc : Rename avtools-common-opts to fftools-common opts
    

    Signed-off-by : Timothy Gu <timothygu99@gmail.com>
    Signed-off-by : Michael Niedermayer <michaelni@gmx.at>

    • [DH] doc/ffmpeg.texi
    • [DH] doc/ffplay.texi
    • [DH] doc/ffprobe.texi
    • [DH] doc/ffserver.texi
    • [DH] doc/fftools-common-opts.texi
  • FFmpeg - resize by max width/height, keep aspect ratio and avoid "width/height not divisible by 2" error

    29 août 2020, par Eduard Unruh

    This is the code I'm using to resize the video to either max width 640 or max height 700 and keeping the aspect ratio :

    &#xA;

    ffmpeg/bin/ffmpeg.exe" -y -i ttt.mp4 -profile:v high -c:v libx264 -filter_complex "scale=iw*min(1\,min(640/iw\,700/ih)):-1" -acodec copy -maxrate 600k -bufsize 300k -crf 18 ttt2.mp4&#xA;

    &#xA;

    On some video I either get width not divisible by 2 or height not divisible by 2

    &#xA;

    I looked up that the solution would be :

    &#xA;

    -vf "crop=trunc(iw/2)*2:trunc(ih/2)*2"&#xA;

    &#xA;

    So I tried :

    &#xA;

    ffmpeg/bin/ffmpeg.exe" -y -i ttt.mp4 -profile:v high -c:v libx264 -filter_complex "scale=iw*min(1\,min(640/iw\,700/ih)):-1" -vf "crop=trunc(iw/2)*2:trunc(ih/2)*2" -acodec copy -maxrate 600k -bufsize 300k -crf 18 ttt2.mp4&#xA;

    &#xA;

    and get the error :

    &#xA;

    -vf/-af/-filter and -filter_complex cannot be used together for the same stream&#xA;

    &#xA;

    so how to do this ??

    &#xA;

  • Can I know which byte range to read from a remote mp4 file for FFMpeg to decode a keyframe ?

    12 octobre 2023, par db9117

    I need to decode a of keyframe of a video file (mp4, h264 encoded). I know the timestamp of the keyframe I want to extract/decode. I want to minimize amount of data being read in memory. For this, I need to know beforehand exactly the minimal byte range I would require that encompasses this keyframe. How do I know what is the minimal byte range in the whole mp4 byte stream I need to read in order to be able to decode the keyframe ?

    &#xA;

    I currently find the appropriate keyframe in the index_entries contained in the header. I get its byte position (pos attribute) and timestamp (timestamp attribute). I calculate the range as follows :

    &#xA;

    startBytes : minimum of :

    &#xA;

      &#xA;
    1. the pos of the keyframe
    2. &#xA;

    3. the pos of the nearest index entry in the audio stream happening at or before the keyframe's timestamp.
    4. &#xA;

    &#xA;

    This way when it's decoding the frame, if it also needs the audio content for demuxing, it would have it.

    &#xA;

    endBytes : maximum of :

    &#xA;

      &#xA;
    1. the pos of the next frame in the video stream's index, after the keyframe
    2. &#xA;

    3. the pos of the next frame in the audio stream's index after the timestamp of the wished keyframe.
    4. &#xA;

    &#xA;

    This way I know that I have everything up until the next frame in the index, which theoretically should be enough to decode the keyframe only.

    &#xA;

    I then read the appropriate byte range.

    &#xA;

    When I try to decode the frame, I run in a loop until I succeed :

    &#xA;

      &#xA;
    • avcodec_read_frame
    • &#xA;

    • avcodec_send_packet
    • &#xA;

    • avcodec_receive_frame
    • &#xA;

    &#xA;

    I ignore AVERROR(EAGAIN) errors.

    &#xA;

    avcodec_receive_frame fails multiple times with error AVERROR(EAGAIN) which I ignore, until it fails saying that the memory it wants to read isn't available (wants to read after endBytes). I explicitly tell it to fail if it wants to read more than it has already read.

    &#xA;

    Note : for other keyframes at other positions in other videos, it sometimes succeeds (probably because the range is big enough by chance), but it fails more often than not.

    &#xA;

    My question is : Why is the end of the range not enough to be able to decode only the one keyframe ? Is there any way to more precisely calculate the exact range in bytes I would need in order to decode a particular keyframe ?

    &#xA;