Recherche avancée

Médias (0)

Mot : - Tags -/xmlrpc

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

Autres articles (58)

  • Encoding and processing into web-friendly formats

    13 avril 2011, par

    MediaSPIP automatically converts uploaded files to internet-compatible formats.
    Video files are encoded in MP4, Ogv and WebM (supported by HTML5) and MP4 (supported by Flash).
    Audio files are encoded in MP3 and Ogg (supported by HTML5) and MP3 (supported by Flash).
    Where possible, text is analyzed in order to retrieve the data needed for search engine detection, and then exported as a series of image files.
    All uploaded files are stored online in their original format, so you can (...)

  • Les autorisations surchargées par les plugins

    27 avril 2010, par

    Mediaspip core
    autoriser_auteur_modifier() afin que les visiteurs soient capables de modifier leurs informations sur la page d’auteurs

  • Supporting all media types

    13 avril 2011, par

    Unlike most software and media-sharing platforms, MediaSPIP aims to manage as many different media types as possible. The following are just a few examples from an ever-expanding list of supported formats : images : png, gif, jpg, bmp and more audio : MP3, Ogg, Wav and more video : AVI, MP4, OGV, mpg, mov, wmv and more text, code and other data : OpenOffice, Microsoft Office (Word, PowerPoint, Excel), web (html, CSS), LaTeX, Google Earth and (...)

