Recherche avancée

Médias (91)

Autres articles (77)

  • Use, discuss, criticize

    13 avril 2011, par

    Talk to people directly involved in MediaSPIP’s development, or to people around you who could use MediaSPIP to share, enhance or develop their creative projects.
    The bigger the community, the more MediaSPIP’s potential will be explored and the faster the software will evolve.
    A discussion list is available for all exchanges between users.

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

Sur d’autres sites (5384)

  • shell scripting no such file or directory

    15 mars 2018, par Toto Tata

    I wrote a shell script that calls the ffmpeg tool but when I run it, it says No such file or directory yet it does !

    Here is my script :

    #!/bin/bash

    MAIN_DIR="/media/sf_data/pipeline"

    FFMPEG_DIR="/media/sf_data/livraison_transcripts/ffmpeg-git-20180208-64bit-static"

    for file in MAIN_DIR/audio_mp3/*.mp3;
    do
       cp -p file FFMPEG_DIR;
    done

    for file in FFMPEG_DIR/*.mp3;
    do
       ./ffmpeg -i ${file%.mp3}.ogg
       sox $file -t raw --channels=1 --bits=16 --rate=16000 --encoding=signed-
    integer --endian=little ${file%.ogg}.raw;
    done

    for file in FFMPEG_DIR/*.raw;
    do
       cp -p file MAIN_DIR/pipeline/audio_raw/;
    done

    and here is the debug response :

    cp: cannot stat ‘file’: No such file or directory
    ./essai.sh: line 14: ./ffmpeg: No such file or directory
    sox FAIL formats: can't open input file `FFMPEG_DIR/*.mp3': No such file or
    directory
    cp: cannot stat ‘file’: No such file or directory

    FYI I’m running CentOS7 on VirtualBox

    Thank you

  • Is every instance of subprocess.Popen() its own shell ?

    26 avril 2021, par saa-sof

    Background :
I'm trying to make an application that plays music via a GUI (Tkinter), Youtube_DL and FFmpeg. While the actual application is done it also requires FFmpeg to be an environment variable to work. Now, I'm trying to foolproof the creation of a "personal" FFmpeg environment variable in order to make the application portable (the last step is using pyinstaller to make a .exe file).

    


    Problem :
I'm trying to create the environment variable for FFmpeg by passing SET through subprocess.Popen :

    


    add_ffmpeg = subprocess.Popen(f"IF EXIST {path2set} SET PATH=%PATH%;{path2set}", shell=True)


    


    When I try to echo %PATH% (with Popen) the FFmpeg variable that should be present, is not. I just need to know whether or not I'm wasting my time with SET and should instead be using SETX or perhaps some other solution, I'm open to being told I did this all wrong.

    


    Relevant Code :

    


    # get any sub-directory with ffmpeg in it's name
ffmpeg = glob(f"./*ffmpeg*/")

# proceed if there is a directory
if len(ffmpeg) > 0:
    # double-check directory exists
    ffmpeg_exist = path.isdir(ffmpeg[0])

    if ffmpeg_exist:
        print("FFmpeg: Found -> Setting Up")
        
        # get the absolute path of the directories bin folder ".\ffmpeg-release-essentials.zip\bin"
        path2set = f"{path.abspath(ffmpeg[0])}\\bin\\"
        
        # add path of directory to environment variables
        add_ffmpeg = subprocess.Popen(f"IF EXIST {path2set} SET PATH=%PATH%;{path2set}", shell=True)
        add_ffmpeg.wait()
        
        # print all of the current environment variables
        list_vars = subprocess.Popen("echo %PATH%", shell=True)
        list_vars.wait()

else:
    print("FFmpeg: Missing -> Wait for Download...")
    
    # download the ffmpeg file via direct link
    wget.download("https://www.gyan.dev/ffmpeg/builds/ffmpeg-release-essentials.zip")
    
    # unzip the file
    powershell = subprocess.Popen("powershell.exe Expand-Archive -Path './ffmpeg-release-essentials.zip' "
                                  "-DestinationPath './'")
    powershell.wait()

    # remove the file
    remove("./ffmpeg-release-essentials.zip")

    # get any sub-directory with ffmpeg in it's name
    ffmpeg = glob("./*ffmpeg*/")

    # double-check directory exists
    ffmpeg_exist = path.isdir(ffmpeg[0])
    
    # proceed with if it exists
    if ffmpeg_exist:
        print("FFmpeg: Found -> Setting Up")
        
        # get the absolute path of the directories bin folder ".\ffmpeg-release-essentials.zip\bin"
        path2set = f"{path.abspath(ffmpeg[0])}\\bin\\"
        
        # add path of directory to environment variables
        add_ffmpeg = subprocess.Popen(f"IF EXIST {path2set} SET PATH=%PATH%;{path2set}", shell=True)
        add_ffmpeg.wait()

        # print all of the current environment variables
        list_vars = subprocess.Popen("echo %PATH%", shell=True)
        list_vars.wait()
        
    else:
        print("Something unexplained has gone wrong.")
        exit(0)


    


  • Using FFMPEG, how do we add subtitles in the black bar area or under the video ?

    26 septembre 2020, par DunceDancer

    I followed these steps :

    


      

    1. Added the black bars

      


      -vf "scale=1920:1080:force_original_aspect_ratio=decrease,pad=1920:1080 :(ow-iw)/2 :(oh-ih)/2,setsar=1" Source :How to add black borders to video

      


    2. 


    3. Added the subtitles ("burned" it into the video)

      


      ffmpeg -i "imput.mp4" -lavfi "subtitles=subtitles.srt:force_style='Alignment=0,OutlineColour=&H100000000,BorderStyle=3,Outline=1,Shadow=0,Fontsize=18,MarginL=5,MarginV=25'" -crf 1 -c:a copy "output.mp4" Source : ffmpeg subtitles alignment and position

      


    4. 


    


    Now I am stuck as to how to place the subtitles under the video or in the black screen.

    


    Edit : Screenshot added to clarify

    


    Screenshot of the Problem