Recherche avancée

Médias (3)

Mot : - Tags -/image

Autres articles (70)

  • Websites made ​​with MediaSPIP

    2 mai 2011, par

    This page lists some websites based on MediaSPIP.

  • List of compatible distributions

    26 avril 2011, par

    The table below is the list of Linux distributions compatible with the automated installation script of MediaSPIP. Distribution nameVersion nameVersion number Debian Squeeze 6.x.x Debian Weezy 7.x.x Debian Jessie 8.x.x Ubuntu The Precise Pangolin 12.04 LTS Ubuntu The Trusty Tahr 14.04
    If you want to help us improve this list, you can provide us access to a machine whose distribution is not mentioned above or send the necessary fixes to add (...)

  • Publier sur MédiaSpip

    13 juin 2013

    Puis-je poster des contenus à partir d’une tablette Ipad ?
    Oui, si votre Médiaspip installé est à la version 0.2 ou supérieure. Contacter au besoin l’administrateur de votre MédiaSpip pour le savoir

Sur d’autres sites (9390)

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

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

    &#xA;

    You can check out the live site Here.

    &#xA;

    Steps to reproduce the error.

    &#xA;

      &#xA;
    1. Upload the png file,
    2. &#xA;

    3. Select SVG as output file
    4. &#xA;

    5. Click convert.
    6. &#xA;

    &#xA;

    It is throwing error.

    &#xA;

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

    &#xA;

    // 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;

  • Different ffmpeg result after saving to png

    28 juillet 2023, par Kalev Maricq

    Saving images to PNG first seems to produce different ffmpeg encodes. Running this test code

    &#xA;

    from PIL import Image&#xA;import cv2&#xA;import ffmpeg&#xA;import hashlib&#xA;&#xA;ffmpeg.input(&#x27;test.jpg&#x27;).output(&#x27;testff.png&#x27;).run()&#xA;cv2.imwrite(&#x27;testcv.png&#x27;,cv2.imread(&#x27;test.jpg&#x27;))&#xA;Image.open(&#x27;test.jpg&#x27;).save(&#x27;testpil.png&#x27;)&#xA;&#xA;hashes=[]&#xA;for suf in [&#x27;.jpg&#x27;,&#x27;ff.png&#x27;,&#x27;cv.png&#x27;,&#x27;pil.png&#x27;]:&#xA;    dest=&#x27;test&#x27;&#x2B;suf.replace(&#x27;.&#x27;,&#x27;&#x27;)&#x2B;&#x27;.mp4&#x27;&#xA;    ffmpeg.input(&#x27;test&#x27;&#x2B;suf).output(dest).run()&#xA;    hashes.append(hashlib.file_digest(open(dest,&#x27;rb&#x27;),&#x27;md5&#x27;).hexdigest())&#xA;    &#xA;print(hashes)&#xA;

    &#xA;

    I get
    &#xA;['a5b744a8ac0f6de9ec4de43ff737c46e'
    &#xA;,'ab62474f2160899e064ba24890047372'
    &#xA;,'baa788d5e4ef212ab610b8b5cf7772cb'
    &#xA;,'baa788d5e4ef212ab610b8b5cf7772cb']

    &#xA;

    As you can see, the only two that match are the cv2 and pillow conversions, and none of them match the original. In terms of file size, the results that passed to png first seem to be about 10% smaller than the direct-from-jpg result.

    &#xA;

    Why is this happening and how can I avoid changing image data until I'm ready to encode ?

    &#xA;