Sur d’autres sites (8778)

  • FFMPEG Command to convert images to svg [closed]

    5 mai 2024, par themujahidkhan

    Users are trying to convert images to SVG image on my website, Below I've given a link to the site, more detail on error and code that handles the conversion of media files.

    


    You can check out the live site Here.

    


    Steps to reproduce the error.

    


      

    1. Upload the png file,
    2. 


    3. Select SVG as output file
    4. 


    5. Click convert.
    6. 


    


    It is throwing error.

    


    Below is the code for that converts users input and gives input based on user preference.

    


    // imports&#xA;&#xA;import { createCanvas, loadImage } from "canvas";&#xA;&#xA;import { Action } from "@/types";&#xA;import { FFmpeg } from "@ffmpeg/ffmpeg";&#xA;import { fetchFile } from "@ffmpeg/util";&#xA;&#xA;function getFileExtension(file_name: string) {&#xA;  const regex = /(?:\.([^.]&#x2B;))?$/; // Matches the last dot and everything after it&#xA;  const match = regex.exec(file_name);&#xA;  if (match &amp;&amp; match[1]) {&#xA;    return match[1];&#xA;  }&#xA;  return ""; // No file extension found&#xA;}&#xA;&#xA;function removeFileExtension(file_name: string) {&#xA;  const lastDotIndex = file_name.lastIndexOf(".");&#xA;  if (lastDotIndex !== -1) {&#xA;    return file_name.slice(0, lastDotIndex);&#xA;  }&#xA;  return file_name; // No file extension found&#xA;}&#xA;&#xA;export default async function convert(&#xA;  ffmpeg: FFmpeg,&#xA;  action: Action&#xA;): Promise<any> {&#xA;  const { file, to, file_name, file_type } = action;&#xA;  const input = getFileExtension(file_name);&#xA;  const output = removeFileExtension(file_name) &#x2B; "." &#x2B; to;&#xA;  ffmpeg.writeFile(input, await fetchFile(file));&#xA;&#xA;  // FFMPEG COMMANDS&#xA;  let ffmpeg_cmd: any = [];&#xA;&#xA;  if (to === "svg") {&#xA;    ffmpeg_cmd = [&#xA;      "-i",&#xA;      input,&#xA;      "-vf",&#xA;      "scale=trunc(iw/2)*2:trunc(ih/2)*2",&#xA;      "-c:v",&#xA;      "libvpx-vp9",&#xA;      "-crf",&#xA;      "30",&#xA;      "-b:v",&#xA;      "1M",&#xA;      "-c:a",&#xA;      "libopus",&#xA;      "-b:a",&#xA;      "128k",&#xA;      output,&#xA;    ];&#xA;  } else if (to === "3gp") {&#xA;    ffmpeg_cmd = [&#xA;      "-i",&#xA;      input,&#xA;      "-r",&#xA;      "20",&#xA;      "-s",&#xA;      "352x288",&#xA;      "-vb",&#xA;      "400k",&#xA;      "-acodec",&#xA;      "aac",&#xA;      "-strict",&#xA;      "experimental",&#xA;      "-ac",&#xA;      "1",&#xA;      "-ar",&#xA;      "8000",&#xA;      "-ab",&#xA;      "24k",&#xA;      output,&#xA;    ];&#xA;  } else {&#xA;    ffmpeg_cmd = ["-i", input, output];&#xA;  }&#xA;&#xA;  // execute cmd&#xA;  await ffmpeg.exec(ffmpeg_cmd);&#xA;&#xA;  const data = (await ffmpeg.readFile(output)) as any;&#xA;  const blob = new Blob([data], { type: file_type.split("/")[0] });&#xA;  const url = URL.createObjectURL(blob);&#xA;  return { url, output };&#xA;}&#xA;&#xA;</any>

    &#xA;

    Help appreciated, Thank You

    &#xA;

  • How to quit pexpect launched ffmpeg with key q pressed

    25 février 2014, par Shuman

    i used pexpect to call ffmpeg which is a lengthy process. it took half an hour, how can i detect user has pressed q key to stop it ? just like when you press q when using ffmpeg command line tool

    the ffmpeg command line is
    ffmpeg -y -i url -c copy -absf aac_adtstoasc out.mp4

    the last line of ffmpeg output is

    ...
    Stream mapping:
     Stream #0:1 -> #0:0 (copy)
     Stream #0:2 -> #0:1 (copy)
    Press [q] to stop, [?] for help
    frame=   84 fps= 77 q=-1.0 Lsize=  184626kB time=00:00:06.96 bitrate=217120.3kbits/s

    the code i have now is

    reo = re.compile("""\S+\s+(?P\d+)  # frame
                        \s\S+\s+(?P<fps>\d+)           # fps
                        \sq=(?P<q>\S+)                    # q
                        \s\S+\s+(?P<size>\S+)          # size
                        \stime=(?P<time>\S+)           # time
                        \sbitrate=(?P<bitrate>[\d\.]+) # bitrate
                        """, re.X)

    durationReo = (&#39;(?&lt;=Duration:\s)\S+(?=,)&#39;)

    cpl = thread.compile_pattern_list([
       pexpect.EOF,
       reo,
       durationReo
    ])

    while True:
       i = thread.expect_list(cpl, timeout=None)
       if i == 0: # EOF
           print "the sub process exited"
           break
       elif i == 1:
           frame_number = thread.match.group(0)
           print frame_number
           print reo.search(frame_number).groups()
           # thread.close
       elif i == 2:
           durationLine = thread.match.group(0)
           print &#39;Duration:&#39;, durationLine
           # print "something :",thread.match.group(1)
           pass
    </bitrate></time></size></q></fps>

    with this code i can already get the frame info and duration info, the ultimate goal is to create a textual progress bar with another python progressbar module. but with the ability to send the 'q' pressed signal to ffmpeg child process.

  • Detecting the value scale of statistics returned from ffprobe

    15 septembre 2023, par Farski

    I'm using ffprobe to detect max and min levels for various audio files. An example of the command I'm using is :

    &#xA;

    ffprobe -v error -f lavfi -i amovie=my_song.mp3,asetnsamples=n=4410,astats=metadata=1:reset=1 -show_entries frame_tags=lavfi.astats.Overall.Max_level,lavfi.astats.Overall.Min_level -of json

    &#xA;

    The max/min level values returned use different scales, depending on the format of the input file.

    &#xA;

    For example, an MP3 file may return fractional values from -1.0 to 1.0 representing a percent of maximum level. A signed 16 bit WAV file returns values in the range -32,768 to 32767. A signed 32 bit FLAC file uses the range -2,147,483,648 to 2,147,483,647. In these cases, the bit size of the values matches the bit depth of the audio file.

    &#xA;

    In other cases, such as a signed 8 bit WAV file, the results are returned using a scale that does not match the input file, such as 16 bit scale (-32,768 to 32767).

    &#xA;

    I'm trying to determine if there's anyway to detect which format or scale ffprobe is using when the results are returned, besides trying to do it heuristically. I haven't been able to find any other value that gets returned which specifically reflects the number system being used to generate these levels values. sample_fmt does, in some cases, match, but in cases such as a s8 WAV file, sample_fmt would return s8, which does not match the number format of the returned levels values (s16).

    &#xA;

    If it's not possible to request this information from ffprobe JIT, is there anywhere in the code base that would describe how it determines which scale to use ?

    &#xA;