Recherche avancée

Médias (1)

Mot : - Tags -/book

Autres articles (93)

  • Keeping control of your media in your hands

    13 avril 2011, par

    The vocabulary used on this site and around MediaSPIP in general, aims to avoid reference to Web 2.0 and the companies that profit from media-sharing.
    While using MediaSPIP, you are invited to avoid using words like "Brand", "Cloud" and "Market".
    MediaSPIP is designed to facilitate the sharing of creative media online, while allowing authors to retain complete control of their work.
    MediaSPIP aims to be accessible to as many people as possible and development is based on expanding the (...)

  • Les images

    15 mai 2013
  • Taille des images et des logos définissables

    9 février 2011, par

    Dans beaucoup d’endroits du site, logos et images sont redimensionnées pour correspondre aux emplacements définis par les thèmes. L’ensemble des ces tailles pouvant changer d’un thème à un autre peuvent être définies directement dans le thème et éviter ainsi à l’utilisateur de devoir les configurer manuellement après avoir changé l’apparence de son site.
    Ces tailles d’images sont également disponibles dans la configuration spécifique de MediaSPIP Core. La taille maximale du logo du site en pixels, on permet (...)

Sur d’autres sites (6488)

  • Playing Video on a Sega Dreamcast

    9 mars 2011, par Multimedia Mike — Sega Dreamcast

    Here’s an honest engineering question : If you were tasked to make compressed video play back on a Sega Dreamcast video game console, what video format would you choose ? Personally, I would choose RoQ, the format invented for The 11th Hour computer game and later used in Quake III and other games derived from the same engine. This post explains my reasoning.

    Video Background
    One of the things I wanted to do when I procured a used Sega Dreamcast back in 2001 was turn it into a set-top video playback unit. This is something that a lot of people tried to do, apparently, to varying degrees of success. Interest would wane in a few years as it became easier and easier to crack an Xbox and install XBMC. The Xbox was much better suited to playing codecs that were getting big at the time, most notably MPEG-4 part 2 video (DivX/XviD).

    The Dreamcast, while quite capable when it was released in 1999, was not very well-equipped to deal with an MPEG-type codec. I have recently learned that there are other hackers out there on the internet who are still trying to get the most out of this system. I was contacted for advice about how to make Theora perform better on the Dreamcast.

    Interesting thing about consoles and codecs : Since you are necessarily distributing code along with your data, you have far more freedom to use whatever codecs you want for your audio and video data. This is why Vorbis and even Theora have seen quite a bit of use in video games, "internet standards" be darned. Thus, when I realized this application had no hard and fast requirement to use Theora, and that it could use any codec that fit the platform, my mind started churning. When I was programming the DC 10 years ago, I didn’t have access to the same wealth of multimedia knowledge that is currently available.

    Requirements Gathering
    What do we need here ?

    • Codec needs to run on the Sega Dreamcast ; this eliminates codecs for which only binary decoder implementations are available
    • Must decode 320x240 video at 30 fps ; higher resolutions up to 640x480 would be desirable
    • Must deliver decent quality at 12X optical read speeds (DC drive speed)
    • There must be some decent, preferably free, encoder readily available ; speed of encoding, however, is not important ; i.e., "take as long as you need, encoder"

    Theora was the go-to codec because it’s just commonly known as "the free, open source video codec". But clearly it’s not suitable for, well... any purpose, really (sorry, easy target ; OW ! stop throwing things !). VP8/WebM — Theora’s heir apparent — would not qualify either, as my prior experiments have already demonstrated.

    Candidates
    What did the big boys use for video on the Dreamcast ? A lot of games relied on CRI’s Sofdec middleware which was MPEG-1 video and a custom ADPCM format. I don’t know if I have ever seen DC games that used MPEG-1 video at a higher resolution than 320x240 (though I have not searched exhaustively). The fact that CRI used a custom ADPCM format for this application may indicate that there wasn’t enough CPU power left over to decode a perceptual, transform-based audio codec alongside the 320x240 video.

    A few other DC games used 4X Technologies’ 4XM format. The most notable licensee was Alone in the Dark : The New Nightmare (DC version only ; PC version used Bink). This codec was DCT-based but incorporated 16-bit RGB colorspace into its design, presumably to optimize for applications like game consoles that couldn’t directly handle planar YUV. AITD:TNN’s videos were 640x360, a marked improvement over the typical Sofdec fare. I was about to write off 4XM as a contender due to lack of encoder, but the encoding tools are preserved on our samples site. A few other issues, though : The FFmpeg decoder doesn’t seem to work correctly as of this writing (and nobody has noticed yet, even though it’s tested via FATE).

    What ideas do I have ? Right off the bat, I’m thinking vector quantizer (VQ). Vector quantizers are notoriously slow to compress but are blazingly fast to decompress which is why they were popular in the early days of video compression. First, there’s Cinepak. I fear that might be too simple for this application. Plus, I don’t know if existing (binary-only) compressors are very decent. It seems that they only ever had to handle small videos and I’ve heard that they can really fall over if anything more is demanded of them.

    Sorenson Video 1 is another contender. FFmpeg has an encoder (which some allege is better than Sorenson’s original compressor). However, I fear that the wonky algorithm and colorspace might not mesh well with the Dreamcast.

    My thinking quickly converged on RoQ. This was designed to run fullscreen (640x480) video on i486-class hardware. While RoQ fundamentally operates in a YUV colorspace, it’s trivial to convert it to any other colorspace during decoding and the image will be rendered in that colorspace. Plus, there are open source encoders available for the format (namely, several versions of Eric Lasota’s Switchblade encoder, one of which lives natively in FFmpeg), as well as the original proprietary encoder.

    Which Library ?
    There are several code choices here : FFmpeg (LGPL), Switchblade (GPL), and the original Quake 3 source code (GPL). There is one more option that I think might be easiest, which is the decoder Dr. Tim created when he reverse engineered the format in the first place. That has a very liberal "do whatever you like, but be nice and give me credit" license (probably qualifies as BSD).

    This code is no longer at its original home but the Wayback Machine still had a copy, which I have now mirrored (idroq.tar.gz).

    Adaptation
    Dr. Tim’s code still compiles and runs great on Linux (64-bit !) with SDL output. I would like to get it ported to the Dreamcast using the same SDL output, which KallistiOS supports. Then, there is the matter of fixing the longstanding chroma bug in the original sample decoder (described here). The decoder also needs to be modified to natively render RGB565 data, as that will work best with the DC’s graphics hardware.

    After making the code work, I want to profile it and test whether it can handle full-frame 640x480 playback at 30 frames/second. I will need to contrive a sample to achieve this.

    Unfortunately, things went off the rails pretty quickly when I tried to get the RoQ decoder ported to DC/KOS. It looks like there’s a bug in KallistiOS’s minimalistic standard C library, or at least a discrepancy with my desktop Linux system. When you read to the end of a file and then seek backwards to someplace that isn’t the end, is the file still in EOF state ?

    According to my Linux desktop :

    open file ;          feof() = 0
    seek to end ;        feof() = 0
    read one more byte ; feof() = 1
    seek back to start ; feof() = 0
    

    According to KallistiOS :

    open file ;          feof() = 0
    seek to end ;        feof() = 0
    read one more byte ; feof() = 1
    seek back to start ; feof() = 1
    

    Here’s the seek-test.c program I used to test this issue :

    C :
    1. #include <stdio .h>
    2.  
    3. int main()
    4. {
    5.   FILE *f ;
    6.   unsigned char byte ;
    7.  
    8.   f = fopen("seek_test.c", "r") ;
    9.   printf("open file ;     feof() = %d\n", feof(f)) ;
    10.   fseek(f, 0, SEEK_END) ;
    11.   printf("seek to end ;    feof() = %d\n", feof(f)) ;
    12.   fread(&byte, 1, 1, f) ;
    13.   printf("read one more byte ; feof() = %d\n", feof(f)) ;
    14.   fseek(f, 0, SEEK_SET) ;
    15.   printf("seek back to start ; feof() = %d\n", feof(f)) ;
    16.   fclose(f) ;
    17.  
    18.   return 0 ;
    19. }

    EOF
    Speaking of EOF, I’m about done for this evening.

    What codec would you select for this task, given the requirements involved ?

  • C++/OpenCV - VideoCapture doesn't work but it worked before with exactly the same code

    5 mars 2015, par Damià Obrador

    I’m trying to write a shot boundary detection algorithm in C++ using OpenCV. After all, I have to say that I have no experience working with OpenCV.

    I have been improving the following code (and I am still in it) during the last two weeks and everything seems the works correctly, not in terms of perfect shot detection, but every line of code did what was expected from it.

    #include <cstdlib>
    #include <opencv2></opencv2>opencv.hpp>
    #include <opencv2></opencv2>core/core.hpp>
    #include <opencv2></opencv2>video/background_segm.hpp>
    #include <opencv2></opencv2>highgui/highgui.hpp>
    #include <iostream>
    #include <opencv2></opencv2>imgproc/imgproc.hpp>
    #include
    #include <istream>
    #include <fstream>
    using namespace cv;



    int main(){

       VideoCapture capture("vdevendetta.mp4");
       if ( !capture.isOpened() )
        {
            std::cout &lt;&lt; "Cannot open the video file";
            return -1;
        }
       int numFrames=capture.get(CV_CAP_PROP_FRAME_COUNT);
       bool SB_counter=false;
       Mat currentFrame;
       Mat frame;
       Mat fore;
       Mat back;
       vector<mat> frames;
       FileStorage file;
       FileStorage file2;
       Mat prev_Y;
       Mat channels[3];
       for(int i=0;i>currentFrame;
               frame=currentFrame.clone();
               cvtColor(frame,frame,CV_BGR2YUV);
               split( frame, channels );
               prev_Y=channels[0];
               SB_counter=false;
           }
           else
           {
               capture>>currentFrame;
               frame=currentFrame.clone();
               Mat channels[3];
               cvtColor(frame,frame,CV_BGR2YUV);
               split( frame, channels );
               Mat curr_Y=channels[0];
               channels[0]=prev_Y;
               prev_Y=curr_Y;
               merge(channels,3,frame);
               cvtColor(frame,frame,CV_Luv2BGR);
               cvtColor(frame,frame,CV_BGR2GRAY);
               frames.push_back(frame);
           }

       }

       vector<double> MAFDs;
       vector<double> MAFD;
       vector<double> aux;
       double min;
       double min2;

       for(int j=1;j14)
           {
               std::cout&lt;&lt;"De"&lt;*
       std::ofstream fout("MAFD.txt");
       if(fout.is_open()==true)
       {
         //file opened successfully so we are here
         std::cout &lt;&lt; "File Opened successfully!!!. Writing data from array to file" &lt;&lt; std::endl;

           for(int i = 0; MAFD[i] != '\0'; i++)
           {
           fout &lt;&lt; MAFD[i]; //writing ith character of array in the file
           }
         std::cout &lt;&lt; "Array data successfully saved into the file test.txt" &lt;&lt; std::endl;
       }
       else //file could not be opened
       {
           std::cout &lt;&lt; "File could not be opened." &lt;&lt; std::endl;
       }*/
       return 0;
    }
    </double></double></double></mat></fstream></istream></iostream></cstdlib>

    Three days ago I had an strange problem. The line :

    VideoCapture capture("vdevendetta.mp4");

    stopped working. I spent many hours looking for the solution but nothing seems to repair it. After reading everything related with OpenCV, VideoCapture and ffmpeg that I found on internet I decided to reinstall everything taking care of each detail, but it still didn’t work. Finally I solved it changing the line with this other one :

    VideoCapture capture("/home/damia/Documentos/Universitat/ARA/PAEAV/workspace_cpp/SBD/src/vdevendetta.mp4");

    I did not know why this solved it because the video is in the same directory than the program, but I continued working because everything seemed correct.
    Today I had the same problem again on the new line.
    The terminal doesn’t show any error comment (exceptuating "Cannot open the video file", obviously) but the code doesn’t work again.

    I’m using Ubuntu 14.04 LTS, OpenCV 2.4.9 and Eclipse.

    I think if someone test the code it will run correctly, but I would like to know if there is something I have no taking into account.

    Thank you very match.

  • ffmpeg, v4l, snd_aloop ... sound asyncron (alsa buffer xrun)

    28 janvier 2019, par Tobias

    I’m trying to create a stream that automatically reloads random inputs. I would like to extend this to a database later.

    Each time ffmpeg finishes and starts again, so the input changes, the connection to the rtmp is interrupted briefly causing the whole connection breaks down. I then tried to separate audio and video, to send them to virtual devices and read from there again. Split the stream on virtual devices, reassemble them directly and send them to rtmp. If the input is then exchanged, the sending to the devices interrupts what does not bother the second ffmpeg. As soon as I stop sending to the devices the fps go very slowly (10 - 20 sec) from 25 to 0. Only then does the transmitter ffmpeg break the connection to the rtmp. The script which exchanges the inputs needs only one second. A practical test showed that everything works as desired.

    I can quite comfortably change the input while the second ffmpeg maintains the stream ...

    The joy did not last long. The sound is good 1 sec delayed. But sporadically. Sometimes everything works great. Sometimes the sound is offset.

    I wrote several scripts for this.

    Background :

    1. File is selected by random
    2. Media file is split and written to / dev / video0 (v4l loopback) and alsa default (snd_aloop loopback)
    3. Put the splits together again and stream them to a rtmp server

    Code that selects the input and sends to / dev / video0 and alsa default

    #!/bin/bash

    cat /dev/null > log

    while true;
    do

     WATERMARK="watermark.png";
     dir='/homeXXXXXXXXXX/mix'
     file=`/bin/ls -1 "$dir" | sort --random-sort | head -1`
     DATEI=`readlink --canonicalize "$dir/$file"` # Converts to full path

    if [ -z $DATEI ]
    then
     echo "Keine Datei gefunden" >> log;
    else
     START=$(date +%s);
     echo "Sende $DATEI" >> log;
     ffmpeg -re -y -i "$DATEI" -c:v libx264 -vf "fps=25,scale=640:480,setdar=4:3" -async 1 -pix_fmt yuv420p -preset ultrafast -map 0:0 -f v4l2 -vcodec rawvideo /dev/video0 -f alsa default
    fi

    DOKILL=`cat kill`;
    if [ "$DOKILL" = "1"]
    then
     break;
    fi

    done

    The Output

    ./run.sh
    ffmpeg version 3.2.12-1~deb9u1 Copyright (c) 2000-2018 the FFmpeg developers
     built with gcc 6.3.0 (Debian 6.3.0-18+deb9u1) 20170516
     configuration: --prefix=/usr --extra-version='1~deb9u1' --toolchain=hardened --libdir=/usr/lib/x86_64-linux-gnu --incdir=/usr/include/x86_64-linux-gnu --enable-gpl --disable-stripping --enable-avresample --enable-avisynth --enable-gnutls --enable-ladspa --enable-libass --enable-libbluray --enable-libbs2b --enable-libcaca --enable-libcdio --enable-libebur128 --enable-libflite --enable-libfontconfig --enable-libfreetype --enable-libfribidi --enable-libgme --enable-libgsm --enable-libmp3lame --enable-libopenjpeg --enable-libopenmpt --enable-libopus --enable-libpulse --enable-librubberband --enable-libshine --enable-libsnappy --enable-libsoxr --enable-libspeex --enable-libssh --enable-libtheora --enable-libtwolame --enable-libvorbis --enable-libvpx --enable-libwavpack --enable-libwebp --enable-libx265 --enable-libxvid --enable-libzmq --enable-libzvbi --enable-omx --enable-openal --enable-opengl --enable-sdl2 --enable-libdc1394 --enable-libiec61883 --enable-chromaprint --enable-frei0r --enable-libopencv --enable-libx264 --enable-shared
     libavutil      55. 34.101 / 55. 34.101
     libavcodec     57. 64.101 / 57. 64.101
     libavformat    57. 56.101 / 57. 56.101
     libavdevice    57.  1.100 / 57.  1.100
     libavfilter     6. 65.100 /  6. 65.100
     libavresample   3.  1.  0 /  3.  1.  0
     libswscale      4.  2.100 /  4.  2.100
     libswresample   2.  3.100 /  2.  3.100
     libpostproc    54.  1.100 / 54.  1.100
    Input #0, mov,mp4,m4a,3gp,3g2,mj2, from '/home/mix/XXXXXXXXXXXXX.mp4':
     Metadata:
       major_brand     : isom
       minor_version   : 512
       compatible_brands: isomiso2avc1mp41
       title           : XXXXXXXXXXXXXXX

       encoder         : Lavf57.41.100
     Duration: 00:03:53.48, start: 0.000000, bitrate: 2705 kb/s
       Stream #0:0(und): Video: h264 (High) (avc1 / 0x31637661), yuv420p(tv, bt709), 1920x1080 [SAR 1:1 DAR 16:9], 2573 kb/s, 23.98 fps, 23.98 tbr, 24k tbn, 47.95 tbc (default)
       Metadata:
         handler_name    : VideoHandler
       Stream #0:1(und): Audio: aac (LC) (mp4a / 0x6134706D), 44100 Hz, stereo, fltp, 127 kb/s (default)
       Metadata:
         handler_name    : SoundHandler
    Codec AVOption preset (Configuration preset) specified for output file #0 (/dev/video0) has not been used for any stream. The most likely reason is either wrong type (e.g. a video option with no video streams) or that it is a private option of some encoder which was not actually used for any stream.
    [Parsed_setdar_2 @ 0x5571234fe020] num:den syntax is deprecated, please use num/den or named options instead
    -async is forwarded to lavfi similarly to -af aresample=async=1:min_hard_comp=0.100000:first_pts=0.
    Output #0, v4l2, to '/dev/video0':
     Metadata:
       major_brand     : isom
       minor_version   : 512
       compatible_brands: isomiso2avc1mp41
       title           : XXXXXXXXXXX

       encoder         : Lavf57.56.101
       Stream #0:0(und): Video: rawvideo (I420 / 0x30323449), yuv420p, 640x480 [SAR 1:1 DAR 4:3], q=2-31, 200 kb/s, 25 fps, 25 tbn, 25 tbc (default)
       Metadata:
         handler_name    : VideoHandler
         encoder         : Lavc57.64.101 rawvideo
    Output #1, alsa, to 'default':
     Metadata:
       major_brand     : isom
       minor_version   : 512
       compatible_brands: isomiso2avc1mp41
       title           : XXXXXXXXXX

       encoder         : Lavf57.56.101
       Stream #1:0(und): Audio: pcm_s16le, 44100 Hz, stereo, s16, 1411 kb/s (default)
       Metadata:
         handler_name    : SoundHandler
         encoder         : Lavc57.64.101 pcm_s16le
    Stream mapping:
     Stream #0:0 -> #0:0 (h264 (native) -> rawvideo (native))
     Stream #0:1 -> #1:0 (aac (native) -> pcm_s16le (native))
    Press [q] to stop, [?] for help
    frame=  736 fps= 24 q=-0.0 Lsize=N/A time=00:00:29.67 bitrate=N/A speed=0.979x    
    video:331200kB audio:5112kB subtitle:0kB other streams:0kB global headers:0kB muxing overhead: unknown
    Exiting normally, received signal 2.

    The send script

    #!/bin/bash

    IP="XXXXXXXXX";

    ffmpeg -f video4linux2 -i /dev/video0 -f alsa -acodec pcm_s16le -i default -f flv -async 1 -pix_fmt yuv420p -preset ultrafast -vcodec libx264 -r 25 -s 640x260 -acodec aac rtmp://$IP:1935/live/test

    The Output

    ./send_stream.sh
    ffmpeg version 3.2.12-1~deb9u1 Copyright (c) 2000-2018 the FFmpeg developers
     built with gcc 6.3.0 (Debian 6.3.0-18+deb9u1) 20170516
     configuration: --prefix=/usr --extra-version='1~deb9u1' --toolchain=hardened --libdir=/usr/lib/x86_64-linux-gnu --incdir=/usr/include/x86_64-linux-gnu --enable-gpl --disable-stripping --enable-avresample --enable-avisynth --enable-gnutls --enable-ladspa --enable-libass --enable-libbluray --enable-libbs2b --enable-libcaca --enable-libcdio --enable-libebur128 --enable-libflite --enable-libfontconfig --enable-libfreetype --enable-libfribidi --enable-libgme --enable-libgsm --enable-libmp3lame --enable-libopenjpeg --enable-libopenmpt --enable-libopus --enable-libpulse --enable-librubberband --enable-libshine --enable-libsnappy --enable-libsoxr --enable-libspeex --enable-libssh --enable-libtheora --enable-libtwolame --enable-libvorbis --enable-libvpx --enable-libwavpack --enable-libwebp --enable-libx265 --enable-libxvid --enable-libzmq --enable-libzvbi --enable-omx --enable-openal --enable-opengl --enable-sdl2 --enable-libdc1394 --enable-libiec61883 --enable-chromaprint --enable-frei0r --enable-libopencv --enable-libx264 --enable-shared
     libavutil      55. 34.101 / 55. 34.101
     libavcodec     57. 64.101 / 57. 64.101
     libavformat    57. 56.101 / 57. 56.101
     libavdevice    57.  1.100 / 57.  1.100
     libavfilter     6. 65.100 /  6. 65.100
     libavresample   3.  1.  0 /  3.  1.  0
     libswscale      4.  2.100 /  4.  2.100
     libswresample   2.  3.100 /  2.  3.100
     libpostproc    54.  1.100 / 54.  1.100
    Input #0, video4linux2,v4l2, from '/dev/video0':
     Duration: N/A, start: 1548393682.674066, bitrate: 110592 kb/s
       Stream #0:0: Video: rawvideo (I420 / 0x30323449), yuv420p, 640x480, 110592 kb/s, 30 fps, 30 tbr, 1000k tbn, 1000k tbc
    Guessed Channel Layout for Input Stream #1.0 : stereo
    Input #1, alsa, from 'default':
     Duration: N/A, start: 1548393682.677901, bitrate: 1536 kb/s
       Stream #1:0: Audio: pcm_s16le, 48000 Hz, stereo, s16, 1536 kb/s
    -async is forwarded to lavfi similarly to -af aresample=async=1:min_hard_comp=0.100000:first_pts=0.
    [libx264 @ 0x55e22cfa4f00] using cpu capabilities: MMX2 SSE2Fast SSSE3 SSE4.2 AVX
    [libx264 @ 0x55e22cfa4f00] profile Constrained Baseline, level 2.1
    [libx264 @ 0x55e22cfa4f00] 264 - core 148 r2748 97eaef2 - H.264/MPEG-4 AVC codec - Copyleft 2003-2016 - http://www.videolan.org/x264.html - options: cabac=0 ref=1 deblock=0:0:0 analyse=0:0 me=dia subme=0 psy=1 psy_rd=1.00:0.00 mixed_ref=0 me_range=16 chroma_me=1 trellis=0 8x8dct=0 cqm=0 deadzone=21,11 fast_pskip=1 chroma_qp_offset=0 threads=6 lookahead_threads=1 sliced_threads=0 nr=0 decimate=1 interlaced=0 bluray_compat=0 constrained_intra=0 bframes=0 weightp=0 keyint=250 keyint_min=25 scenecut=0 intra_refresh=0 rc=crf mbtree=0 crf=23.0 qcomp=0.60 qpmin=0 qpmax=69 qpstep=4 ip_ratio=1.40 aq=0
    Output #0, flv, to 'rtmp://XXXXXXXXXXX:1935/live/test':
     Metadata:
       encoder         : Lavf57.56.101
       Stream #0:0: Video: h264 (libx264) ([7][0][0][0] / 0x0007), yuv420p, 640x260, q=-1--1, 25 fps, 1k tbn, 25 tbc
       Metadata:
         encoder         : Lavc57.64.101 libx264
       Side data:
         cpb: bitrate max/min/avg: 0/0/0 buffer size: 0 vbv_delay: -1
       Stream #0:1: Audio: aac (LC) ([10][0][0][0] / 0x000A), 48000 Hz, stereo, fltp, 128 kb/s
       Metadata:
         encoder         : Lavc57.64.101 aac
    Stream mapping:
     Stream #0:0 -> #0:0 (rawvideo (native) -> h264 (libx264))
     Stream #1:0 -> #0:1 (pcm_s16le (native) -> aac (native))
    Press [q] to stop, [?] for help
    [alsa @ 0x55e22cf87300] Thread message queue blocking; consider raising the thread_queue_size option (current value: 8)
    [video4linux2,v4l2 @ 0x55e22cf84fe0] Thread message queue blocking; consider raising the thread_queue_size option (current value: 8)
    Past duration 0.613319 too large    7344kB time=00:01:05.85 bitrate= 913.5kbits/s speed=1.04x    
    Past duration 0.614372 too large    7644kB time=00:01:08.39 bitrate= 915.6kbits/s speed=1.04x    
    Past duration 0.609749 too large    7834kB time=00:01:10.91 bitrate= 905.0kbits/s speed=1.04x    
    Past duration 0.604362 too large    8038kB time=00:01:12.92 bitrate= 903.0kbits/s speed=1.04x    
    Past duration 0.609489 too large    8070kB time=00:01:13.45 bitrate= 900.1kbits/s speed=1.04x    
    Past duration 0.615013 too large    8094kB time=00:01:13.94 bitrate= 896.8kbits/s speed=1.04x    
    Past duration 0.610893 too large    8179kB time=00:01:14.94 bitrate= 894.0kbits/s speed=1.04x    
    Past duration 0.664711 too large
    Past duration 0.639565 too large    8263kB time=00:01:15.47 bitrate= 896.8kbits/s speed=1.04x    
    Past duration 0.668999 too large    8339kB time=00:01:15.94 bitrate= 899.5kbits/s speed=1.04x    
    Past duration 0.605766 too large
    Past duration 0.633049 too large    8399kB time=00:01:16.48 bitrate= 899.6kbits/s speed=1.04x    
    Past duration 0.674599 too large
    Past duration 0.616035 too large    8451kB time=00:01:16.95 bitrate= 899.7kbits/s speed=1.04x    
    Past duration 0.656136 too large
    Past duration 0.604195 too large
    Past duration 0.601387 too large    8512kB time=00:01:17.46 bitrate= 900.2kbits/s speed=1.04x    
    Past duration 0.621895 too large    8565kB time=00:01:17.95 bitrate= 900.1kbits/s speed=1.04x    
    Past duration 0.670937 too large    8605kB time=00:01:18.46 bitrate= 898.4kbits/s speed=1.04x    
    Past duration 0.604500 too large    8642kB time=00:01:18.99 bitrate= 896.2kbits/s speed=1.04x    
    frame= 1913 fps= 25 q=-1.0 Lsize=    8670kB time=00:01:19.48 bitrate= 893.6kbits/s speed=1.04x    
    video:7290kB audio:1280kB subtitle:0kB other streams:0kB global headers:0kB muxing overhead: 1.160292%
    [libx264 @ 0x55e22cfa4f00] frame I:8     Avg QP:18.25  size: 15502
    [libx264 @ 0x55e22cfa4f00] frame P:1905  Avg QP:20.95  size:  3853
    [libx264 @ 0x55e22cfa4f00] mb I  I16..4: 100.0%  0.0%  0.0%
    [libx264 @ 0x55e22cfa4f00] mb P  I16..4:  6.4%  0.0%  0.0%  P16..4: 38.1%  0.0%  0.0%  0.0%  0.0%    skip:55.5%
    [libx264 @ 0x55e22cfa4f00] coded y,uvDC,uvAC intra: 46.0% 30.3% 13.4% inter: 20.1% 9.8% 1.1%
    [libx264 @ 0x55e22cfa4f00] i16 v,h,dc,p: 47% 34% 10%  9%
    [libx264 @ 0x55e22cfa4f00] i8c dc,h,v,p: 45% 28% 22%  5%
    [libx264 @ 0x55e22cfa4f00] kb/s:750.98
    [aac @ 0x55e22cfa62a0] Qavg: 579.067
    Exiting normally, received signal 2.

    First everything is fine and then comes

    Past duration 0.616035 too large    8451kB time=00:01:16.95 bitrate= 899.7kbits/s speed=1.04x    
    Past duration 0.656136 too large
    Past duration 0.604195 too large
    Past duration 0.601387 too large    8512kB time=00:01:17.46 bitrate= 900.2kbits/s speed=1.04x

    And then when that comes, dives in the first window, so in the ffmpeg sends the input :

    Stream mapping:
     Stream #0:0 -> #0:0 (h264 (native) -> rawvideo (native))
     Stream #0:1 -> #1:0 (aac (native) -> pcm_s16le (native))
    Press [q] to stop, [?] for help
    frame=    9 fps=0.0 q=-0.0 size=N/A time=00:00:00.36 bitrate=N/A dup=1 drop=0 spframe=   21 fps= 21 q=-0.0 size=N/A time=00:00:00.84 bitrate=N/A dup=1 drop=0 sp[alsa @ 0x5643b3293160] ALSA buffer xrun.
       Last message repeated 1 times
    frame=   33 fps= 22 q=-0.0 size=N/A time=00:00:01.32 bitrate=N/A dup=1 drop=0 sp[alsa @ 0x5643b3293160] ALSA buffer xrun.
       Last message repeated 1 times
    frame=   46 fps= 23 q=-0.0 size=N/A time=00:00:01.84 bitrate=N/A dup=1 drop=0 spframe=   58 fps= 23 q=-0.0 size=N/A time=00:00:02.32 bitrate=N/A dup=1 drop=0 spframe=   71 fps= 24 q=-0.0 size=N/A time=00:00:02.84 bitrate=N/A dup=1 drop=0 spframe=   83 fps= 24 q=-0.0 size=N/A time=00:00:03.32 bitrate=N/A dup=1 drop=0 sp[alsa @ 0x5643b3293160] ALSA buffer xrun.
    frame=   96 fps= 24 q=-0.0 size=N/A time=00:00:03.84 bitrate=N/A dup=1 drop=0 sp[alsa @ 0x5643b3293160] ALSA buffer xrun.

    The sound is then absolutely unsynchronized ...

    Does anyone have any advice and can help me ?