Recherche avancée

Médias (0)

Mot : - Tags -/latitude

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

Autres articles (108)

  • Mise à jour de la version 0.1 vers 0.2

    24 juin 2013, par

    Explications des différents changements notables lors du passage de la version 0.1 de MediaSPIP à la version 0.3. Quelles sont les nouveautés
    Au niveau des dépendances logicielles Utilisation des dernières versions de FFMpeg (>= v1.2.1) ; Installation des dépendances pour Smush ; Installation de MediaInfo et FFprobe pour la récupération des métadonnées ; On n’utilise plus ffmpeg2theora ; On n’installe plus flvtool2 au profit de flvtool++ ; On n’installe plus ffmpeg-php qui n’est plus maintenu au (...)

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

  • Ecrire une actualité

    21 juin 2013, par

    Présentez les changements dans votre MédiaSPIP ou les actualités de vos projets sur votre MédiaSPIP grâce à la rubrique actualités.
    Dans le thème par défaut spipeo de MédiaSPIP, les actualités sont affichées en bas de la page principale sous les éditoriaux.
    Vous pouvez personnaliser le formulaire de création d’une actualité.
    Formulaire de création d’une actualité Dans le cas d’un document de type actualité, les champs proposés par défaut sont : Date de publication ( personnaliser la date de publication ) (...)

Sur d’autres sites (15342)

  • FFmpeg crop portrait video 1:1 from the top based on dynamic value

    8 avril 2022, par hugger

    I am replacing my video editing component with FFmpeg. So far it has been smooth until getting to this point where I need to crop my vertical (portrait) video to 1080x1080 with a dynamic value.

    


    Essentially, I built a custom component to do the cropping, where I can pan a square box over the video. the Y value for the pan is where I wish to cut the top part of the video.

    


    Here is the code I have tried, which works but is not cropping to my desired specs note : offsetDiff is the space I wish to remove from the top (pan px value) :

    


      cropSelected() {
    const diff =
      this.props.videoHeight / (this.state.aspectRatio * deviceWidth);
    const offsetDiff = this.state.offsetTopTranslate * diff;

    var path =
      this.props.type === 'photo'
        ? RNFS.DocumentDirectoryPath + '/after.png'
        : RNFS.DocumentDirectoryPath + '/after.mp4';

    var filterPath =
      this.props.type === 'photo'
        ? RNFS.DocumentDirectoryPath + '/afterFilter.png'
        : RNFS.DocumentDirectoryPath + '/afterFilter.mp4';

    FFmpegKit.execute(
      `-y -i ${path} -vf "crop=iw:1080:0:${offsetDiff}, scale=1080:1080" -qscale 0 ${filterPath}`,
    ).then(async session => {
      const returnCode = await session.getReturnCode();
      if (ReturnCode.isSuccess(returnCode)) {
        // SUCCESS
        this.setState({
          mediaSource:
            this.props.type === 'video'
              ? `file://${filterPath}?${new Date().getTime()}`
              : filterPath,
          isOpen: !this.state.isOpen,
          ffMPEGinProgress: null,
          aspectRatio: 1080 / 1080,
        });
      } else if (ReturnCode.isCancel(returnCode)) {
        // CANCEL
      } else {
        // ERROR
        alert('error');
      }
    });
  }


    


    Basically here I am trying to tell FFmpeg to keep the width (1080), make the height 1080, ignore X value, crop dynamic amount from the top.

    


    Here is what my cropper component looks like to get an idea.

    


    Visual of my cropped to get an idea

    


    I appreciate any help I can get here folks, cheers !

    


  • Is it safe to ignore the error "Invalid UTF-8 in decoded subtitles text ; maybe missing -sub_charenc option Error while decoding stream" ?

    30 avril 2022, par Clogged-artery

    I was encoding a video with subtitles and I got the error, "Invalid UTF-8 in decoded subtitles text ; maybe missing -sub_charenc option. Error while decoding stream" but the video encoded anyway. What are the consequences of ignoring this error ? A google search showed a result of one guy saying it skips that sub so the resulting video will have missing subs. Can someone confirm this ?

    


    I know how to fix it but I have already converted 50+ videos with subtitles and I'm fairly certain that a few of them had this error. I just want someone to tell me that it's okay to ignore so I don't have to watch 200 hours of videos.

    


    Solution for fixing subtitle errors :

    


    Create a batch file and edit with the following :

    


    for %%a in ("*.srt") do ffmpeg -v 9 -loglevel 99 -sub_charenc CP1252 -i "%%a" "newfiles\%%~na.srt"
pause


    


  • How can I automate the subtitle adding process in FFMPEG ?

    23 septembre 2022, par Phoeniqz

    The situation is, that I have 10 MP4 videos and a folder for each of them that has the same name as its video. In each of folders there are around 30 SRT files I need to add. I would like to automate this. I mean a script that would add each SRT file to the video and add the correct handler for the subtitles, so that the subtitle would appear as "English" instead of "Subtitle #12" in a movie player. I made a python script ; it's far from perfect and it does not add the handlers correctly.

    


    The name of each SRT file is something like "20_Hebrew.srt"

    


    

import os
file_dir = r"Path/to/my/files"
sub_dir = file_dir + "/Subs"


def add_sub(file, file_name):
    cmd = f"ffmpeg -i '{file}' "
    sub_list = []

    no_extension = file_name.replace(".mp4", "")

    for sub_name in os.listdir(sub_dir + f"/{no_extension}"):
        s = os.path.join(sub_dir + f"/{no_extension}", sub_name)

        if os.path.isfile(s):
            cmd += f"-i '{s}' "
            sub_list.append(s)
    
    cmd += "-map 0:v -map 0:a "

    for i, v in enumerate(sub_list):
        cmd += f"-map {i+1} "
    
    cmd += "-c:v copy -c:a copy "

    for i, v in enumerate(sub_list):
        sub_lang = v.replace(".srt", "")
        index = sub_lang.index(f"/Subs/")
        sub_lang = sub_lang[index:]
        index = sub_lang.index("_")
        sub_lang = sub_lang[index+1:]

        cmd += f"-c:s:{i} mov_text -metadata:s:s:{i} language='{sub_lang}' -metadata:s:s:{i} handler='{sub_lang}' "

    cmd += f"'{file}_OUTP.mp4'"

    os.system(cmd)

for file_name in os.listdir(file_dir):
    f = os.path.join(file_dir, file_name)

    if os.path.isfile(f):
        add_sub(f, file_name)