Recherche avancée

Médias (1)

Mot : - Tags -/book

Autres articles (69)

  • La file d’attente de SPIPmotion

    28 novembre 2010, par

    Une file d’attente stockée dans la base de donnée
    Lors de son installation, SPIPmotion crée une nouvelle table dans la base de donnée intitulée spip_spipmotion_attentes.
    Cette nouvelle table est constituée des champs suivants : id_spipmotion_attente, l’identifiant numérique unique de la tâche à traiter ; id_document, l’identifiant numérique du document original à encoder ; id_objet l’identifiant unique de l’objet auquel le document encodé devra être attaché automatiquement ; objet, le type d’objet auquel (...)

  • 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

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

  • Can't fix this ffmpeg, NoClassDefFoundError

    15 mars 2023, par noob234

    I am trying to get the video duration with this library import org.bytedeco.javacv.FFmpegFrameGrabber;

    


    When I upload this mp4 video (https://sample-videos.com/video123/mp4/720/big_buck_bunny_720p_1mb.mp4), I get this error message :
java.lang.NoClassDefFoundError: Could not initialize class org.bytedeco.ffmpeg.global.avutil

    


    It will break when trying to get the 'grabber' :

    


    private void videoInfo(MultipartFile file) {
    try (FFmpegFrameGrabber grabber = new FFmpegFrameGrabber(file.getInputStream())) { // on this line it will break :(
        grabber.start();
        long durationMs = grabber.getLengthInTime();
    } catch (FrameGrabber.Exception e) {
        throw new RuntimeException(e);
    } catch (IOException e) {
        throw new RuntimeException(e);
    }
}


    


    This is my build.gradle :

    


    plugins {
    id 'java'
    id 'org.springframework.boot' version '2.7.9'
    id 'io.spring.dependency-management' version '1.0.15.RELEASE'
}

group = 'com.nob234'
version = '0.0.1-SNAPSHOT'

configurations {
    compileOnly {
        extendsFrom annotationProcessor
    }
}

repositories {
    mavenCentral()
}

dependencies {
    implementation 'org.springframework.boot:spring-boot-starter-web'
    compileOnly 'org.projectlombok:lombok'
    annotationProcessor 'org.projectlombok:lombok'
    testImplementation 'org.springframework.boot:spring-boot-starter-test'
    implementation 'org.springdoc:springdoc-openapi-ui:1.6.9'
    implementation 'org.springframework.boot:spring-boot-starter-data-jpa'
    runtimeOnly 'org.postgresql:postgresql'
    // for logging
    implementation 'org.slf4j:slf4j-api:1.7.30'
    implementation 'org.slf4j:jcl-over-slf4j:1.7.30'
    implementation 'org.slf4j:log4j-over-slf4j:1.7.30'
    implementation 'ch.qos.logback:logback-classic:1.2.3'
    implementation 'org.bytedeco:javacv:1.5.8'
}

tasks.named('test') {
    useJUnitPlatform()
}


    


    This is my ffmpeg version :

    


    ffmpeg version 6.0-full_build-www.gyan.dev Copyright (c) 2000-2023 the FFmpeg developers
built with gcc 12.2.0 (Rev10, Built by MSYS2 project)
configuration: --enable-gpl --enable-version3 --enable-static --disable-w32threads --disable-autodetect --enable-fontconfig --enable-iconv --enable-gnutls --enable-libxml2 --enable-gmp --enable-bzlib --enable-lzma --enable-libsnappy --enable-zlib --enable-librist --enable-libsrt --enable-libssh --enable-libzmq --enable-avisynth --enable-libbluray --enable-libcaca --enable-sdl2 --enable-libaribb24 --enable-libdav1d --enable-libdavs2 --enable-libuavs3d --enable-libzvbi --enable-librav1e --enable-libsvtav1 --enable-libwebp --enable-libx264 --enable-libx265 --enable-libxavs2 --enable-libxvid --enable-libaom --enable-libjxl --enable-libopenjpeg --enable-libvpx --enable-mediafoundation --enable-libass --enable-frei0r --enable-libfreetype --enable-libfribidi --enable-liblensfun --enable-libvidstab --enable-libvmaf --enable-libzimg --enable-amf --enable-cuda-llvm --enable-cuvid --enable-ffnvcodec --enable-nvdec --enable-nvenc --enable-d3d11va --enable-dxva2 --enable-libvpl --enable-libshaderc --enable-vulkan --enable-libplacebo --enable-opencl --enable-libcdio --enable-libgme --enable-libmodplug --enable-libopenmpt --enable-libopencore-amrwb --enable-libmp3lame --enable-libshine --enable-libtheora --enable-libtwolame --enable-libvo-amrwbenc --enable-libilbc --enable-libgsm --enable-libopencore-amrnb --enable-libopus --enable-libspeex --enable-libvorbis --enable-ladspa --enable-libbs2b --enable-libflite --enable-libmysofa --enable-librubberband --enable-libsoxr --enable-chromaprint
libavutil      58.  2.100 / 58.  2.100
libavcodec     60.  3.100 / 60.  3.100
libavformat    60.  3.100 / 60.  3.100
libavdevice    60.  1.100 / 60.  1.100
libavfilter     9.  3.100 /  9.  3.100
libswscale      7.  1.100 /  7.  1.100
libswresample   4. 10.100 /  4. 10.100
libpostproc    57.  1.100 / 57.  1.100


    


    Please keep in mind that I use Java 8 in this project and I hope this issue is reproducible. If you want more info please leave a comment.

    


  • ServletOutputStream failed to flush :

    18 septembre 2024, par Dawid

    I try to convert m3u8 file to WebM using ffmpeg and stream it onto browser.
I want it to play on browser without using any javascript.
Stream video method :

    


     public void streamVideo(OutputStream os ){

       String url = "m3u8file.m3u8";


        byte[] bytes = new byte[BUFFER];
        int bytesRead = -1;

        ProcessBuilder pb = new ProcessBuilder(
                "ffmpeg",
                "-i", url,
                "-c:v", "libvpx-vp9",  
                "-b:v", "1M",           
                "-c:a", "libopus",      
                "-b:a", "128k",
                "-f", "webm",           
                "pipe:1"                
        );
        pb.redirectErrorStream(true);

        try {
                    Process process = pb.start();
            try (
                    InputStream is = process.getInputStream()){

                while((bytesRead = is.read(bytes)) != -1){
                    os.write(bytes, 0 , bytesRead);
                    os.flush();
                }


            }catch (IOException ex){
                ex.printStackTrace();
            }


        }catch (IOException ex){
            ex.printStackTrace();
        }



    }


}


    


    Web Controller

    


     &#xA; @Autowired&#xA;    private VideoService videoService;&#xA;&#xA;    @GetMapping("/stream")&#xA;    public ResponseEntity<streamingresponsebody> streamVideo(@RequestHeader(value = "Range", required = false) String rangeHeader) {&#xA;        HttpHeaders headers = new HttpHeaders();&#xA;&#xA;        headers.add("Content-Type", "video/webm");&#xA;        headers.add("Accept-Ranges", "bytes");&#xA;&#xA;        StreamingResponseBody responseStream  = os ->{&#xA;            videoService.streamVideo(os);&#xA;        };&#xA;        return new ResponseEntity&lt;>(responseStream, headers, HttpStatus.PARTIAL_CONTENT);&#xA;    }&#xA;</streamingresponsebody>

    &#xA;

    When I open the /stream I get an error on spring application

    &#xA;

    "ServletOutputStream failed to flush : java.io.IOException : An established connection was aborted by the software in your host machine"

    &#xA;

      &#xA;
    • On firefox in console I got 2 errors&#xA;Cant decode multimedia resource :&#xA;And Cant decode multimedia resource:Error Code : NS_ERROR_DOM_MEDIA_METADATA_ERR (0x806e0006)&#xA;And the window which video will be showing says "No video with supported format and MIME type found"

      &#xA;

    • &#xA;

    • On Chrome just nothing happens

      &#xA;

    • &#xA;

    • And on firefox when i open the view-source i see the stream information and then there is jibberish which i suppose are bytes from the video the. The jibberish stops when i got the ServletOutputStream failed to flush : in console in Spring

      &#xA;

    • &#xA;

    &#xA;

    Sorry if error codes translation is hard to understand

    &#xA;

  • ffmpeg padding doesn't scale when changing resolution

    5 mars 2023, par Martin

    I have a ffmpeg command which takes a bunch of audio files, 3 image files, and renders a video with them.

    &#xA;

    Image Input Dimmensions :

    &#xA;

      &#xA;
    • 1_front.jpg 600w x 593h
    • &#xA;

    • 2_back.jpg 600w x 466h
    • &#xA;

    • 3_cd.jpg 600w x 598h
    • &#xA;

    &#xA;

    The video has a resolution of w=600 h=593, which is the resolution of the first img.

    &#xA;

    Here's the full command

    &#xA;

    ffmpeg&#xA; -r 2 -i "E:\filepath\10. Deejay Punk-Roc - Knock &#x27;em All The Way Out.aiff"&#xA; -r 2 -i "E:\filepath\11. Deejay Punk-Roc - Spring Break.aiff" -r 2 -i "E:\filepath\12. Deejay Punk-Roc - Fat Gold Chain.aiff" &#xA; -r 2 -i "E:\filepath\1_front.jpg" -r 2 -i "E:\filepath\2_back.jpg" -r 2 -i "E:\filepath\3_cd.jpg" &#xA; &#xA; -filter_complex &#xA; "&#xA; [0:a][1:a][2:a]concat=n=3:v=0:a=1[a]; &#xA; &#xA; [3:v]scale=w=600:h=593,setsar=1,loop=580.03:580.03[v3]; &#xA;&#xA; [4:v]pad=600:593:0:63:color=pink,setsar=1,loop=580.03:580.03[v4];&#xA; &#xA; [5:v]scale=w=600:h=593,setsar=1,loop=580.03:580.03[v5];&#xA; &#xA; [v3][v4][v5]concat=n=3:v=1:a=0,pad=ceil(iw/2)*2:ceil(ih/2)*2[v]"&#xA; &#xA;  -map "[v]" -map "[a]" -c:a pcm_s32le -c:v libx264 -bufsize 3M -crf 18 -pix_fmt yuv420p -tune stillimage -t 870.04 &#xA;  "E:\filepath\vidOutPutCorrect.mkv"&#xA;&#xA;

    &#xA;

    For filter_complex this second part will add padding to the second image so that it does not get stretched or cropped.

    &#xA;

    [4:v]pad=600:593:0:63:color=pink,setsar=1,loop=580.03:580.03[v4];&#xA;

    &#xA;

    Specifically this part

    &#xA;

    pad=600:593:0:63:color=pink&#xA;

    &#xA;

    Which I understand means w=600 and h=593, but i dont know that the last part 0:63 means.

    &#xA;

    You can see the output has the pink padding correctly&#xA;enter image description here

    &#xA;

    but i want to render the video with a resolution of w=1920 h=1898 instead of w=600 h=593.

    &#xA;

    So i update the command to have this new resolution :

    &#xA;

    ffmpeg -r 2 -i "E:\filepath\10. Deejay Punk-Roc - Knock &#x27;em All The Way Out.aiff" -r 2 -i "E:\filepath\11. Deejay Punk-Roc - Spring Break.aiff" -r 2 -i "E:\filepath\12. Deejay Punk-Roc - Fat Gold Chain.aiff" -r 2 -i "E:\filepath\1_front.jpg" -r 2 -i "E:\filepath\2_back.jpg" -r 2 -i "E:\filepath\3_cd.jpg" &#xA;&#xA;-filter_complex "&#xA;[0:a][1:a][2:a]concat=n=3:v=0:a=1[a];&#xA;&#xA;[3:v]scale=w=1920:h=1898,setsar=1,loop=580.03:580.03[v3];&#xA;&#xA;[4:v]pad=1920:1898:0:63:color=pink,setsar=1,loop=580.03:580.03[v4];&#xA;&#xA;[5:v]scale=w=1920:h=1898,setsar=1,loop=580.03:580.03[v5];&#xA;&#xA;[v3][v4][v5]concat=n=3:v=1:a=0,pad=ceil(iw/2)*2:ceil(ih/2)*2[v]"&#xA;&#xA; -map "[v]" -map "[a]" -c:a pcm_s32le -c:v libx264 -bufsize 3M -crf 18 -pix_fmt yuv420p -tune stillimage -t 870.04 "E:\filepath\slidet.mkv"&#xA;

    &#xA;

    my video does in fact now have a resolution of 1920x1798 which is great, but the 2nd image padding portion has the image super small and in a corner

    &#xA;

    enter image description here

    &#xA;

    So this line works :

    &#xA;

    pad=600:593:0:63:color=pink&#xA;

    &#xA;

    but with a different resolution is looks bad with the image in the top left corner

    &#xA;

    pad=1920:1898:0:63:color=pink&#xA;

    &#xA;

    What do I need to change 0:63 to in order to have the image be centered ?

    &#xA;

    Download files : http://www.mediafire.com/folder/e8ja1n8elszk1lu,dxw4vglrz7polyh,ojjx6kcqruksv5r,lah9rano4svj46o,q5jg0083vbj9y1p,d3pt8ydf3ulqm5m/shared

    &#xA;