Recherche avancée

Médias (2)

Mot : - Tags -/map

Autres articles (58)

  • Mise à jour de la version 0.1 vers 0.2

    24 juin 2013, par

    Explications des différents changements notables lors du passage de la version 0.1 de MediaSPIP à la version 0.3. Quelles sont les nouveautés
    Au niveau des dépendances logicielles Utilisation des dernières versions de FFMpeg (>= v1.2.1) ; Installation des dépendances pour Smush ; Installation de MediaInfo et FFprobe pour la récupération des métadonnées ; On n’utilise plus ffmpeg2theora ; On n’installe plus flvtool2 au profit de flvtool++ ; On n’installe plus ffmpeg-php qui n’est plus maintenu au (...)

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

  • when i record video with javacv it comes "java.lang.NoClassDefFoundError : org.bytedeco.javacpp.avutil"

    9 avril 2020, par Pradeep Simba

    I make a video recorder android app with javacv.
But, when i run this app this error occurs "java.lang.NoClassDefFoundError : org.bytedeco.javacpp.avutil".

    



    How can I solve this error ?

    



    gradle.build file

    



      android {
   ..............
    packagingOptions {
        exclude 'META-INF/services/javax.annotation.processing.Processor'
        pickFirst  'META-INF/maven/org.bytedeco.javacpp-presets/opencv/pom.properties'
        pickFirst  'META-INF/maven/org.bytedeco.javacpp-presets/opencv/pom.xml'
        pickFirst  'META-INF/maven/org.bytedeco.javacpp-presets/ffmpeg/pom.properties'
        pickFirst  'META-INF/maven/org.bytedeco.javacpp-presets/ffmpeg/pom.xml'
    }
}

dependencies {

implementation group: 'org.bytedeco', name: 'javacv', version: '1.1'
implementation group: 'org.bytedeco.javacpp-presets', name: 'opencv', version: '3.0.0-1.1', classifier: 'android-arm'
implementation group: 'org.bytedeco.javacpp-presets', name: 'ffmpeg', version: '2.8.1-1.1', classifier: 'android-arm'
implementation group: 'org.bytedeco.javacpp-presets', name: 'opencv', version: '3.0.0-1.1', classifier: 'android-x86'
implementation group: 'org.bytedeco.javacpp-presets', name: 'ffmpeg', version: '2.8.1-1.1', classifier: 'android-x86'

}


    



    My demo code VideoService which will invoke in MainActivity

    



    package com.fs.fs.api;

import com.fs.fs.App;
import com.fs.fs.utils.DateUtils;
import com.fs.fs.utils.FileUtils;

import org.bytedeco.javacpp.avcodec;
import org.bytedeco.javacv.FFmpegFrameRecorder;
import org.bytedeco.javacv.FrameRecorder;

import java.util.Date;

/**
 * Created by wyx on 2017/1/11.
 */
public class VideoService {
    private FFmpegFrameRecorder mFrameRecorder;
    private String path;

    private VideoService() {
    }

    private static class SingletonHolder {
        private static final VideoService INSTANCE = new VideoService();
    }

    public static VideoService getInstance() {
        return SingletonHolder.INSTANCE;
    }

    public void startRecordVideo() {
        String fileName = String.format("%s.%s", DateUtils.date2String(new Date(), "yyyyMMdd_HHmmss"), "mp4");
        path = FileUtils.getExternalFullPath(App.getInstance(), fileName);
        mFrameRecorder = new FFmpegFrameRecorder(path, 640, 480, 1);
        mFrameRecorder.setVideoCodec(avcodec.AV_CODEC_ID_H264);
        mFrameRecorder.setVideoOption("tune", "zerolatency");
        mFrameRecorder.setVideoOption("preset", "ultrafast");
        mFrameRecorder.setVideoOption("crf", "28");
        mFrameRecorder.setVideoBitrate(300 * 1000);
        mFrameRecorder.setFormat("mp4");

        mFrameRecorder.setFrameRate(30);
        mFrameRecorder.setAudioOption("crf", "0");
        mFrameRecorder.setSampleRate(48 * 1000);
        mFrameRecorder.setAudioBitrate(960 * 1000);
        mFrameRecorder.setAudioCodec(avcodec.AV_CODEC_ID_AAC);
        try {
            mFrameRecorder.start();
        } catch (FrameRecorder.Exception e) {
            e.printStackTrace();
        }
    }

