Recherche avancée

Médias (2)

Mot : - Tags -/media

Autres articles (99)

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

  • Les vidéos

    21 avril 2011, par

    Comme les documents de type "audio", Mediaspip affiche dans la mesure du possible les vidéos grâce à la balise html5 .
    Un des inconvénients de cette balise est qu’elle n’est pas reconnue correctement par certains navigateurs (Internet Explorer pour ne pas le nommer) et que chaque navigateur ne gère en natif que certains formats de vidéos.
    Son avantage principal quant à lui est de bénéficier de la prise en charge native de vidéos dans les navigateur et donc de se passer de l’utilisation de Flash et (...)

  • (Dés)Activation de fonctionnalités (plugins)

    18 février 2011, par

    Pour gérer l’ajout et la suppression de fonctionnalités supplémentaires (ou plugins), MediaSPIP utilise à partir de la version 0.2 SVP.
    SVP permet l’activation facile de plugins depuis l’espace de configuration de MediaSPIP.
    Pour y accéder, il suffit de se rendre dans l’espace de configuration puis de se rendre sur la page "Gestion des plugins".
    MediaSPIP est fourni par défaut avec l’ensemble des plugins dits "compatibles", ils ont été testés et intégrés afin de fonctionner parfaitement avec chaque (...)

Sur d’autres sites (10134)

  • Button "Clean FFMeta" does nothing after compiling with PyInstaller

    6 mai, par Leonie Holdermann

    I’m working on my first Python project and I’ve compiled it into an executable using PyInstaller with the following command :

    


    pyinstaller --onefile --noconsole app.py


    


    However, when I run the executable, the button "Clean FFMeta" which triggers the clean_ffmeta() function does nothing. Additionally, changing the language or the chapter settings under the "Options -> Chapter settings" menu doesn’t seem to affect anything either. It all works perfectly in the Python script before compilation, but once compiled into an .exe, none of these functions respond.

    


    I've reviewed the code, and the button is correctly linked to the function, but I suspect something might be going wrong during the compilation process.

    


    What I have tried :

    


      

    • Checked that all dependencies are included.
    • 


    • Verified that the configuration and language changes are being correctly applied before compilation.
    • 


    • Tried running the executable from a console to check for error messages, but there are none visible (since I used —noconsole).
    • 


    


    What I expect :

    


      

    • The "Clean FFMeta" button should clean the FFMeta file based on the
user settings.
    • 


    • Language and chapter settings should be updated and reflected in the GUI immediately.
    • 


    


    Code :
Below is a simplified version of my code, especially the sections related to the "Clean FFMeta" functionality and language/chapter settings.

    


    def clean_ffmeta():
if not config.get("cd_in_path"):
    show_error(texts[current_language]["error"] + " No CD_IN path configured.")
    return

chapter_path = os.path.join(config["cd_in_path"], "chapters.ffmeta")
cleaned_chapter_path = os.path.join(config["cd_in_path"], "chapters_cleaned.ffmeta")

if not os.path.exists(chapter_path):
    show_error(texts[current_language]["no_chapters_file"])
    return

write_to_console("Starting to clean FFMeta...")
thread = threading.Thread(target=clean_ffmeta_thread, args=(chapter_path, cleaned_chapter_path))
thread.start()

def clean_ffmeta_thread(chapter_path, cleaned_chapter_path):
    try:
        chapter_action = config.get("chapter_action", "clean")
        keep_empty = config.get("chapter_keep_empty", False)

        write_to_console(f"Chapter action: {chapter_action}, Keep empty: {keep_empty}")

        with open(chapter_path, "r", encoding="utf-8") as f:
            lines = f.readlines()

        new_lines = []
        chapter_counter = 0

        for line in lines:
            stripped_line = line.strip()
            if stripped_line.startswith("title="):
                title_content = stripped_line[6:]
                
                if chapter_action == "clean":
                    if title_content == "":
                        if keep_empty:
                            new_lines.append(line)
                        else:
                            write_to_console("Empty title skipped.")
                            continue
                    else:
                        new_lines.append(line)
                
                elif chapter_action == "number":
                    chapter_counter += 1
                    chapter_title = f"{texts[current_language]['chapter']} {chapter_counter}"
                    new_lines.append(f"title={chapter_title}\n")
                    write_to_console(f"Renamed to: {chapter_title}")
            else:
                new_lines.append(line)

        with open(cleaned_chapter_path, "w", encoding="utf-8") as f:
            f.writelines(new_lines)

        write_to_console(f"FFMeta cleaned and saved as '{cleaned_chapter_path}'.")

    except Exception as e:
        write_to_console(f"Error cleaning FFMeta: {str(e)}")

def open_chapter_settings():
    global chapter_settings_window, chapter_action_var
    global chapter_keep_empty_checkbox, chapter_save_button

    chapter_settings_window = tk.Toplevel(root)
    chapter_settings_window.title(texts[current_language]["chapter_setting_title"])
    chapter_settings_window.geometry("300x250")
    chapter_settings_window.resizable(False, False)
    
    chapter_action_var = tk.StringVar(value=config.get("chapter_action", "clean"))
    chapter_keep_empty_var = tk.BooleanVar(value=config.get("chapter_keep_empty", False))
    
    tk.Label(
        chapter_settings_window,
        text=texts[current_language]["chapter_setting_choose_option"]
    ).pack(pady=(10, 5))
    
    tk.Radiobutton(
        chapter_settings_window,
        text=texts[current_language]["chapter_setting_clean"],
        variable=chapter_action_var,
        value="clean"
    ).pack(pady=5)

    tk.Radiobutton(
        chapter_settings_window,
        text=texts[current_language]["chapter_setting_number"],
        variable=chapter_action_var,
        value="number"
    ).pack(pady=5)

    chapter_keep_empty_checkbox = tk.Checkbutton(
        chapter_settings_window,
        text=texts[current_language]["chapter_setting_keep_empty"],
        variable=chapter_keep_empty_var
    )
    chapter_keep_empty_checkbox.pack(pady=5)

    chapter_save_button = tk.Button(
        chapter_settings_window,
        text=texts[current_language]["chapter_setting_save"],
        command=lambda: save_chapter_settings(chapter_keep_empty_var, chapter_settings_window)
    )
    chapter_save_button.pack(pady=10)

