Recherche avancée

Médias (0)

Mot : - Tags -/diogene

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

Autres articles (42)

  • La file d’attente de SPIPmotion

    28 novembre 2010, par

    Une file d’attente stockée dans la base de donnée
    Lors de son installation, SPIPmotion crée une nouvelle table dans la base de donnée intitulée spip_spipmotion_attentes.
    Cette nouvelle table est constituée des champs suivants : id_spipmotion_attente, l’identifiant numérique unique de la tâche à traiter ; id_document, l’identifiant numérique du document original à encoder ; id_objet l’identifiant unique de l’objet auquel le document encodé devra être attaché automatiquement ; objet, le type d’objet auquel (...)

  • Gestion générale des documents

    13 mai 2011, par

    MédiaSPIP ne modifie jamais le document original mis en ligne.
    Pour chaque document mis en ligne il effectue deux opérations successives : la création d’une version supplémentaire qui peut être facilement consultée en ligne tout en laissant l’original téléchargeable dans le cas où le document original ne peut être lu dans un navigateur Internet ; la récupération des métadonnées du document original pour illustrer textuellement le fichier ;
    Les tableaux ci-dessous expliquent ce que peut faire MédiaSPIP (...)

  • Des sites réalisés avec MediaSPIP

    2 mai 2011, par

    Cette page présente quelques-uns des sites fonctionnant sous MediaSPIP.
    Vous pouvez bien entendu ajouter le votre grâce au formulaire en bas de page.

Sur d’autres sites (3987)

  • After downloading the file i got 0 byte file size, I dont know how to solve this error ? [closed]

    7 octobre 2024, par Saurabh Chauhan

    This is the handler function which converts a given format to another format but when i provide additional options(like trim audio,bitrate,codec,sample rate etc) to audio and video then it gives me 0 byte file after converting and if i do not include additional options then it gave me correct file.

    


    Please look into this and provide me solution.

    


    const handleConvert = async () => {

  if (!ffmpeg) return;

  setConverting(true);

  for (let uploadedFile of uploadedFiles) {
    const { file } = uploadedFile;
    const fileNameWithoutExtension = getFileNameWithoutExtension(file.name);
    const inputFile = file.name;
    let outputFile;
    let outputFormat;
    const { bitrate, channels, codec, sampleRate, trimStart, trimEnd, volume } = optionsdata;

    try {
      await ffmpeg.writeFile(inputFile, await fetchFile(file));
      let command = ['-i', inputFile];
      // Handle audio conversion with advanced options
> if (supportedAudioFormats.some(ext => file.name.endsWith(ext)) || supportedVideoFormats.some(ext => file.name.endsWith(ext))) {
        outputFile = `${fileNameWithoutExtension}.${audioFormat}`;
        outputFormat = audioFormat;

        // Add trim options if they exist
        if (trimStart && trimEnd) {
          command.push('-ss', trimStart, '-to', trimEnd);
        } else if (trimStart) {
          command.push('-ss', trimStart);
        }

        // Adjust volume if specified
        if (volume && volume !== 'no change') {
          command.push('-filter:a', `volume=${volume}`);
        }
        
        // Apply advanced audio settings like codec, bitrate, and channels
        if (codec) {
          command.push('-c:a', codec);
        }
        if (bitrate) {
          command.push('-b:a', `${bitrate}k`);
        }
> if (channels && channels !== 'no change') {
          command.push('-ac', channels === 'mono' ? '1' : '2');
        }
        if (sampleRate && sampleRate !== 'no change') {
          command.push('-ar', sampleRate);
        }

        // Add output file to the command
        command.push(outputFile);
        console.log('Command Array:', command);
        // Execute FFmpeg command
        await ffmpeg.exec(command);

      } else if (supportedImageFormats.some(ext => file.name.endsWith(ext))) {
        // Image conversion logic
        outputFile = `${fileNameWithoutExtension}.${imageFormat}`;
        outputFormat = imageFormat;
        command.push(outputFile);
        await ffmpeg.exec(command);

      } else if (supportedSubtitleFormats.some(ext => file.name.endsWith(ext))) {
        // Subtitle conversion logic
        outputFile = `${fileNameWithoutExtension}.${subtitleFormat}`;
        outputFormat = subtitleFormat;
        command.push(outputFile);
        await ffmpeg.exec(command);

      } else {
        console.error('Unsupported file type: ', file.name);
        continue; // Skip unsupported files
      }
      // Create Blob and URL for the converted file
      const data = await ffmpeg.readFile(outputFile);
      const convertedBlob = new Blob([data.buffer], {
        type: outputFormat === 'png' ? 'image/png' : `audio/${outputFormat}` || `text/vtt`,
      });
      const convertedUrl = URL.createObjectURL(convertedBlob);

      setConvertedFiles((prevFiles) => [
        ...prevFiles,
        { name: outputFile, url: convertedUrl, format: outputFormat },
      ]);
    } catch (error) {
      console.error('Conversion error:', error);
    }
  }

  setConversionFinished(true);
  setConverting(false);
  setoptionsdata({
    'codec':'',
    'bitrate':'',
    'channels':'',
    'volume':'',
    'sampleRate':'',
    'trimStart':'',
    'trimEnd':''
  });
};



    


  • pass argement through .bat file to .exe file that converted by Pyinstaller

    23 novembre 2019, par Ayoub Ocarina

    i got an error whene passing argements through .bat file to .exe file that converted by Pyinstaller
    my python script have the following libraries :

    import time
    from contextlib import closing
    from PIL import Image
    import subprocess
    from audiotsm import phasevocoder
    from audiotsm.io.wav import WavReader, WavWriter
    from scipy.io import wavfile
    import numpy as np
    import re
    import math
    from shutil import copyfile, rmtree
    import os
    import argparse
    from pytube import YouTube
    import cv2
    from datetime import datetime
    import datetime
    import os.path
    import shutil
    import webbrowser

    and this is my .bat file content :

    mode con: cols=100 lines=40
    @echo off
    COLOR 0A
    title VideoCuts
    :LOOP
    if "%~1"=="" goto :END
    ShortCut.exe --input_file "%~1" --silent_threshold 0.1 --silent_speed 9999999.00 --frame_margin 5 --sample_rate 48000 --frame_quality 1 --output_file "%~n1_%date:~-10,2%%date:~-7,2%%date:~-4,4%_%time:~0,2%%time:~3,2%%time:~6,2%_videocuts.mp4"
    pause

    i also tested with this .bat file :

    ShortCut.exe --input_file="%~1" --silent_threshold=0.1 --silent_speed=9999999.00 --frame_margin=5 --sample_rate=48000 --frame_quality=1 --output_file="videocuts.mp4"

    this is my error message images during processing

  • No such file error using pydub on OSX with pycharm

    15 juillet 2020, par Michael Harrison

    My ultimate aim is to run the code snippet below on Lambda but as I was having difficulties, I tried running it on my mac. I get the same error running with python2.7 on OSX as I do when I run it on AWS lambda.

    


    The code is :

    


    from pydub import AudioSegment
