Recherche avancée

Médias (2)

Mot : - Tags -/media

Autres articles (64)

  • Submit bugs and patches

    13 avril 2011

    Unfortunately a software is never perfect.
    If you think you have found a bug, report it using our ticket system. Please to help us to fix it by providing the following information : the browser you are using, including the exact version as precise an explanation as possible of the problem if possible, the steps taken resulting in the problem a link to the site / page in question
    If you think you have solved the bug, fill in a ticket and attach to it a corrective patch.
    You may also (...)

  • Personnaliser les catégories

    21 juin 2013, par

    Formulaire de création d’une catégorie
    Pour ceux qui connaissent bien SPIP, une catégorie peut être assimilée à une rubrique.
    Dans le cas d’un document de type catégorie, les champs proposés par défaut sont : Texte
    On peut modifier ce formulaire dans la partie :
    Administration > Configuration des masques de formulaire.
    Dans le cas d’un document de type média, les champs non affichés par défaut sont : Descriptif rapide
    Par ailleurs, c’est dans cette partie configuration qu’on peut indiquer le (...)

  • Les formats acceptés

    28 janvier 2010, par

    Les commandes suivantes permettent d’avoir des informations sur les formats et codecs gérés par l’installation local de ffmpeg :
    ffmpeg -codecs ffmpeg -formats
    Les format videos acceptés en entrée
    Cette liste est non exhaustive, elle met en exergue les principaux formats utilisés : h264 : H.264 / AVC / MPEG-4 AVC / MPEG-4 part 10 m4v : raw MPEG-4 video format flv : Flash Video (FLV) / Sorenson Spark / Sorenson H.263 Theora wmv :
    Les formats vidéos de sortie possibles
    Dans un premier temps on (...)