def save_chapter_settings(keep_empty_var, window):
    config["chapter_action"] = chapter_action_var.get()
    config["chapter_keep_empty"] = keep_empty_var.get()
    save_config()
    write_to_console(f"Chapter settings saved: Action={config['chapter_action']}, Keep empty={config['chapter_keep_empty']}")
    window.destroy()

options_menu = tk.Menu(menu, tearoff=0)
options_menu.add_command(label="Check pip-ffmpeg", command=check_pip_ffmpeg)
options_menu.add_command(label=texts[current_language]["menu_chapter_settings"], command=open_chapter_settings)
menu.add_cascade(label="Options", menu=options_menu)

btn3 = tk.Button(btn_frame, text="3. Clean FFMeta", command=clean_ffmeta)
btn3.grid(row=0, column=2, padx=5)


    


    Here you find the entire project code of the entire project : https://www.pythonmorsels.com/p/32hkh/

    


    Why is the clean_chapters function not working ?

    


  • FFprobe Throws JsonSyntaxException with NumberFormatException on Some Video Files [closed]

    3 avril, par Daydreamer067

    I'm using FFprobe through the Java wrapper to analyze video files :

    


        FFprobe ffprobe = new FFprobe("pathTo/ffprobe.exe");
    FFmpegProbeResult probeResult = ffprobe.probe(fichierTemp.getPath());


    


    This works fine for most files. However, on some video files, I get the following error :

    


    com.google.gson.JsonSyntaxException: java.lang.NumberFormatException: Expected an int but was 109893054318340751 at line 160 column 37 path $.chapters[0].id


    


    It seems like FFprobe is returning a chapter ID that is a long but it expected an int. How can I handle this situation and avoid this exception ?

    


    Is there a way to customize the JSON parsing or configure FFprobe to return int values ?

    


  • Including FFmpeg.framework Into My IOS App

    28 mars, par Alpi

    I'm trying to manually integrate ffmpegkit.framework into my Expo Bare Workflow iOS app (built with React Native + native modules via Xcode) because the ffmpegkit will be deprecated and the binaries will be deleted.

    


    So far

    


      

    • I've downloaded the latest LTS release of FFmpegkit from here.
    • 


    • I've created 3 files : FFmpegModule.m , FFmpegModule.swift and SoundBud-Bridging-Header.
    • 


    • Added the frameworks to my projectDir/ios manually, which shows in my XCode under projectDir/Frameworks
    • 


    • Added all the frameworks into "Frameworks, Libraries and Embedded Content" and make them "Embed and Sign"
    • 


    • As Framework Search Path in Project Settings, I've set it to "$(PROJECT_DIR)" and recursive
    • 


    • In "Build Phases" I've added all the frameworks under "Embed Frameworks",set the destination to "Frameworks" and checked "Code Sign on Copy" to all of them and unchecked "Copy Only When Installing"
    • 


    • Also under "Link Binary With Libraries" I've added all the frameworks and marked them "Required"
    • 


    


    Here are the errors I'm getting :

    


      

    • The framework is not recognized by Swift (No such module 'ffmpegkit')
    • 


    • A build cycle error : Cycle inside SoundBud ; building could produce unreliable results.
Target 'SoundBud' has copy command from '.../Frameworks/ffmpegkit.framework' ...
    • 


    


    Below you can see my swift file and the ffmpegkit module file :
Swift :

    


    import Foundation
import ffmpegkit
import React

@objc(FFmpegModule)
class FFmpegModule: NSObject, RCTBridgeModule {

static func moduleName() -> String {
return "FFmpegModule"
}

@objc
func runCommand(_ command: String, resolver resolve: @escaping RCTPromiseResolveBlock, 
rejecter reject: @escaping RCTPromiseRejectBlock) {
FFmpegKit.executeAsync(command) { session in
  let returnCode = session?.getReturnCode()
  resolve(returnCode?.getValue())
}
}

@objc
static func requiresMainQueueSetup() -> Bool {
return false
}
}


    


    and the module :

    


    framework module ffmpegkit {

header "AbstractSession.h"
header "ArchDetect.h"
header "AtomicLong.h"
header "Chapter.h"
header "FFmpegKit.h"
header "FFmpegKitConfig.h"
header "FFmpegSession.h"
header "FFmpegSessionCompleteCallback.h"
header "FFprobeKit.h"
header "FFprobeSession.h"
header "FFprobeSessionCompleteCallback.h"
header "Level.h"
header "Log.h"
header "LogCallback.h"
header "LogRedirectionStrategy.h"
header "MediaInformation.h"
header "MediaInformationJsonParser.h"
header "MediaInformationSession.h"
header "MediaInformationSessionCompleteCallback.h"
header "Packages.h"
header "ReturnCode.h"
header "Session.h"
header "SessionState.h"
header "Statistics.h"
header "StatisticsCallback.h"
header "StreamInformation.h"
header "ffmpegkit_exception.h"

export *
}


    


    I can provide you with more info if you need it. I've been trying non stop for 7 days and it's driving me crazy. I would appreciate any help greatly