import os

def test():
    print("Starting")

    files = [f for f in os.listdir('.') if os.path.isfile(f)]
    for f in files:
        print (f)

    sound = AudioSegment.from_mp3("test.mp3")

test()


    


    The output of the code from pycharm is :

    


    Starting&#xA;ffmpeg&#xA;.DS_Store&#xA;requirements.txt&#xA;concat.py&#xA;test.mp3&#xA;ffprobe&#xA;Traceback (most recent call last):&#xA;  File "/Applications/PyCharm CE.app/Contents/plugins/python-ce/helpers/pydev/pydevd.py", line 1438, in _exec&#xA;    pydev_imports.execfile(file, globals, locals)  # execute the script&#xA;  File "/Users/mh/Desktop/sC/concat/concat.py", line 13, in <module>&#xA;    test()&#xA;  File "/Users/mh/Desktop/sC/concat/concat.py", line 11, in test&#xA;    sound = AudioSegment.from_mp3("test.mp3")&#xA;  File "/Users/mh/Desktop/sC/concat/venv2.7/lib/python2.7/site-packages/pydub/audio_segment.py", line 738, in from_mp3&#xA;    return cls.from_file(file, &#x27;mp3&#x27;, parameters=parameters)&#xA;  File "/Users/mh/Desktop/sC/concat/venv2.7/lib/python2.7/site-packages/pydub/audio_segment.py", line 685, in from_file&#xA;    info = mediainfo_json(orig_file, read_ahead_limit=read_ahead_limit)&#xA;  File "/Users/mh/Desktop/sC/concat/venv2.7/lib/python2.7/site-packages/pydub/utils.py", line 274, in mediainfo_json&#xA;    res = Popen(command, stdin=stdin_parameter, stdout=PIPE, stderr=PIPE)&#xA;  File "/System/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/subprocess.py", line 394, in __init__&#xA;    errread, errwrite)&#xA;  File "/System/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/subprocess.py", line 1047, in _execute_child&#xA;    raise child_exception&#xA;OSError: [Errno 2] No such file or directory&#xA;</module>

    &#xA;

    Is this actually a problem with pydub/ffmpeg/ffprobe, rather than the location of my mp3 file ? As I'm trying to package this project for Lambda, I've put executable versions of ffmpeg and ffprobe in the root of the project, rather than installed them to my OS. Before I did this, pydub complained that it couldn't find ffmpeg. It's now not complaining but, could I have chosen the wrong binary ?

    &#xA;

    Any ideas ?

    &#xA;