Recherche avancée

Médias (0)

Mot : - Tags -/tags

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

Autres articles (47)

  • Websites made ​​with MediaSPIP

    2 mai 2011, par

    This page lists some websites based on MediaSPIP.

  • Installation en mode ferme

    4 février 2011, par

    Le mode ferme permet d’héberger plusieurs sites de type MediaSPIP en n’installant qu’une seule fois son noyau fonctionnel.
    C’est la méthode que nous utilisons sur cette même plateforme.
    L’utilisation en mode ferme nécessite de connaïtre un peu le mécanisme de SPIP contrairement à la version standalone qui ne nécessite pas réellement de connaissances spécifique puisque l’espace privé habituel de SPIP n’est plus utilisé.
    Dans un premier temps, vous devez avoir installé les mêmes fichiers que l’installation (...)

  • La sauvegarde automatique de canaux SPIP

    1er avril 2010, par

    Dans le cadre de la mise en place d’une plateforme ouverte, il est important pour les hébergeurs de pouvoir disposer de sauvegardes assez régulières pour parer à tout problème éventuel.
    Pour réaliser cette tâche on se base sur deux plugins SPIP : Saveauto qui permet une sauvegarde régulière de la base de donnée sous la forme d’un dump mysql (utilisable dans phpmyadmin) mes_fichiers_2 qui permet de réaliser une archive au format zip des données importantes du site (les documents, les éléments (...)

Sur d’autres sites (8080)

  • AttributeError : 'FilterableStream' object has no attribute 'input' - ffmpeg-python

    26 septembre 2024, par Karolek

    I am a fresh programmer and I am learning the Python language.
I have been trying to design a graphical application (using tkinter and ffmpeg-python libraries) that converts an image file along with audio into a video of audio length displaying the image. Unfortunately whenever I try run program I keep encountering errors

    


    At first it was due to installing the ffmpeg library in pip package manager instead of ffmpeg-python. I uninstalled the previous one, installing the correct one making sure no other package causes problems. Using a short script like this, the library functioned smoothly :

    


    '''
The Error causing Statement
import ffmpeg 
(
    ffmpeg.input("something.mp3")
    .output("output.wav")
    .run()
)
'''
# When I tried to use the ffmpeg library in a graphics program within a function, unfortunately I was not able to get it to work

import tkinter as tk
from tkinter import filedialog
from tkinter import ttk

def select_image():
    file_path = filedialog.askopenfilename(title="Select a file", filetypes=[("image files","*.jpg;*.png;*.gif;*.jfif;")])
    print("Selected file:", file_path)

def select_audio():
    file_path = filedialog.askopenfilename(title="Select a file", filetypes=[("audio files","*.mp3;*.wav;*.ogg;*.flac;*.m4a;*.acc;")])
    print("Selected file:", file_path)

def create_video(image_file, audio_file, output_format):
    import ffmpeg
    (
        ffmpeg.input(image_file, loop=1)
        .input(audio_file)
        .output("output" + output_format)
        .run()
    )   

def choose_directory():
    directory_path = filedialog.askdirectory(title="Select directory")
    print("Selected directory:", directory_path)


root = tk.Tk()

root.title("Audio To Video Converter")
root.geometry("500x700")

title = tk.Label(root, text="Audio To Video Converter", font=('Arial', 28))
title.pack(padx=20, pady=20)

selectImage_button = tk.Button(root, text="Select image", command=select_image, height=3, width=50)
selectImage_button.pack(pady=10, padx=20)
selectAudio_button = tk.Button(root, text="Select audio", command=select_audio, height=3, width=50)
selectAudio_button.pack(pady=10, padx=20)

label1 = tk.Label(root, text="Output video format", font=('Arial', 16))
label1.pack(padx=20, pady=10)

outputFormat = ttk.Combobox(root, width=55)
outputFormat['values'] = ('.avi', '.mkv', '.mp4', '.webm')
outputFormat['state'] = 'readonly'
outputFormat.pack(pady=5, padx=20)

label2 = tk.Label(root, text="Output directory", font=('Arial', 16))
label2.pack(padx=20, pady=10)

outputDirectory_button = tk.Button(root, text="Select directory", command=choose_directory, height=3, width=50)
outputDirectory_button.pack(pady=5, padx=60)


convert_button = tk.Button(root, text="Convert", height=3, width=50, command=create_video(selectImage_button, selectAudio_button, outputFormat['values'] ))

root.mainloop()


    


    This is the only thing the console displayed after attempting to run

    


    Traceback (most recent call last):&#xA;  File "c:\Users\Admin\Documents\konwerter\konwerter.py", line 56, in <module>&#xA;    convert_button = tk.Button(root, text="Convert", height=3, width=50, command=create_video(selectImage_button, selectAudio_button, outputFormat[&#x27;values&#x27;] ))&#xA;                                                                                 ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^&#xA;  File "c:\Users\Admin\Documents\konwerter\konwerter.py", line 17, in create_video&#xA;    .input(audio_file)&#xA;     ^^^^^&#xA;AttributeError: &#x27;FilterableStream&#x27; object has no attribute &#x27;input&#x27;&#xA;</module>

    &#xA;

    I did some research and did not find any information about this error except that it may be due to installing the wrong libraries. This is my list of installed libraries in pip package manager :

    &#xA;

    colored           2.2.4 customtkinter     5.2.2 darkdetect        0.8.0 ffmpeg-python     0.2.0 future            1.0.0 Gooey             1.0.8.1 packaging         24.1 pillow            10.4.0 pip               24.2 psutil            6.0.0 pyee              12.0.0 pygtrie           2.5.0 six               1.16.0 tkinterdnd2       0.4.2 typing_extensions 4.12.2 wxPython          4.2.2&#xA;

    &#xA;

    Perhaps the solution to the problem is simple, but I am new and don't understand many things. I will be very grateful for your answer !

    &#xA;

  • How to import and use FFmpegInteropX.FFmpegUWP ?

    14 janvier, par Boris

    I am writing a WinUI3 app. I need it to play a .mkv video file using MediaPlayerElement control. Out of box, .mkv file types are not supported. So I came upon a package FFmpegInteropX.FFmpegUWP (current v5.1.100) and installed it to the solution via Visual Studio NuGet Package Manager. The installation went fine and the package is definitely part of the project :

    &#xA;

    <packagereference include="FFmpegInteropX.FFmpegUWP" version="5.1.100"></packagereference>

    &#xA;

    The problem I have is that when I type using FFmpegInteropX; it is not recognized and I cannot use it. I've noticed there is also a FFmpegInteropX package (so without the ".FFmpegUWP" part) and I tried installing that one too, as I was trying to make the using statement work. However, it appears that that package is not intended for WinUI3 projects and NuGet removed it.

    &#xA;

    Now, I am clueless on how to use the FFmpegInteropX.FFmpegUWP in the project. Could anyone please explain why I might be experiencing this problem ?

    &#xA;

  • SPM binary target, additional frameworks not being included

    20 septembre 2024, par Darren

    I'm trying to integrate a binaryTarget into a project using Swift Package Manager. The binary comes as a .zip containing the main ffmpegkit.xcframework plus 7 additional .xcframework's that it depends on.

    &#xA;

    Here's the folder structure from DerivedData/.../SourcePackages/artifacts/... after SPM has unzipped it.&#xA;Unzipped folder showing the 8 frameworks

    &#xA;

    This is my Package.swift file :

    &#xA;

    // swift-tools-version: 5.10&#xA;&#xA;import PackageDescription&#xA;&#xA;let package = Package(&#xA;    name: "converter",&#xA;    platforms: [&#xA;        .macOS(.v13),&#xA;        .iOS(.v14),&#xA;    ],&#xA;    products: [&#xA;        .library(&#xA;            name: "converter",&#xA;            targets: ["converter"])&#xA;    ],&#xA;    targets: [&#xA;        .target(&#xA;            name: "converter",&#xA;            dependencies: [&#xA;                .target(name: "ffmpeg-iOS", condition: .when(platforms: [.iOS])),&#xA;                .target(name: "ffmpeg-macOS", condition: .when(platforms: [.macOS]))&#xA;            ],&#xA;            path: "Sources/converter"&#xA;        ),&#xA;        .binaryTarget(name: "ffmpeg-iOS",&#xA;                      url: "https://github.com/arthenica/ffmpeg-kit/releases/download/v6.0/ffmpeg-kit-full-6.0-ios-xcframework.zip",&#xA;                      checksum: "c87ea1c77f0a8a6ba396c22fc33e9321befb8e85f8e8103046ddeb74fea66182"),&#xA;        .binaryTarget(name: "ffmpeg-macOS",&#xA;                      url: "https://github.com/arthenica/ffmpeg-kit/releases/download/v6.0/ffmpeg-kit-full-6.0-macos-xcframework.zip",&#xA;                      checksum: "8cab26eecd43b9389d37f64efaf43b9c6baf4e53614b62e6209d8ee8681b94b9")&#xA;    ]&#xA;)&#xA;

    &#xA;

    Now when I build and run the project, it crashes with dyld[85157]: Library not loaded: @rpath errors as the build only seems to include the ffmpegkit.xcframework folder and not the others.

    &#xA;

    This happens even if I do not import ffmpegkit in any of my code. So what is making the build choose to add the ffmpegkit framework but not the others ?

    &#xA;

    How can I tell SPM to include these additional frameworks when it builds ?

    &#xA;

    ---- UPDATE ----

    &#xA;

    I have since found a workaround, although not ideal. I have created a new GitHub repo that contains the 7 zipped .xcframework files. I have added these as their own .binaryTarget's in the Package.swift. They now are downloaded and installed to the app whenever the package is used. However the original ffmpegkit.xcframework still contains the 7 frameworks, although not used.

    &#xA;

    So i'd still like to know 2 things :

    &#xA;

      &#xA;
    1. What makes SPM choose to embed the ffmpegkit framework and none of the other 7 ? Is it just the first alphabetically ?

      &#xA;

    2. &#xA;

    3. How can I make SPM just use all the frameworks that are already packaged together ?

      &#xA;

    4. &#xA;

    &#xA;