Sur d’autres sites (13271)

  • Call FFmpeg via JavaCPP:Caused by : java.lang.NoClassDefFoundError : Could not initialize class org.bytedeco.javacpp.avformat$AVFormatContext

    8 décembre 2017, par Xuan

    In CentOS, use javacpp call FFmpeg to do video cropping a frame, in my own development machine using this code is no problem, but in centos6 reported NoClassDefFound : Could not initialize class org.bytedeco.javacpp.avutil

    Caused by: java.lang.NoClassDefFoundError: Could not initialize class org.bytedeco.javacpp.avformat$AVFormatContext
       at org.bytedeco.javacv.FFmpegFrameGrabber.startUnsafe(FFmpegFrameGrabber.java:383) ~[javacv-1.0.jar:1.0]
       at org.bytedeco.javacv.FFmpegFrameGrabber.start(FFmpegFrameGrabber.java:377) ~[javacv-1.0.jar:1.0]
       at cn.xxtui.support.upload.BasicUpload.convertImage(BasicUpload.java:211) ~[classes/:?]
       at cn.xxtui.support.upload.BasicUpload.upload(BasicUpload.java:197) ~[classes/:?]
       at cn.com.ql.wiseBeijing.upload.UploadImage.upload(UploadImage.java:144) ~[classes/:?]
       at cn.com.ql.wiseBeijing.upload.UploadImage.imageCategory(UploadImage.java:51) ~[classes/:?]
       at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method) ~[?:1.7.0_25]
       at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:57) ~[?:1.7.0_25]
       at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43) ~[?:1.7.0_25]
       at java.lang.reflect.Method.invoke(Method.java:606) ~[?:1.7.0_25]
       at org.apache.cxf.service.invoker.AbstractInvoker.performInvocation(AbstractInvoker.java:180) ~[cxf-core-3.1.12.jar:3.1.12]
       at org.apache.cxf.service.invoker.AbstractInvoker.invoke(AbstractInvoker.java:96) ~[cxf-core-3.1.12.jar:3.1.12]
       ... 37 more

    This is my pom configuration:

    <dependency>
       <groupid>org.bytedeco</groupid>
       <artifactid>javacv</artifactid>
       <version>1.0</version>
    </dependency>
    <dependency>
       <groupid>org.bytedeco</groupid>
       <artifactid>javacpp</artifactid>
       <version>1.0</version>
    </dependency>
    <dependency>
       <groupid>com.github.hoary.ffmpeg</groupid>
       <artifactid>FFmpeg-linux-x86_64</artifactid>
       <version>2.0.1.1
       </version>
    </dependency>
    <dependency>
       <groupid>org.bytedeco.javacpp-presets</groupid>
       <artifactid>ffmpeg</artifactid>
       <version>2.7.1-1.0</version>
    </dependency>

    This is my code:

    public String convertImage(String filePath, String imagePath) throws IOException, FrameGrabber.Exception {
       FFmpegFrameGrabber g = new FFmpegFrameGrabber(filePath);
       g.start();
       Java2DFrameConverter java2DFrameConverter = new Java2DFrameConverter();
       BufferedImage bufferedImage = java2DFrameConverter.convert(g.grabImage());
       String path = imagePath + System.currentTimeMillis() + ".png";
       ImageIO.write(bufferedImage, "png", new File(path));
       g.stop();
       return path;
    }
  • FFmpeg max audio overhead

    15 août 2020, par Alsors

    So I'm encoding videos with FFmpeg. I've set the video stream to have a maximum rate of 6840 kbps and the audio stream to have a constant rate of 160 kbps (AAC) so once they're added together it's a maximum combined rate of 7000 kbps (the maximum rate before my video sharing service re-encodes the video and audio). The problem is sometimes the audio stream likes to go above it's designated constant rate (not by much however enough to take it over 7000 kbps), even with the exact same command it'll sometimes go above and sometime stay the same.

    &#xA;

    My question : is there a way to calculate the maximum overhead of the audio stream ? I'm assuming FFmpeg has a point where it will not allow the audio rate to go any higher ? What is that exact rate ?

    &#xA;

  • mp4 video written with ffmpeg has different first frame based on total number of frames

    25 janvier 2023, par Nitzan Weissman

    I have a code that writes and reads videos in Python, I'm doing the writing using ffmpeg. I noticed a weird phenomenon, where the first frame changes based on the total number of frames in the video. I find it weird because the first frame is a key frame (I checked it using ffprobe)

    &#xA;

    The code I'm using :

    &#xA;

    The writing function

    &#xA;

    import shutil&#xA;import subprocess&#xA;def write_h264_video(video_path: str, images: np.ndarray, fps: float):&#xA;    image_name_template = &#x27;00%04d.png&#x27;&#xA;    tmp_image_dir = (Path(video_path).parent / &#x27;tmp_imgs&#x27;)&#xA;    tmp_image_dir.mkdir()&#xA;&#xA;    for ii, image in enumerate(images):&#xA;        cv2.imwrite(f&#x27;{str(tmp_image_dir / str(ii).zfill(6))}.png&#x27;, image[..., ::-1])    &#xA;    command = f&#x27;ffmpeg -hide_banner -loglevel error -framerate {fps} -y -i {tmp_image_dir}/{image_name_template} &#x27; \&#xA;            f&#x27; -c:v libx264 -pix_fmt yuv420p {video_path} -y&#x27;&#xA;    subprocess.call(command, shell=True)&#xA;    shutil.rmtree(tmp_image_dir)&#xA;

    &#xA;

    The main code

    &#xA;

    import numpy as np&#xA;from pathlib import Path&#xA;import decord&#xA;decord.bridge.set_bridge(&#x27;torch&#x27;)&#xA;&#xA;input_video_path = Path(&#x27;&#x27;)&#xA;tmp_path = Path(&#x27;&#x27;)&#xA;input_video = decord.VideoReader(str(input_video_path))&#xA;&#xA;frames = np.zeros((20, 512, 512, 3), dtype = np.uint8)&#xA;for i in range(20):&#xA;    frames[i] = input_video[i].detach().cpu().numpy()&#xA;    &#xA;long_video_path = tmp_path / &#x27;long_video.mp4&#x27;&#xA;short_video_path = tmp_path / &#x27;short_video.mp4&#x27;&#xA;&#xA;fps = 30&#xA;write_h264_video(str(long_video_path), frames, fps=fps)&#xA;write_h264_video(str(short_video_path), frames[:10], fps=fps)&#xA;&#xA;&#xA;long_video = decord.VideoReader(str(long_video_path))&#xA;short_video = decord.VideoReader(str(short_video_path))&#xA;&#xA;long_frame_0 = long_video[0]&#xA;short_frame_0 = short_video[0]&#xA;(long_frame_0 == short_frame_0).all()&#xA;

    &#xA;

    I am supposed to get True, but I'm getting False.&#xA;I tried reading using other methods, using opencv for example, and the issue persists.&#xA;There are other ways to write videos of course, but I'm interested in ffmpeg-based ways.

    &#xA;

    Thanks !

    &#xA;