Recherche avancée

Médias (29)

Mot : - Tags -/Musique

Autres articles (99)

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

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

  • i have problem in python with Muxing video and audio

    2 février 2021, par Mahmoud Ahmed

    I want to merge files video and audio but I don't know how I did try many times to fix it with ffmpeg,subprocess and moviepy with a deferent ways so this my problem and I stop work on it here if someone can help me to edit it and send to me back please .

    


    This is my code with a window .

    


    from pytube import YouTube
from tkinter import *
from tqdm import tqdm
from os import startfile
import subprocess
import shutil
import pytube
import ffmpeg
import time
import sys
import os
#Functions
def download():
    video_url = url.get()
    try:
        youtube = pytube.YouTube(video_url)
        video   = youtube.streams.filter(adaptive=True,file_extension='mp4').order_by('resolution').desc().first()
        video.download(filename='Dvideo')
        audio = youtube.streams.get_by_itag(251).download(filename='Daudio')  #webm               
        notif.config(fg="green",text="Download is Completed")



    except Exception as e:
        print(e)
        notif.config(fg="red",text="There is an Error in the Downloading Check Your url")

def Merge():
    try:
        os.system("ffmpeg -i Dvideo.mp4 -i Daudio.webm -c:v copy -c:a aac output.mp4")
        #video = ffmpeg.input('Dvideo.mp4')
        #audio = ffmpeg.input('Daudio.webm')
        #out = ffmpeg.output(video, audio, r'final.mp4', vcodec='"avc1.640028')
        #out.run()

    except Exception as w:
        print(w)
        notif.config(fg="red",text="There is an Error in the Merge")

#Main Screen
Window = Tk()
Window.title("Youtube Video Downloader ")
#The Labels of Texts 
Label(Window, text="Youtube Video Converter \n By: Mahmoud Ahmed", fg="blue", font=("Calibri",15)).grid(sticky=N,padx=15,row=0)
Label(Window, text="Please enter the url of the Video u want to download it : ", font=("Calibri",12)).grid(sticky=N,row=1,pady=15)
Label(Window, text="Notice Any Downloading will be in the same file with this tool.", fg="orange", font=("Calibri",10)).grid(sticky=N,padx=15,row=8)

#my_progress = ttk.Progressbar(Window,length=130, mode='determinate').grid(row= 9, pady=20)


notif = Label(Window,font=("Calibri",12))
notif.grid(sticky=N,pady=1,row=6)
#Variables
url = StringVar()
#The empty label for URL
Entry(Window,width=50,textvariable=url).grid(sticky=N,row=2)
#The Button
Button(Window,width=20,text="Download",font=("Calibri",12),command=download).grid(sticky=N,row=4,pady=15)
Button(Window,width=20,text="Merge",font=("Calibri",12),command=Merge).grid(sticky=N,row=5,pady=15)
#Button(Window,width=20,text="Info",font=("Calibri",12),command=download).grid(sticky=N,row=4,pady=15)

Window.mainloop()



    


  • SVT-AV1 Emscripten build

    24 février 2023, par Yoz

    I am trying to build svt-av1 v1.4.1 for ffmpeg with emscripten 3.1.32. I have followed Build-Guide and ended up with the following command :

    


    cd Build

BUILD_DIR=/home/jozefchutka/ffmpeg-wasm/build/
TOOLCHAIN_FILE=$EMSDK/upstream/emscripten/cmake/Modules/Platform/Emscripten.cmake

emmake cmake .. -G"Unix Makefiles" -DCMAKE_INSTALL_PREFIX=$BUILD_DIR -DCMAKE_TOOLCHAIN_FILE=$TOOLCHAIN_FILE -DBUILD_SHARED_LIBS=OFF -DCMAKE_BUILD_TYPE=Release -DBUILD_TESTING=OFF -DCMAKE_HAVE_LIBC_PTHREAD=On -DCMAKE_C_FLAGS="-O3 -I/home/jozefchutka/ffmpeg-wasm/build/include -s USE_PTHREADS=1 -msimd128"

emmake make -j


    


    however the process fails on :

    


    ...
[ 95%] Building C object Source/App/EncApp/CMakeFiles/SvtAv1EncApp.dir/EbTime.c.o
[ 96%] Linking C executable ../../../../Bin/Release/SvtAv1EncApp.js
emcc: error: noexecstack: No such file or directory ("noexecstack" was expected to be an input file, based on the commandline arguments provided)
make[2]: *** [Source/App/EncApp/CMakeFiles/SvtAv1EncApp.dir/build.make:213: ../Bin/Release/SvtAv1EncApp.js] Error 1
make[1]: *** [CMakeFiles/Makefile2:574: Source/App/EncApp/CMakeFiles/SvtAv1EncApp.dir/all] Error 2
make[1]: *** Waiting for unfinished jobs....


    


    Generated build.make and link.txt which contains some relevant info.

    


    211: ../Bin/Release/SvtAv1EncApp.js: Source/App/EncApp/CMakeFiles/SvtAv1EncApp.dir/link.txt
