Recherche avancée

Médias (91)

Autres articles (42)

  • Modifier la date de publication

    21 juin 2013, par

    Comment changer la date de publication d’un média ?
    Il faut au préalable rajouter un champ "Date de publication" dans le masque de formulaire adéquat :
    Administrer > Configuration des masques de formulaires > Sélectionner "Un média"
    Dans la rubrique "Champs à ajouter, cocher "Date de publication "
    Cliquer en bas de la page sur Enregistrer

  • Personnaliser en ajoutant son logo, sa bannière ou son image de fond

    5 septembre 2013, par

    Certains thèmes prennent en compte trois éléments de personnalisation : l’ajout d’un logo ; l’ajout d’une bannière l’ajout d’une image de fond ;

  • Ecrire une actualité

    21 juin 2013, par

    Présentez les changements dans votre MédiaSPIP ou les actualités de vos projets sur votre MédiaSPIP grâce à la rubrique actualités.
    Dans le thème par défaut spipeo de MédiaSPIP, les actualités sont affichées en bas de la page principale sous les éditoriaux.
    Vous pouvez personnaliser le formulaire de création d’une actualité.
    Formulaire de création d’une actualité Dans le cas d’un document de type actualité, les champs proposés par défaut sont : Date de publication ( personnaliser la date de publication ) (...)

