Recherche avancée

Médias (39)

Mot : - Tags -/audio

Autres articles (70)

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

  • Support audio et vidéo HTML5

    10 avril 2011

    MediaSPIP utilise les balises HTML5 video et audio pour la lecture de documents multimedia en profitant des dernières innovations du W3C supportées par les navigateurs modernes.
    Pour les navigateurs plus anciens, le lecteur flash Flowplayer est utilisé.
    Le lecteur HTML5 utilisé a été spécifiquement créé pour MediaSPIP : il est complètement modifiable graphiquement pour correspondre à un thème choisi.
    Ces technologies permettent de distribuer vidéo et son à la fois sur des ordinateurs conventionnels (...)

  • HTML5 audio and video support

    13 avril 2011, par

    MediaSPIP uses HTML5 video and audio tags to play multimedia files, taking advantage of the latest W3C innovations supported by modern browsers.
    The MediaSPIP player used has been created specifically for MediaSPIP and can be easily adapted to fit in with a specific theme.
    For older browsers the Flowplayer flash fallback is used.
    MediaSPIP allows for media playback on major mobile platforms with the above (...)

Sur d’autres sites (9029)

  • ffmpeg minterpolate and rubberband - how to stretch audio to fit ?

    5 juin 2023, par bossturbo

    What is the best way to control the length of the audio and pitch shift using rubberband ?

    


    I tried setting 'asetpts=PTS*16' to match the video PTS, but it appears to be ignored. The only thing that seems to determine the length of the audio is rubberband pitch. Even 'tempo=0.0625' does not appear to do anything.

    


    I would like to be able to set the audio length to match the slower video section and set the pitch to whatever I want, like minimum 0.15 and have it stretch the audio length as needed.

    


    ffmpeg -ss 123.978571 -i "original-120fps.MP4" -filter_complex "
[0:v]trim=0:0.375,setpts=PTS-STARTPTS,minterpolate='fps=480',setpts=PTS*16[slowv]; 
[0:a]atrim=0:0.375,asetpts=PTS-STARTPTS,rubberband=pitch=0.08:tempo=0.0625[slowa];"
 -y -r 60 -map [slowv] -map [slowa] -preset veryfast "output.mp4"


    


    Finally, is there a good guide to using lib-rubberband ? FFmpeg docs for rubberband doesn't explain anything.

    


  • 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

    


    from PIL import Image
import cv2
import ffmpeg
import hashlib

ffmpeg.input('test.jpg').output('testff.png').run()
cv2.imwrite('testcv.png',cv2.imread('test.jpg'))
Image.open('test.jpg').save('testpil.png')

hashes=[]
for suf in ['.jpg','ff.png','cv.png','pil.png']:
    dest='test'+suf.replace('.','')+'.mp4'
    ffmpeg.input('test'+suf).output(dest).run()
    hashes.append(hashlib.file_digest(open(dest,'rb'),'md5').hexdigest())
    
print(hashes)


    


    I get
    
['a5b744a8ac0f6de9ec4de43ff737c46e'
    
,'ab62474f2160899e064ba24890047372'
    
,'baa788d5e4ef212ab610b8b5cf7772cb'
    
,'baa788d5e4ef212ab610b8b5cf7772cb']

    


    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.

    


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

    


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