Recherche avancée

Médias (91)

Autres articles (90)

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

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

  • Participer à sa traduction

    10 avril 2011

    Vous pouvez nous aider à améliorer les locutions utilisées dans le logiciel ou à traduire celui-ci dans n’importe qu’elle nouvelle langue permettant sa diffusion à de nouvelles communautés linguistiques.
    Pour ce faire, on utilise l’interface de traduction de SPIP où l’ensemble des modules de langue de MediaSPIP sont à disposition. ll vous suffit de vous inscrire sur la liste de discussion des traducteurs pour demander plus d’informations.
    Actuellement MediaSPIP n’est disponible qu’en français et (...)

Sur d’autres sites (7028)

  • download and fill file on fly

    4 mai 2017, par Gianluca Calabria

    I’m trying to create a service for a client which takes some audio chunks and concatenate them. For this I’m using FFmpeg. The user should also be able to download the result on the fly without waiting for the conversion/concatenation to finish. The idea is to "fill" the file as the process goes on. I cannot work my way around it, is it possible to do ? I’m using a RESTful service which calls a class like this one

    public ReadableRepresentation serveDownloadRequest(Representation entity) throws SystemInitializationException {
       InputStreamChannel inputStreamChannel;
       Form reqParameters=getQuery();
       try {

           String parameters = readStringParameter(reqParameters, AudioCutAndJoinParameters.PARAMETERS, AudioCutAndJoinParameters.PARAMETERS_MANDATORY);
           trace.debug(this.getClass().getSimpleName() + " parameter " + AudioCutAndJoinParameters.PARAMETERS + "=" + parameters);

           String inputUri = readStringParameter(reqParameters, AudioCutAndJoinParameters.INPUT_URI, AudioCutAndJoinParameters.INPUT_URI_MANDATORY);
           trace.debug(this.getClass().getSimpleName() + " parameter " + AudioCutAndJoinParameters.INPUT_URI + "=" + inputUri);

           String markInRelative = readStringParameter(reqParameters, AudioCutAndJoinParameters.MARKIN_ID_RELATIVE, AudioCutAndJoinParameters.MARKIN_ID_RELATIVE_MANDATORY);
           trace.debug(this.getClass().getSimpleName() + " parameter " + AudioCutAndJoinParameters.MARKIN_ID_RELATIVE + "=" + markInRelative);

           String parametersString = readStringParameter(reqParameters, AudioCutAndJoinParameters.PARAMETERS_STRING, AudioCutAndJoinParameters.PARAMETERS_STRING_MANDATORY);
           trace.debug(this.getClass().getSimpleName() + " parameter " + AudioCutAndJoinParameters.PARAMETERS_STRING + "=" + parametersString);

           String cmdFolder = readStringParameter(reqParameters, AudioCutAndJoinParameters.COMMAND_FOLDER, AudioCutAndJoinParameters.COMMAND_FOLDER_MANDATORY);
           trace.debug(this.getClass().getSimpleName() + " parameter " + AudioCutAndJoinParameters.COMMAND_FOLDER + "=" + cmdFolder);

           Map markInIdRelativeMap=JsonEntityManager.getInstance().deserializeMap(markInRelative);
           Map parametersMap=JsonEntityManager.getInstance().deserializeMap(parameters);
           List <string> InputUri= JsonEntityManager.getInstance().deserializeList(inputUri);

           InputStream transcodeOutput = Services.getInstance().runAudioCutAndJoin(parametersMap,markInIdRelativeMap,InputUri,parametersString,cmdFolder);
           inputStreamChannel = new InputStreamChannel(transcodeOutput);

           ReadableRepresentation result = new ReadableRepresentation(inputStreamChannel, MediaType.AUDIO_ALL);

           Disposition disp = new Disposition(Disposition.TYPE_ATTACHMENT);

           disp.setFilename("test-cut.wav");
           result.setDisposition(disp);

           return result;
    </string>

    I’m using the process.getInputStream() as return of my runAudioCutAndJoin but no download happens until the process of conversion/concatenation is done. Can somebody please help me out ?

  • How to upload a transcoded file to s3 and create a link to download it

    29 septembre 2022, par Dotun Longe

    I want to download a video after my module "creates" it by combining a picture and audio file. The output goes to my tmp folder. This works, but I don't know how to access it.

    &#xA;

    My method is to create another Paperclip attachment called "converted" and the module responsible for transcoding should also be responsible for uploading the converted video to a bucket, where I can then access it via @upload.converted.url.

    &#xA;

    I have no idea how to go about this, and my eyes hurt from searching. If you have a better way for me to be able to download the transcoded video without this option, I will be open to it.

    &#xA;

    # videocreatingproccessor.rb&#xA;&#xA;require &#x27;streamio-ffmpeg&#x27;&#xA;require &#x27;fileutils&#x27;&#xA;&#xA;module VideoCreatingProcessor&#xA;  def self.convert_to_video (path_to_audio_file, path_to_image_file)&#xA;    movie = FFMPEG::Movie.new(path_to_audio_file)&#xA;    options = {&#xA;      video_codec: "libx264",&#xA;      frame_rate: 60,&#xA;      resolution: "960x720",&#xA;      x264_vprofile: "high",&#xA;      x264_preset: "slow",&#xA;      pixel_format: "720p",&#xA;      audio_codec: "libfaac",&#xA;      audio_bitrate: 32,&#xA;      audio_sample_rate: 44100,&#xA;      audio_channels: 2,&#xA;      threads: 2,&#xA;    }&#xA;&#xA;    woptions = { watermark: path_to_image_file, resolution: "960x720", watermark_filter: { padding_x: 10, padding_y: 10 } }&#xA;&#xA;    movie.transcode("tmp/output.mp4",woptions ,options )&#xA;  end&#xA;end&#xA;

    &#xA;

    # uploads_controller.rb&#xA;&#xA;class UploadsController &lt; ApplicationController&#xA;  before_action :set_upload, only: [:show, :edit, :update, :destroy]&#xA;&#xA;  def index&#xA;    @uploads = Upload.all&#xA;  end&#xA;&#xA;  def paudioaddress&#xA;    "https:" &#x2B; @upload.audio.url&#xA;  end&#xA;&#xA;  def pimageaddress&#xA;    "https:" &#x2B; @upload.image.url&#xA;  end&#xA;&#xA;   def show&#xA;    require "video_creating_processor"&#xA;    newvideo = VideoCreatingProcessor.convert_to_video(paudioaddress, pimageaddress)&#xA;   end&#xA;&#xA;   # ....&#xA;end&#xA;

    &#xA;

  • ffmpeg download mp3 in chunks slower than whole file

    6 août 2021, par loretoparisi

    I'm programmatically downloading in Python mp3 file's as wav chunks, seeking at position with ss and t with ffmpeg resulting in a sequence of ffmpeg commands

    &#xA;

    ffmpeg -i https://file-examples-com.github.io/uploads/2017/11/file_example_MP3_5MG.mp3 -acodec pcm_s16le -ac 1 -ar 44100 -ss 0:08:55.780000 -t 0:01:00.000000 -sn -vn -y -f wav pipe:1&#xA;ffmpeg -i https://file-examples-com.github.io/uploads/2017/11/file_example_MP3_5MG.mp3 -acodec pcm_s16le -ac 1 -ar 44100 -ss -ss 0:09:55.780000 -t 0:01:00.000000 -sn -vn -y -f wav pipe:1&#xA;ffmpeg -i https://file-examples-com.github.io/uploads/2017/11/file_example_MP3_5MG.mp3 -acodec pcm_s16le -ac 1 -ar 44100 -ss -ss -ss 0:10:55.780000 -t 0:01:00.000000 -sn -vn -y -f wav pipe:1&#xA;...&#xA;

    &#xA;

    executed via concurrent.futures.ThreadPoolExecutor in this way :

    &#xA;

    with concurrent.futures.ThreadPoolExecutor(max_workers=NTHREADS) as executor:&#xA;        for i,cmd in enumerate(process_list):&#xA;            futures.append(executor.submit(downloader.chunk_download,(cmd,i)))&#xA;&#xA;        for future in concurrent.futures.as_completed(futures):&#xA;            try:&#xA;                completed.append(future.result())&#xA;            except Exception as e:print(e)&#xA;    completed.sort() &#xA;    for k,c in enumerate(completed):&#xA;        if not k:&#xA;            waveform = c[1]&#xA;        else:&#xA;            waveform = np.append(waveform,c[1])&#xA;

    &#xA;

    where chunk_download is concat the chunks into the whole waveform

    &#xA;

    def chunk_download(self,args):&#xA;        cmd=args[0]&#xA;        i=args[1]&#xA;        print(&#x27;Downloading chunk n&#xB0; %i&#x27; % i)&#xA;&#xA;        print( &#x27; &#x27;.join(cmd))&#xA;        process = subprocess.run(cmd,&#xA;                            stdout=subprocess.PIPE,&#xA;                            stderr=subprocess.PIPE,&#xA;                            bufsize=10**8)&#xA;        #buffer, stderr = process.communicate()&#xA;        buffer = process.stdout&#xA;        stderr = process.stderr&#xA;        print(&#x27;chunk n&#xB0; %i DOWNLOADED&#x27; % i)&#xA;        # convert to signal&#xA;        chunk_waveform = np.frombuffer(buffer=buffer, dtype=np.uint16, offset=8*44)&#xA;        chunk_waveform = chunk_waveform.astype(self.dtype)  &#xA;        print(len(chunk_waveform)/44100) &#xA;&#xA;        return i,chunk_waveform&#xA;

    &#xA;

    this works ok, but if I download the whole mp3, executing the command in cmd like :

    &#xA;

    ffmpeg -i https://file-examples-com.github.io/uploads/2017/11/file_example_MP3_5MG.mp3 -acodec pcm_s16le -ac 1 -ar 44100 -sn -vn -y -f wav pipe:1&#xA;

    &#xA;

    It will take less time than the concurrent chunks download for the same file length, while I would expect the opposite. Could be this related to ffmpeg threading option (param --thread ?). If not, why the concurrent chunks download operation is slower ?

    &#xA;