    public void stop() {
        if (mFrameRecorder != null) {
            try {
                mFrameRecorder.stop();
                mFrameRecorder.release();
            } catch (FrameRecorder.Exception e) {
                e.printStackTrace();
            }
            mFrameRecorder = null;
        }
    }

}


    



    MainActivity

    



    package com.fs.fs.activity;

import android.app.Activity;
import android.os.Bundle;

import com.fs.fs.R;
import com.fs.fs.api.VideoService;

import static java.lang.Thread.sleep;


public class MainActivity extends Activity {

    @Override
    protected void onCreate(Bundle savedInstanceState) {
        super.onCreate(savedInstanceState);
        setContentView(R.layout.activity_main);


        VideoService.getInstance().startRecordVideo();
        try {
            sleep(10 * 1000);
        } catch (InterruptedException e) {
            e.printStackTrace();
        }
        VideoService.getInstance().stop();
    }
}


    



    Error

    



        E/AndroidRuntime: FATAL EXCEPTION: main&#xA;    Process: com.example.usb, PID: 660&#xA;    java.lang.NoClassDefFoundError: org.bytedeco.javacpp.avutil&#xA;                      at org.bytedeco.javacpp.Loader.load(Loader.java:590)&#xA;                      at org.bytedeco.javacpp.Loader.load(Loader.java:530)&#xA;                      at org.bytedeco.javacpp.avcodec$AVPacket.<clinit>(avcodec.java:1694)&#xA;                      at org.bytedeco.javacv.FFmpegFrameRecorder.<init>(FFmpegFrameRecorder.java:149)&#xA;                      at com.fs.fs.api.VideoService.startRecordVideo(VideoService.java:34)&#xA;                      at com.fs.fs.activity.MainActivity.onCreate(MainActivity.java:75)&#xA;                      at android.app.Activity.performCreate(Activity.java:5304)&#xA;                      at android.app.Instrumentation.callActivityOnCreate(Instrumentation.java:1090)&#xA;                      at android.app.ActivityThread.performLaunchActivity(ActivityThread.java:2245)&#xA;                      at android.app.ActivityThread.handleLaunchActivity(ActivityThread.java:2331)&#xA;                      at android.app.ActivityThread.access$1000(ActivityThread.java:143)&#xA;                      at android.app.ActivityThread$H.handleMessage(ActivityThread.java:1244)&#xA;                      at android.os.Handler.dispatchMessage(Handler.java:102)&#xA;                      at android.os.Looper.loop(Looper.java:136)&#xA;                      at android.app.ActivityThread.main(ActivityThread.java:5291)&#xA;                      at java.lang.reflect.Method.invokeNative(Native Method)&#xA;                      at java.lang.reflect.Method.invoke(Method.java:515)&#xA;                      at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:849)&#xA;                      at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:665)&#xA;                      at dalvik.system.NativeStart.main(Native Method)&#xA;                   Caused by: java.lang.ClassNotFoundException: org.bytedeco.javacpp.avutil&#xA;                      at java.lang.Class.classForName(Native Method)&#xA;                      at java.lang.Class.forName(Class.java:251)&#xA;                      at org.bytedeco.javacpp.Loader.load(Loader.java:585)&#xA;                      at org.bytedeco.javacpp.Loader.load(Loader.java:530)&#xA0;&#xA;                      at org.bytedeco.javacpp.avcodec$AVPacket.<clinit>(avcodec.java:1694)&#xA0;&#xA;                      at org.bytedeco.javacv.FFmpegFrameRecorder.<init>(FFmpegFrameRecorder.java:149)&#xA0;&#xA;                      at com.fs.fs.api.VideoService.startRecordVideo(VideoService.java:34)&#xA0;&#xA;                      at com.fs.fs.activity.MainActivity.onCreate(MainActivity.java:75)&#xA0;&#xA;                      at android.app.Activity.performCreate(Activity.java:5304)&#xA0;&#xA;                      at android.app.Instrumentation.callActivityOnCreate(Instrumentation.java:1090)&#xA0;&#xA;                      at android.app.ActivityThread.performLaunchActivity(ActivityThread.java:2245)&#xA0;&#xA;                      at android.app.ActivityThread.handleLaunchActivity(ActivityThread.java:2331)&#xA0;&#xA;                      at android.app.ActivityThread.access$1000(ActivityThread.java:143)&#xA0;&#xA;                      at android.app.ActivityThread$H.handleMessage(ActivityThread.java:1244)&#xA0;&#xA;                      at android.os.Handler.dispatchMessage(Handler.java:102)&#xA0;&#xA;                      at android.os.Looper.loop(Looper.java:136)&#xA0;&#xA;                      at android.app.ActivityThread.main(ActivityThread.java:5291)&#xA0;&#xA;                      at java.lang.reflect.Method.invokeNative(Native Method)&#xA0;&#xA;                      at java.lang.reflect.Method.invoke(Method.java:515)&#xA0;&#xA;                      at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:849)&#xA0;&#xA;                      at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:665)&#xA0;&#xA;                      at dalvik.system.NativeStart.main(Native Method)&#xA0;&#xA;                   Caused by: java.lang.NoClassDefFoundError: org/bytedeco/javacpp/avutil&#xA;                      at java.lang.Class.classForName(Native Method)&#xA0;&#xA;                      at java.lang.Class.forName(Class.java:251)&#xA0;&#xA;                      at org.bytedeco.javacpp.Loader.load(Loader.java:585)&#xA0;&#xA;                      at org.bytedeco.javacpp.Loader.load(Loader.java:530)&#xA0;&#xA;                      at org.bytedeco.javacpp.avcodec$AVPacket.<clinit>(avcodec.java:1694)&#xA0;&#xA;                      at org.bytedeco.javacv.FFmpegFrameRecorder.<init>(FFmpegFrameRecorder.java:149)&#xA0;&#xA;                      at com.fs.fs.api.VideoService.startRecordVideo(VideoService.java:34)&#xA0;&#xA;                      at com.fs.fs.activity.MainActivity.onCreate(MainActivity.java:75)&#xA0;&#xA;                      at android.app.Activity.performCreate(Activity.java:5304)&#xA0;&#xA;                      at android.app.Instrumentation.callActivityOnCreate(Instrumentation.java:1090)&#xA0;&#xA;                      at android.app.ActivityThread.performLaunchActivity(ActivityThread.java:2245)&#xA0;&#xA;                      at android.app.ActivityThread.handleLaunchActivity(ActivityThread.java:2331)&#xA0;&#xA;                      at android.app.ActivityThread.access$1000(ActivityThread.java:143)&#xA0;&#xA;                      at android.app.ActivityThread$H.handleMessage(ActivityThread.java:1244)&#xA0;&#xA;                      at android.os.Handler.dispatchMessage(Handler.java:102)&#xA0;&#xA;                      at android.os.Looper.loop(Looper.java:136)&#xA0;&#xA;                      at android.app.ActivityThread.main(ActivityThread.java:5291)&#xA0;&#xA;                      at java.lang.reflect.Method.invokeNative(Native Method)&#xA0;&#xA;                      at java.lang.reflect.Method.invoke(Method.java:515)&#xA0;&#xA;                      at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:849)&#xA0;&#xA;                      at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:665)&#xA0;&#xA;                      at dalvik.system.NativeStart.main(Native Method)&#xA0;&#xA;                   Caused by: java.lang.ClassNotFoundException: Didn&#x27;t find class "org.bytedeco.javacpp.avutil" on path: DexPathList[[zip file "/data/app/com.fs.fs-2.apk"],nativeLibraryDirectories=[/data/app-lib/com.fs.fs-2, /vendor/lib, /system/lib, /data/datalib]]&#xA;                      at dalvik.system.BaseDexClassLoader.findClass(BaseDexClassLoader.java:56)&#xA;                      at java.lang.ClassLoader.loadClass(ClassLoader.java:497)&#xA;                      at java.lang.ClassLoader.loadClass(ClassLoader.java:457)&#xA;                      at java.lang.Class.classForName(Native Method)&#xA0;&#xA;                      at java.lang.Class.forName(Class.java:251)&#xA0;&#xA;                      at org.bytedeco.javacpp.Loader.load(Loader.java:585)&#xA0;&#xA;                      at org.bytedeco.javacpp.Loader.load(Loader.java:530)&#xA0;&#xA;                      at org.bytedeco.javacpp.avcodec$AVPacket.<clinit>(avcodec.java:1694)&#xA0;&#xA;                      at org.bytedeco.javacv.FFmpegFrameRecorder.<init>(FFmpegFrameRecorder.java:149)&#xA0;&#xA;                      at com.fs.fs.api.VideoService.startRecordVideo(VideoService.java:34)&#xA0;&#xA;                      at com.fs.fs.activity.MainActivity.onCreate(MainActivity.java:75)&#xA0;&#xA;                      at android.app.Activity.performCreate(Activity.java:5304)&#xA0;&#xA;                      at android.app.Instrumentation.callActivityOnCreate(Instrumentation.java:1090)&#xA0;&#xA;                      at android.app.ActivityThread.performLaunchActivity(ActivityThread.java:2245)&#xA0;&#xA;                      at android.app.ActivityThread.handleLaunchActivity(ActivityThread.java:2331)&#xA0;&#xA;                      at android.app.ActivityThread.access$1000(ActivityThread.java:143)&#xA0;&#xA;                      at android.app.ActivityThread$H.handleMessage(ActivityThread.java:1244)&#xA0;&#xA;                      at android.os.Handler.dispatchMessage(Handler.java:102)&#xA0;&#xA;                      at android.os.Looper.loop(Looper.java:136)&#xA0;&#xA;                      at android.app.ActivityThread.main(ActivityThread.java:5291)&#xA0;&#xA;                      at java.lang.reflect.Method.invokeNative(Native Method)&#xA0;&#xA;                      at java.lang.reflect.Method.invoke(Method.java:515)&#xA0;&#xA;                      at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:849)&#xA0;&#xA;                      at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:665)&#xA0;&#xA;                      at dalvik.system.NativeStart.main(Native Method)&#xA0;&#xA;</init></clinit></init></clinit></init></clinit></init></clinit>

    &#xA;&#xA;

    How can i solve this error ?

    &#xA;&#xA;

    Why error occurs ?

    &#xA;

  • Translating Handbrake options to a FFMPEG command

    9 mai 2020, par Arif

    I want to convert a bunch of videos from x264 to x265, but I need to do so with ffmpeg in terminal because it's a remote server. These are my Handbrake options (listed items are ticked) :

    &#xA;&#xA;

    Summary tab

    &#xA;&#xA;

      &#xA;
    • Web optimized
    • &#xA;

    • Align A/V Start
    • &#xA;

    &#xA;&#xA;

    Dimensions tab unchanged

    &#xA;&#xA;

    Filters tab

    &#xA;&#xA;

      &#xA;
    • Sharpen - LapSharp, preset : Medium
    • &#xA;

    &#xA;&#xA;

    Video tab

    &#xA;&#xA;

      &#xA;
    • Video codec - H.265 (x265)

    • &#xA;

    • Framerate (FPS) - 30 - Peak Framerate

    • &#xA;

    • Quality - Constant Quality - 28

    • &#xA;

    • Encoder preset - Medium

    • &#xA;

    • Encoder tune - None

    • &#xA;

    • Encoder profile - Auto

    • &#xA;

    &#xA;&#xA;

    Audio tab

    &#xA;&#xA;

      &#xA;
    • Audio track - AAC, bitrate : 128
    • &#xA;

    &#xA;&#xA;

    Subtitles tab - No subtitles (remove if exists)

    &#xA;&#xA;

    This is the ffmpeg command that I've managed to compile so far :

    &#xA;&#xA;

    ffmpeg -i input.mp4 -c:v libx265 -crf 28 -c:a aac -b:a 128k -max_muxing_queue_size 400 -movflags &#x2B;faststart output.mp4

    &#xA;&#xA;

    I have the following two questions :

    &#xA;&#xA;

      &#xA;
    1. Does the ffmpeg command provided list all the options except the peak framerate, sharpening filter and removing subtitle ones ? How do I incorporate these three ?
    2. &#xA;

    3. Slightly unrelated, but does having -max_muxing_queue_size 400 negatively affect file size or video quality ? I've only included this because I'd ran into encoding errors in the past.
    4. &#xA;

    &#xA;&#xA;

    Thank you.

    &#xA;&#xA;

    My Handbrake log with the above options, if it helps :

    &#xA;&#xA;

    Input #0, mov,mp4,m4a,3gp,3g2,mj2, from &#x27;E:\input.mp4&#x27;:&#xA;  Metadata:&#xA;    major_brand     : isom&#xA;    minor_version   : 512&#xA;    compatible_brands: isomiso2avc1mp41&#xA;    encoder         : Lavf58.10.100&#xA;  Duration: 00:02:20.52, start: 0.000000, bitrate: 1487 kb/s&#xA;    Stream #0:0(und): Video: h264 (High) [avc1 / 0x31637661]&#xA;      yuv420p, tv, bt709/bt709/bt709&#xA;      1280x720 [PAR 1:1 DAR 16:9], 1288 kb/s, PAR 1:1 DAR 16:9&#xA;      29.97 fps, 30k tbn (default)&#xA;    Metadata:&#xA;      handler_name    : VideoHandler&#xA;    Stream #0:1(eng): Audio: aac (LC) [mp4a / 0x6134706D]&#xA;      44100 Hz, stereo, fltp, 192 kb/s (default)&#xA;    Metadata:&#xA;      handler_name    : SoundHandler&#xA;[04:26:49] scan: decoding previews for title 1&#xA;[04:26:49] scan: audio 0x1: aac, rate=44100Hz, bitrate=192025 English (AAC) (2.0 ch)&#xA;[04:26:50] scan: 10 previews, 1280x720, 29.970 fps, autocrop = 0/0/0/0, aspect 16:9, PAR 1:1&#xA;[04:26:50] scan: supported video decoders: avcodec qsv&#xA;[04:26:50] libhb: scan thread found 1 valid title(s)&#xA;[04:26:50] starting job&#xA;[04:26:50] decomb filter thread started for segment 0&#xA;[04:26:50] decomb filter thread started for segment 1&#xA;[04:26:50] decomb filter thread started for segment 3&#xA;[04:26:50] decomb check thread started for segment 0&#xA;[04:26:50] decomb check thread started for segment 1&#xA;[04:26:50] yadif thread started for segment 0&#xA;[04:26:50] decomb check thread started for segment 3&#xA;[04:26:50] mask filter thread started for segment 0&#xA;[04:26:50] work: track 1, dithering not supported by codec&#xA;[04:26:50] mask filter thread started for segment 1&#xA;[04:26:50] work: only 1 chapter, disabling chapter markers&#xA;[04:26:50] job configuration:&#xA;[04:26:50]  * source&#xA;[04:26:50]    &#x2B; E:\input.mp4&#xA;[04:26:50]    &#x2B; title 1, chapter(s) 1 to 1&#xA;[04:26:50]    &#x2B; container: mov,mp4,m4a,3gp,3g2,mj2&#xA;[04:26:50] mask filter thread started for segment 3&#xA;[04:26:50]    &#x2B; data rate: 1487 kbps&#xA;[04:26:50]  * destination&#xA;[04:26:50]    &#x2B; C:\Users\Hp\Desktop\output.mp4&#xA;[04:26:50]    &#x2B; container: MPEG-4 (libavformat)&#xA;[04:26:50]      &#x2B; optimized for HTTP streaming (fast start)&#xA;[04:26:50]      &#x2B; align initial A/V stream timestamps&#xA;[04:26:50]  * video track&#xA;[04:26:50]    &#x2B; decoder: h264&#xA;[04:26:50]      &#x2B; bitrate 1288 kbps&#xA;[04:26:50]    &#x2B; filters&#xA;[04:26:50] mask filter thread started for segment 2&#xA;[04:26:50]      &#x2B; Comb Detect (mode=3:spatial-metric=2:motion-thresh=1:spatial-thresh=1:filter-mode=2:block-thresh=40:block-width=16:block-height=16)&#xA;[04:26:50]      &#x2B; Decomb (mode=39)&#xA;[04:26:50]      &#x2B; Framerate Shaper (mode=2:rate=27000000/900000)&#xA;[04:26:50]        &#x2B; frame rate: 29.970 fps -> peak rate limited to 30.000 fps&#xA;[04:26:50] mask erode thread started for segment 1&#xA;[04:26:50]      &#x2B; Crop and Scale (width=1280:height=720:crop-top=0:crop-bottom=0:crop-left=0:crop-right=0)&#xA;[04:26:50]        &#x2B; source: 1280 * 720, crop (0/0/0/0): 1280 * 720, scale: 1280 * 720&#xA;[04:26:50]      &#x2B; Sharpen (lapsharp) (y-strength=0.2:y-kernel=isolap:cb-strength=0.2:cb-kernel=isolap)&#xA;[04:26:50]    &#x2B; Output geometry&#xA;[04:26:50]      &#x2B; storage dimensions: 1280 x 720&#xA;[04:26:50]      &#x2B; pixel aspect ratio: 1 : 1&#xA;[04:26:50]      &#x2B; display dimensions: 1280 x 720&#xA;[04:26:50]    &#x2B; encoder: H.265 (libx265)&#xA;[04:26:50]      &#x2B; preset:  medium&#xA;[04:26:50]      &#x2B; profile: auto&#xA;[04:26:50]      &#x2B; quality: 28.00 (RF)&#xA;[04:26:50]  * audio track 1&#xA;[04:26:50] mask erode thread started for segment 2&#xA;[04:26:50]    &#x2B; decoder: English (AAC) (2.0 ch) (track 1, id 0x1)&#xA;[04:26:50]      &#x2B; bitrate: 192 kbps, samplerate: 44100 Hz&#xA;[04:26:50]    &#x2B; mixdown: Stereo&#xA;[04:26:50]    &#x2B; encoder: AAC (libavcodec)&#xA;[04:26:50]      &#x2B; bitrate: 128 kbps, samplerate: 48000 Hz&#xA;[04:26:50] mask erode thread started for segment 3&#xA;[04:26:50] mask dilate thread started for segment 0&#xA;[04:26:50] mask dilate thread started for segment 1&#xA;[04:26:50] mask dilate thread started for segment 2&#xA;[04:26:50] decomb check thread started for segment 2&#xA;[04:26:50] yadif thread started for segment 1&#xA;[04:26:50] yadif thread started for segment 2&#xA;[04:26:50] yadif thread started for segment 3&#xA;[04:26:50] MTFrame thread started for segment 1&#xA;[04:26:50] MTFrame thread started for segment 2&#xA;[04:26:50] MTFrame thread started for segment 3&#xA;[04:26:50] mask dilate thread started for segment 3&#xA;[04:26:50] sync: expecting 4211 video frames&#xA;[04:26:50] mask erode thread started for segment 0&#xA;[04:26:50] decomb filter thread started for segment 2&#xA;[04:26:50] MTFrame thread started for segment 0&#xA;x265 [info]: HEVC encoder version 2.6&#xA;x265 [info]: build info [Windows][GCC 7.2.0][64 bit] 8bit&#x2B;10bit&#x2B;12bit&#xA;x265 [info]: using cpu capabilities: MMX2 SSE2Fast LZCNT SSSE3 SSE4.2 AVX FMA3 BMI2 AVX2&#xA;x265 [info]: Main profile, Level-3.1 (Main tier)&#xA;x265 [info]: Thread pool created using 4 threads&#xA;x265 [info]: Slices                              : 1&#xA;x265 [info]: frame threads / pool features       : 2 / wpp(12 rows)&#xA;x265 [info]: Coding QT: max CU size, min CU size : 64 / 8&#xA;x265 [info]: Residual QT: max TU size, max depth : 32 / 1 inter / 1 intra&#xA;x265 [info]: ME / range / subpel / merge         : hex / 57 / 2 / 2&#xA;x265 [info]: Keyframe min / max / scenecut / bias: 30 / 300 / 40 / 5.00&#xA;x265 [info]: Lookahead / bframes / badapt        : 20 / 4 / 2&#xA;x265 [info]: b-pyramid / weightp / weightb       : 1 / 1 / 0&#xA;x265 [info]: References / ref-limit  cu / depth  : 3 / on / on&#xA;x265 [info]: AQ: mode / str / qg-size / cu-tree  : 1 / 1.0 / 32 / 1&#xA;x265 [info]: Rate Control / qCompress            : CRF-28.0 / 0.60&#xA;x265 [info]: tools: rd=3 psy-rd=2.00 rskip signhide tmvp strong-intra-smoothing&#xA;x265 [info]: tools: lslices=4 deblock sao&#xA;[04:26:50] sync: first pts video is 0&#xA;[04:26:50] sync: "Chapter 1" (1) at frame 1 time 0&#xA;[04:26:50] sync: first pts audio 0x1 is 0&#xA;[04:40:02] reader: done. 1 scr changes&#xA;[04:40:13] work: average encoding speed for job is 5.245789 fps&#xA;[04:40:13] comb detect: heavy 3 | light 10 | uncombed 4198 | total 4211&#xA;[04:40:13] decomb: deinterlaced 3 | blended 10 | unfiltered 4198 | total 4211&#xA;[04:40:13] vfr: 4211 frames output, 0 dropped and 0 duped for CFR/PFR&#xA;[04:40:13] vfr: lost time: 0 (0 frames)&#xA;[04:40:13] vfr: gained time: 0 (0 frames) (0 not accounted for)&#xA;[04:40:13] aac-decoder done: 6052 frames, 0 decoder errors&#xA;[04:40:13] h264-decoder done: 4211 frames, 0 decoder errors&#xA;[04:40:13] sync: got 4211 frames, 4211 expected&#xA;[04:40:13] sync: framerate min 18.394 fps, max 29.970 fps, avg 29.966 fps&#xA;x265 [info]: frame I:     18, Avg QP:24.13  kb/s: 2900.85&#xA;x265 [info]: frame P:   1079, Avg QP:26.64  kb/s: 1040.14&#xA;x265 [info]: frame B:   3114, Avg QP:33.15  kb/s: 235.18&#xA;x265 [info]: Weighted P-Frames: Y:0.4% UV:0.4%&#xA;x265 [info]: consecutive B-frames: 4.0% 1.4% 20.1% 55.7% 18.8%&#xA;encoded 4211 frames in 802.93s (5.24 fps), 452.83 kb/s, Avg QP:31.44&#xA;[04:40:13] mux: track 0, 4211 frames, 7970061 bytes, 453.68 kbps, fifo 8192&#xA;[04:40:13] mux: track 1, 6588 frames, 2254132 bytes, 128.31 kbps, fifo 8192&#xA;[04:40:13] libhb: work result = 0&#xA;&#xA;# Encode Completed ...&#xA;

    &#xA;

  • Using ffmpeg to display a static image if an RTMP input source is missing

    19 mars 2016, par iameli

    Here is what I would like ffmpeg to output :

    • If I am streaming from my iPhone to my RTMP server, ffmpeg should output the live video from my iPhone.
    • If not, ffmpeg should output a blank red screen.

    Here’s what I have so far. It sort of works.

    ffmpeg \
     -f lavfi \
     -re \
     -i 'color=s=320x240:r=30:c=red' \
     -thread_queue_size 512 \
     -i 'rtmp://localhost/stream/iphone' \
     -c:v libx264 \
     -f flv \
     -filter_complex "\
       [1:v]scale=320:240[stream]; \
       [0:v][stream]overlay=0:0:eof_action=pass[output] \
     "\
     -map '[output]' \
     -tune zerolatency \
     'rtmp://localhost/stream/output'

    What happens : it boots up and starts streaming my iPhone’s output no problem. When I disconnect, it hangs for a long time, perhaps 20 seconds. Then it starts outputting red, okay. But then if I reconnect my phone, it doesn’t resume. It’s still red. Two questions :

    • Is there a way to configure the buffering so that it starts outputting red as soon as it stops getting data from the RTMP stream ?
    • Is there a way to have it auto-retry, so after the RTMP stream returns, it will switch back ?

    Full verbose output, if that’s helpful. I’m using the latest git version of ffmpeg as of 2016-03-18 on Ubuntu Wily. The RTMP server is nginx-rtmp.