Recherche avancée

Médias (2)

Mot : - Tags -/documentation

Autres articles (13)

  • Ajouter notes et légendes aux images

    7 février 2011, par

    Pour pouvoir ajouter notes et légendes aux images, la première étape est d’installer le plugin "Légendes".
    Une fois le plugin activé, vous pouvez le configurer dans l’espace de configuration afin de modifier les droits de création / modification et de suppression des notes. Par défaut seuls les administrateurs du site peuvent ajouter des notes aux images.
    Modification lors de l’ajout d’un média
    Lors de l’ajout d’un média de type "image" un nouveau bouton apparait au dessus de la prévisualisation (...)

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

  • Les vidéos

    21 avril 2011, par

    Comme les documents de type "audio", Mediaspip affiche dans la mesure du possible les vidéos grâce à la balise html5 .
    Un des inconvénients de cette balise est qu’elle n’est pas reconnue correctement par certains navigateurs (Internet Explorer pour ne pas le nommer) et que chaque navigateur ne gère en natif que certains formats de vidéos.
    Son avantage principal quant à lui est de bénéficier de la prise en charge native de vidéos dans les navigateur et donc de se passer de l’utilisation de Flash et (...)

Sur d’autres sites (4049)

  • Android Merging two video with different (sizes,codec,frames,aspect raito) using FFMPEG

    6 septembre 2017, par Alok Kumar Verma

    I’m making an app which merges two or more than two video files which I’m getting from another activity. After choosing the files we pass the files to another activity where the merging happens. I’ve followed this link to do the same : AndroidWarZone FFMPEG

    Here I found the way on how to merge the two files only with different qualities. The command is given below :

    String[] complexCommand = {"ffmpeg","-y","-i","/storage/emulated/0/videokit/sample.mp4",
    "-i","/storage/emulated/0/videokit/in.mp4","-strict","experimental",
    "-filter_complex",
    "[0:v]scale=640x480,setsar=1:1[v0];[1:v]scale=640x480,setsar=1:1[v1];[v0][0:a][v1][1:a] concat=n=2:v=1:a=1",
    "-ab","48000","-ac","2","-ar","22050","-s","640x480","-r","30","-vcodec","mpeg4","-b","2097k","/storage/emulated/0/vk2_out/out.mp4"}

    Since I have a list of selected videos inside my array which I’m passing to the next page, I’ve done some changes in my command, like this :

    private void mergeVideos() {
       String savingPath = Environment.getExternalStorageDirectory().getAbsolutePath() + "/video.mp4";

       ArrayList<file> fileList = mList;

       List<string> filenames = new ArrayList<string>();

       for (int i = 0; i &lt; fileList.size(); i++) {
           filenames.add("-i");
           filenames.add(fileList.get(i).toString());
       }

       Log.e("Log===",filenames.toString());

       String joined = TextUtils.join(", ",filenames);

       Log.e("Joined====",joined);

       String complexCommand[] = {"-y", joined,
               "-filter_complex",
               "[0:v]scale=640x480,setsar=1:1[v0];[1:v]scale=640x480,setsar=1:1[v1];[v0][0:a][v1][1:a] concat=n=2:v=1:a=1",
               "-ab","48000","-ac","2","-ar","22050","-s","640x480","-r","30","-vcodec","mpeg4","-b","2097k", savingPath};
       Log.e("RESULT====",Arrays.toString(complexCommand));

      execFFmpegBinary(complexCommand);  }
    </string></string></file>

    In the log this is the the output I’m getting :

    This one is for received data which I have added in the mList

    E/RECEIVED DATA=====: [/mnt/m_external_sd/DCIM/Camera/VID_31610130_011933_454.mp4, /mnt/m_external_sd/DCIM/Camera/VID_23120824_054526_878.mp4]
    E/RESULT====: [-y, -i, /mnt/m_external_sd/DCIM/Camera/VID_31610130_011933_454.mp4, -i, /mnt/m_external_sd/DCIM/Camera/VID_23120824_054526_878.mp4, -filter_complex, [0:v]scale=640x480,setsar=1:1[v0];[1:v]scale=640x480,setsar=1:1[v1];[v0][0:a][v1][1:a] concat=n=2:v=1:a=1, -ab, 48000, -ac, 2, -ar, 22050, -s, 640x480, -r, 30, -vcodec, mpeg4, -b, 2097k, /storage/emulated/0/video.mp4]

    Here result is the complexCommand that is going inside the exeFFMPEGBinary() but not working.

    This is my exceFFMPEGBinary()

    private void execFFmpegBinary(final String[] combine) {
       try{
       fFmpeg.execute(combine, new ExecuteBinaryResponseHandler() {
           @Override
           public void onFailure(String s) {
               Log.d("", "FAILED with output : " + s);
           }

           @Override
           public void onSuccess(String s) {
               Log.d("", "SUCCESS with output : " + s);
               Toast.makeText(getApplicationContext(),"Success!",Toast.LENGTH_SHORT)
                       .show();
           }

           @Override
           public void onProgress(String s) {
               Log.d("", "progress : " + s);
           }

           @Override
           public void onStart() {
               progressDialog.setMessage("Processing...");
               progressDialog.show();
           }

           @Override
           public void onFinish() {
               progressDialog.dismiss();
           }
       });
    } catch (FFmpegCommandAlreadyRunningException e) {
       // do nothing for now
    }
    }

    I’ve done this and run my project, now the problem is it is not merging/concatenating anything, just a progressDialog comes up for a fraction of second and all I’m getting is this in my log :

    E/FFMPEG====: ffmpef : coorect loaded

    This means that ffmpeg is loading and nothing is getting implemented. I don’t get any log for onFailur, onSuccess(), onStart().

    Any suggestions would help me achieve my goal. Thanks.

    Note : I have done this merging with the use of Mp4Parser but there is a glitch inside it, it requires the file with same specification. So this is not my requirement.

    EDITS

    I did some more research and got this to concatenate, but this is not working either, here is the link : Concatenating two files

    I’ve found this stuff also from a link : FFMPEG Merging/Concatenating
    and found that his piece of code is working fine. But not mine.

    I’ve used that command also but it is not working nor giving me any log results. Except the FFMPEG Loading.

    Here is the command :

    complexCommand = new String[]{"-y", "-i", file1.toString(), "-i", file2.toString(), "-strict", "experimental", "-filter_complex",
               "[0:v]scale=1920x1080,setsar=1:1[v0];[1:v] scale=iw*min(1920/iw\\,1080/ih):ih*min(1920/iw\\,1080/ih), pad=1920:1080:(1920-iw*min(1920/iw\\,1080/ih))/2:(1080-ih*min(1920/iw\\,1080/ih))/2,setsar=1:1[v1];[v0][0:a][v1][1:a] concat=n=2:v=1:a=1","-ab", "48000", "-ac", "2", "-ar", "22050", "-s", "1920x1080", "-vcodec", "libx264","-crf","27","-q","4","-preset", "ultrafast", rootPath + "/output.mp4"};
  • How to capture UDP packets from ffmpeg with Wireshark ?

    15 septembre 2017, par Davis8988

    I have 2 laptops connected via LAN cable and static ip’s (v4).
    I use ffmpeg to capture desktop from laptop1 and stream it to laptop2 :

    ffmpeg -y -rtbufsize 100M -f gdigrab -framerate 30 -probesize 10M -draw_mouse 1  
    -i desktop -c:v libx264 -r 30 -preset Medium -tune zerolatency -crf 25 -f mpegts  
    udp://150.50.1.2:1080  

    And I use ffplay to recieve the stream on laptop2 and play it and it works - I can see laptop1’s desktop :

    ffplay -fflags nobuffer -sync ext udp://127.0.0.1:1080  

    Now I want also to capture the udp packets sent by ffmpeg to laptop2 via Wireshark(I start Wireshark on laptop2).
    But when I start Wireshark and press "capture" - I don’t see any packets beeing sent from the ip (as source) of laptop1. I see some few lines in Wireshark beeing added every 1 minute or so but from different ip’s.

    Why I can’t see the stream sent by ffmpeg in laptop1 to laptop2 ?

  • Grey squared artifacts after HEVC 10-bit encoding using FFmpeg's NVENC encoder

    20 juillet 2017, par Cryman

    Recently I purchased a brand new GPU - AORUS GeForce GTX 1080 Ti. I found out that it supports HEVC 10-bit encoding, so I wanted to give that a try. Unfortunately, after encoding I noticed some artifacts, which occur in dark scenes and last one frame of the video. You can see them on these screenshots :

    Screenshot of a still from an animated scene. There is an artifact near the bottom and slightly to the left. It is square shaped with white squiggles.

    Screenshot of a still from another animated scene. The artifact looks the same as in the previous image but is in a different location, higher up and closer to the center.

    I was wondering if someone could help me figure out what might be the cause of these artifacts and how I can get rid of them.

    Here is the MI of the source video :

    ID                                       : 1
    Format                                   : AVC
    Format/Info                              : Advanced Video Codec
    Format profile                           : High@L4.1
    Format settings, CABAC                   : Yes
    Format settings, ReFrames                : 4 frames
    Codec ID                                 : V_MPEG4/ISO/AVC
    Duration                                 : 2 h 2 min
    Bit rate mode                            : Variable
    Bit rate                                 : 29.5 Mb/s
    Maximum bit rate                         : 37.0 Mb/s
    Width                                    : 1 920 pixels
    Height                                   : 1 080 pixels
    Display aspect ratio                     : 16:9
    Frame rate mode                          : Constant
    Frame rate                               : 23.976 (24000/1001) FPS
    Color space                              : YUV
    Chroma subsampling                       : 4:2:0
    Bit depth                                : 8 bits
    Scan type                                : Progressive
    Bits/(Pixel*Frame)                       : 0.593
    Stream size                              : 25.2 GiB (66%)
    Language                                 : English
    Default                                  : Yes
    Forced                                   : No

    And here is the MI of the encoded video :

    ID                                       : 1
    Format                                   : HEVC
    Format/Info                              : High Efficiency Video Coding
    Format profile                           : Main 10@L4@Main
    Codec ID                                 : V_MPEGH/ISO/HEVC
    Duration                                 : 2 h 2 min
    Bit rate                                 : 3 689 kb/s
    Width                                    : 1 920 pixels
    Height                                   : 800 pixels
    Display aspect ratio                     : 2.40:1
    Frame rate mode                          : Constant
    Frame rate                               : 23.976 (24000/1001) FPS
    Standard                                 : Component
    Color space                              : YUV
    Chroma subsampling                       : 4:2:0
    Bit depth                                : 10 bits
    Bits/(Pixel*Frame)                       : 0.100
    Stream size                              : 3.15 GiB (95%)
    Default                                  : Yes
    Forced                                   : No
    Color range                              : Limited

    The command I’m using for encoding :

    ffmpeg -hide_banner -i "" -map 0:v:0 -map_chapters -1 -map_metadata -1 -vf "crop=1920:800:0:140" -vcodec hevc_nvenc -pix_fmt p010le -preset hq -profile:v main10 -rc constqp -global_quality 21 -rc-lookahead 32 -g 240 -f matroska Video_CQP21_LAF32_GOP240.mkv