212:    @$(CMAKE_COMMAND) -E cmake_echo_color --switch=$(COLOR) --green --bold --progress-dir=/home/jozefchutka/ffmpeg-wasm/modules/svtav1/Build/CMakeFiles --progress-num=$(CMAKE_PROGRESS_8) "Linking C executable ../../../../Bin/Release/SvtAv1EncApp.js"
213:    cd /home/jozefchutka/ffmpeg-wasm/modules/svtav1/Build/Source/App/EncApp && $(CMAKE_COMMAND) -E cmake_link_script CMakeFiles/SvtAv1EncApp.dir/link.txt --verbose=$(VERBOSE)


    


    /home/jozefchutka/ffmpeg-wasm/modules/emsdk/upstream/emscripten/emcc -O3 -I/home/jozefchutka/ffmpeg-wasm/build/include -s USE_PTHREADS=1 -msimd128 -O3 -DNDEBUG  -z noexecstack -z relro -z now @CMakeFiles/SvtAv1EncApp.dir/objects1.rsp -o ../../../../Bin/Release/SvtAv1EncApp.js @CMakeFiles/SvtAv1EncApp.dir/linklibs.rsp


    


    As I am not fluent in c/c++ and related build stack, I am not sure if the problem is my build misconfiguration, svt-av1 sources or emscripten.

    


    Please help me resolve the issue or at least identify the cause, so I can continue in relevant issue tracker.

    


  • Trimming videos with 'ffmpeg and ffprobe'

    10 août 2022, par adeshina Ibrahim

    I am working on an ETL process, and I'm now in the final stage of preprocessing my videos. I used the script below (reference : @FarisHijazi) to first auto detected black-screen frames using ffprobe and trim them out using ffmpeg.

    


    The script worked for me but the problems are :

    


      

    1. It cut off all other good frames together with the first bad frames. e.g. if gBgBgBgB represents a sequence of good and BAD frames for 5sec each, the script only returned the first g(5sec) and cut off the other BgBgBgB after it. I want to have only g g g g where all B B B B has been removed

      


    2. 


    3. I also want to detect other colors aside black-screen e.g. green-screen or red-screen or blurry part of video

      


    4. 


    5. Script doesn't work if video has no audio in it.

      


    6. 


    


    import argparse
import os
import shlex
import subprocess

parser = argparse.ArgumentParser(
    __doc__, formatter_class=argparse.ArgumentDefaultsHelpFormatter
)
parser.add_argument("input", type=str, help="input video file")
parser.add_argument(
    "--invert",
    action="store_true",
    help="remove nonblack instead of removing black",
)
args = parser.parse_args()

##FIXME: sadly you must chdir so that the ffprobe command will work
os.chdir(os.path.split(args.input)[0])
args.input = os.path.split(args.input)[1]

spl = args.input.split(".")
outpath = (
    ".".join(spl[:-1])
    + "."
    + ("invert" if args.invert else "")
    + "out."
    + spl[-1]
)


def delete_back2back(l):
    from itertools import groupby

    return [x[0] for x in groupby(l)]


def construct_ffmpeg_trim_cmd(timepairs, inpath, outpath):
    cmd = f'ffmpeg -i "{inpath}" -y -r 20 -filter_complex '
    cmd += '"'
    for i, (start, end) in enumerate(timepairs):
        cmd += (
            f"[0:v]trim=start={start}:end={end},setpts=PTS-STARTPTS,format=yuv420p[{i}v]; "
            + f"[0:a]atrim=start={start}:end={end},asetpts=PTS-STARTPTS[{i}a]; "
        )
    for i, (start, end) in enumerate(timepairs):
        cmd += f"[{i}v][{i}a]"
    cmd += f"concat=n={len(timepairs)}:v=1:a=1[outv][outa]"
    cmd += '"'
    cmd += f' -map [outv] -map [outa] "{outpath}"'
    return cmd


def get_blackdetect(inpath, invert=False):
    ffprobe_cmd = f'ffprobe -f lavfi -i "movie={inpath},blackdetect[out0]" -show_entries tags=lavfi.black_start,lavfi.black_end -of default=nw=1 -v quiet'
    print("ffprobe_cmd:", ffprobe_cmd)
    lines = (
        subprocess.check_output(shlex.split(ffprobe_cmd))
        .decode("utf-8")
        .split("\n")
    )
    times = [
        float(x.split("=")[1].strip()) for x in delete_back2back(lines) if x
    ]
    assert len(times), "no black scene detected"

    if not invert:
        times = [0] + times[:-1]
    timepairs = [
        (times[i], times[i + 1]) for i in range(0, len(times) // 2, 2)
    ]
    return timepairs


if __name__ == "__main__":
    timepairs = get_blackdetect(args.input, invert=args.invert)
    cmd = construct_ffmpeg_trim_cmd(timepairs, args.input, outpath)

    print(cmd)
    os.system(cmd)