Sur d’autres sites (7584)

  • Ideal bitrates for different video resolutions

    15 octobre 2018, par Ramesh Navi

    I am building a Video-on-demand service for a closed community. I using FFMPEG for video processing and dash.js for adaptive bitrate player with custom resolution selector. Can somebody please suggest what ideal bitrates should I use while video/audio transcoding ?

    I am talking about -b:v and -ab option

    ffmpeg -i vid.mp4 -c:v libvpx-vp9 -keyint_min 150 \
    -g 150 -tile-columns 4 -frame-parallel 1  -f webm -dash 1 \
    -an -vf scale=144:-1 -b:v 120k -dash 1 video_1.webm \
    -an -vf scale=240:-1 -b:v 250k -dash 1 video_2.webm \
    -an -vf scale=360:-1 -b:v 500k -dash 1 video_3.webm \
    -an -vf scale=480:-1 -b:v 750k -dash 1 video_4.webm \
    -an -vf scale=720:-1 -b:v 1500k -dash 1 video_5.webm

    And

    ffmpeg -i vid.mp4 -vn -acodec libvorbis -ab 96k -dash 1 audio_96k.webm

    Any suggestions/hacks or examples to tackle real-world network situations are appreciated.

  • Make UDP-RTMP bridge with FFMPEG

    3 mai 2017, par Jorge Anzola

    I need to make this chain, using computer 2 as a "bridge" between Computer 1 and the streming server.

    Computer 1 ----> Computer 2 ----> Streaming server (Wowza).

    So I’m trying to set this :
    Computer 1 —(via UDP)—> Computer 2 —(Via RTMP)—> Wowza

    What I’ve tried :

    1. At Computer 1

    Entry :

    ffmpeg -i sample.mp4 -c:v copy -c:a copy -f mpegts udp://192.168.0.109:5010

    Result : Worked. Computer 1 sends the data correctly.

    2. At Computer 2

    Entry :

    ffmpeg -i upd://192.168.0.109:5010 output.mp4

    Result : Worked. Computer 2 gets data correctly. Output.mp4 is generated well.

    Entry :

    ffmpeg -i sample.mp4 -c:v copy -c:a copy -f flv rtmp://wowzaServerAddress

    Result : Worked. Wowza shows online the video from sample.mp4

    Entry :

    ffmpeg -re -i udp://@:5010 -f flv rtmp://wowzaServerAddress

    Result :

    stuck at :

    ffmpeg version N-77234-g906c0b7 Copyright (c) 2000-2015 the FFmpeg
    built with gcc 5.2.0 (GCC)
    configuration: --enable-gpl --enable-version3 --disable-w32threads --enable-avisynth --enable-bzlib --enable-fontconfig --enable-frei0r --enable-gnutls --enable-iconv --enable-libass --enable-libbluray --enable-libbs2b --enable-libcaca --enable-libdcadec --enable-libfreetype --enable-libgme --enable-libgsm --enable-libilbc --enable-libmodplug --enable-libmp3lame --enable-libopencore-amrnb --enable-libopencore-amrwb --enable-libopenjpeg --enable-libopus --enable-librtmp --enable-libschroedinger --enable-libsoxr --enable-libspeex --enable-libtheora --enable-libtwolame --enable-libvidstab --enable-libvo-aacenc --enable-libvo-amrwbenc --enable-libvorbis --enable-libvpx --enable-libwavpack --enable-libwebp --enable-libx264 --enable-libx265 --enable-libxavs --enable-libxvid --enable-libzimg --enable-lzma --enable-decklink --enable-zlib
    libavutil 55. 10.100 / 55. 10.100
    libavcodec 57. 17.100 / 57. 17.100
    libavformat 57. 20.100 / 57. 20.100
    libavdevice 57.0.100 / 57. 0.100
    libavfilter 6.21.100 / 6. 21.100
    libswscale 4.0.100 / 4. 0.100
    libswresample 2. 0.101 / 2. 0.101
    libpostproc 54. 0.100 / 54. 0.100
    **Entry:**
       ffmpeg -i udp://192.168.0.109:5010 -c:v copy -c:a copy -f flv rtmp://wowzaServerAddress
    **Result:**
    *... repeated a lot ...*
    Last message repeated 1 times
    [h264 @ 000001cef0462200] decode_slice_header error
    [h264 @ 000001cef0462200] no frame!
    *... repeated a lot ...*
    Input #0, mpegts, from 'udp://192.168.0.109:5010':
    Duration: N/A, start: 128.032333, bitrate: N/A
    Program 1
    Metadata:
    service_name: RARBG.COM - Spotlight.2015.1080p.WEB-DL.DD5.1.H264-RARBG
    service_provider: FFmpeg
    Stream #0:0[0x100]: Video: h264 (Main) ([27][0][0][0] / 0x001B),
    yuv420p(tv, bt709), 1916x1032 [SAR 1:1 DAR 479:258], 23.98 fps, 23.98 tbr, 90k tbn, 180k tbc
    Stream #0:1[0x101](eng): Audio: aac (LC) ([15][0][0][0] / 0x000F), 48000 Hz, stereo, fltp, 200 kb/s
    [flv @ 000001cef132a1c0] Codec for stream 0 does not use global headers but container format requires global headers
    [flv @ 000001cef132a1c0] Codec for stream 1 does not use global headers but container format requires global headers
    Output #0, flv, to '**rtmp://wowzaServerAddress**':
    Metadata:
    encoder: Lavf57.20.100
    Stream #0:0: Video: h264 ([7][0][0][0] / 0x0007), yuv420p, 1916x1032 [SAR
    1:1 DAR 479:258], q=2-31, 23.98 fps, 23.98 tbr, 1k tbn, 90k tbc
    Stream #0:1(eng): Audio: aac ([10][0][0][0] / 0x000A), 48000 Hz, stereo,
    200 kb/s
    Stream mapping:
    Stream #0:0 - #0:0 (copy)
    Stream #0:1 - #0:1 (copy)
    Press [q] to stop, [?] for help
    [flv @ 000001cef132a1c0] Malformed AAC bitstream detected: use the audio
    bitstream filter 'aac_adtstoasc' to fix it ('-bsf:a aac_adtstoasc' option with ffmpeg)
    av_interleaved_write_frame(): Invalid data found when processing input
    [flv @ 000001cef132a1c0] Malformed AAC bitstream detected: use the audio bitstream filter 'aac_adtstoasc' to fix it ('-bsf:a aac_adtstoasc' option with ffmpeg)
    [flv @ 000001cef132a1c0] Failed to update header with correct duration.
    [flv @ 000001cef132a1c0] Failed to update header with correct filesize.
    Error writing trailer of rtmp://**wowzaServerAddress**: Invalid data found when processing inputframe= 1 fps=0.0 q=-1.0 Lsize= 0kB time= 00:00:02.13 bitrate= 1.6kbits/s
    video:33kB audio:59kB subtitle:0kB other streams:0kB global headers:0kB muxing overhead: unknown

    Conversion failed !

  • Save image while face detection

    13 octobre 2017, par hidura

    Hello I’ve this app that save an image for everytime my face move something similar to the IG stories my problem is that the cellphone get very slow and the app close suddenly because of allocation memory problems I want to know how i can do this without slowing down the cellphone and dont receive the error of closing.

    The next code open the svg :

    @TargetApi(Build.VERSION_CODES.LOLLIPOP)
    private static Bitmap getBitmap(VectorDrawable vectorDrawable) {
       Bitmap bitmap = Bitmap.createBitmap(vectorDrawable.getIntrinsicWidth(),
               vectorDrawable.getIntrinsicHeight(), Bitmap.Config.ARGB_8888);
       Canvas canvas = new Canvas(bitmap);
       vectorDrawable.setBounds(0, 0, canvas.getWidth(), canvas.getHeight());
       vectorDrawable.draw(canvas);
       Log.e("", "getBitmap: 1");
       return bitmap;
    }

    private static Bitmap getBitmap(Context context, int drawableId) {
       Log.e("", "getBitmap: 2");
       Drawable drawable = ContextCompat.getDrawable(context, drawableId);
       if (drawable instanceof BitmapDrawable) {
           return BitmapFactory.decodeResource(context.getResources(), drawableId);
       } else if (drawable instanceof VectorDrawable) {
           return getBitmap((VectorDrawable) drawable);
       } else {
           throw new IllegalArgumentException("unsupported drawable type");
       }
    }

    The next one draw the svg below the position of the face.

       /**
        * Draws the face annotations for position on the supplied canvas.
        */
       @Override
       public void draw(Canvas canvas) {
           Face face = mFace;
           if (face == null) {
               return;
           }

           // Draws a circle at the position of the detected face, with the face's track id below.
           float x = translateX(face.getPosition().x + face.getWidth() / 2);
           float y = translateY(face.getPosition().y + face.getHeight() / 2);
           canvas.drawCircle(x, y, FACE_POSITION_RADIUS, mFacePositionPaint);
           canvas.drawText("id: " + mFaceId, x + ID_X_OFFSET, y + ID_Y_OFFSET, mIdPaint);
           canvas.drawText("happiness: " + String.format("%.2f", face.getIsSmilingProbability()), x - ID_X_OFFSET, y - ID_Y_OFFSET, mIdPaint);
           canvas.drawText("right eye: " + String.format("%.2f", face.getIsRightEyeOpenProbability()), x + ID_X_OFFSET * 2, y + ID_Y_OFFSET * 2, mIdPaint);
           canvas.drawText("left eye: " + String.format("%.2f", face.getIsLeftEyeOpenProbability()), x - ID_X_OFFSET*2, y - ID_Y_OFFSET*2, mIdPaint);

           // Draws a bounding box around the face.
           float xOffset = scaleX(face.getWidth() / 2.0f);
           float yOffset = scaleY(face.getHeight() / 2.0f);
           float left = x - xOffset;
           float top = y - yOffset;
           float right = x + xOffset;
           float bottom = y + yOffset;
           //bitmap = BitmapFactory.decodeResource(getOverlay().getContext().getResources(), R.drawable.ic_shirt);

           bitmap = getBitmap(getOverlay().getContext(), R.drawable.ic_tshirt);
           float eyeX = left-400;
    //        for(Landmark l : face.getLandmarks()){
    //            if(l.getType() == Landmark.LEFT_EYE){
    //                eyeX = l.getPosition().x + bitmap.getWidth() / 2;
    //            }
    //        }

           tshirt = Bitmap.createScaledBitmap(bitmap, (int) scaleX(bitmap.getWidth() / 2),
                   (int) scaleY(bitmap.getHeight()/2), false);
           float top_shirt=(face.getPosition().y + face.getHeight())+200;
           canvas.drawBitmap(tshirt, eyeX, top_shirt, new Paint());


           Canvas myCanvas = new Canvas(tshirt);
           myCanvas.drawBitmap(tshirt, eyeX, top_shirt, new Paint());
           HashMap args = new HashMap<>();
       args.put("tshirt", tshirt);
       new saveImg(args).execute();
           //canvas.drawRect(left, top, right, bottom, mBoxPaint);
       }

    This one save the image on the cellphone.

       package com.google.android.gms.samples.vision.face.facetracker;

    import android.graphics.Bitmap;
    import android.os.AsyncTask;
    import android.os.Environment;

    import java.io.File;
    import java.io.FileOutputStream;
    import java.util.ArrayList;
    import java.util.HashMap;

    /**
    * Created by diegohidalgo on 10/12/17.
    */

    public class saveImg extends AsyncTask {
       Bitmap tshirt;
       String name;
       saveImg(HashMap args){
           tshirt = (Bitmap)args.get("tshirt");
           File file=new File(Environment.getExternalStorageDirectory() + "/facedetection/");
           File[] list = file.listFiles();
           int count = 0;
           for (File f: list){
               String name = f.getName();
               if (name.endsWith(".png"))
                   count++;

           }
           name="img"+count+".png";
       }

       @Override
       protected Void doInBackground(Void... args) {
           File file = new File(Environment.getExternalStorageDirectory() + "/facedetection/"+ name);

           try {
               tshirt.compress(Bitmap.CompressFormat.PNG, 100, new FileOutputStream(file));
           } catch (Exception e) {
               e.printStackTrace();

           }
           System.gc();
           tshirt.recycle();
           tshirt= null;
           return null;
       }

       protected void onPostExecute() {

       }
    }

    This is the mistake that give me before close the app.

    10-13 10:38:17.526
    8443-8443/com.google.android.gms.samples.vision.face.facetracker
    W/art : Throwing OutOfMemoryError "Failed to allocate a 8916492 byte
    allocation with 1111888 free bytes and 1085KB until OOM" 10-13
    10:38:18.020
    8443-8443/com.google.android.gms.samples.vision.face.facetracker
    I/Process : Sending signal. PID : 8443 SIG : 9

    thanks in advance.