Recherche avancée

Médias (16)

Mot : - Tags -/mp3

Autres articles (62)

  • MediaSPIP Core : La Configuration

    9 novembre 2010, par

    MediaSPIP Core fournit par défaut trois pages différentes de configuration (ces pages utilisent le plugin de configuration CFG pour fonctionner) : une page spécifique à la configuration générale du squelettes ; une page spécifique à la configuration de la page d’accueil du site ; une page spécifique à la configuration des secteurs ;
    Il fournit également une page supplémentaire qui n’apparait que lorsque certains plugins sont activés permettant de contrôler l’affichage et les fonctionnalités spécifiques (...)

  • Des sites réalisés avec MediaSPIP

    2 mai 2011, par

    Cette page présente quelques-uns des sites fonctionnant sous MediaSPIP.
    Vous pouvez bien entendu ajouter le votre grâce au formulaire en bas de page.

  • Librairies et binaires spécifiques au traitement vidéo et sonore

    31 janvier 2010, par

    Les logiciels et librairies suivantes sont utilisées par SPIPmotion d’une manière ou d’une autre.
    Binaires obligatoires FFMpeg : encodeur principal, permet de transcoder presque tous les types de fichiers vidéo et sonores dans les formats lisibles sur Internet. CF ce tutoriel pour son installation ; Oggz-tools : outils d’inspection de fichiers ogg ; Mediainfo : récupération d’informations depuis la plupart des formats vidéos et sonores ;
    Binaires complémentaires et facultatifs flvtool2 : (...)

Sur d’autres sites (8570)

  • ffmpeg avcodec_encode_video2 hangs when using Quick Sync h264_qsv encoder

    9 juin 2020, par Mike Simpson

    When I use the mpeg4 or h264 encoders, I am able to successfully encode images to make a valid AVI file using the API for ffmpeg 3.1.0. However, when I use the Quick Sync encoder (h264_qsv), avcodec_encode_video2 will hang some of the time. I found that when using images that are 1920x1080, it was rare that avcodec_encode_video2 would hang. When using 256x256 images, it was very likely that the function would hang.

    



    I have created the test code below that demonstrates the hang of avcodec_encode_video2. The code will create a 1000 frame, 256x256 AVI with a bit rate of 400000. The frames are simply allocated, so the output video should just be green frames.

    



    The problem was observed using Windows 7 and Windows 10, using the 32-bit or 64-bit test application.

    



    If anyone has any idea on how I can avoid the avcodec_encode_video2 hang I would be very grateful ! Thanks in advance for any assistance.

    



    extern "C"&#xA;{&#xA;#ifndef __STDC_CONSTANT_MACROS&#xA;#define __STDC_CONSTANT_MACROS&#xA;#endif&#xA;#include "avcodec.h"&#xA;#include "avformat.h"&#xA;#include "swscale.h"&#xA;#include "avutil.h"&#xA;#include "imgutils.h"&#xA;#include "opt.h"&#xA;#include &#xA;}&#xA;&#xA;#include <iostream>&#xA;&#xA;&#xA;// Globals&#xA;AVCodec* m_pCodec = NULL;&#xA;AVStream *m_pStream = NULL;&#xA;AVOutputFormat* m_pFormat = NULL;&#xA;AVFormatContext* m_pFormatContext = NULL;&#xA;AVCodecContext* m_pCodecContext = NULL;&#xA;AVFrame* m_pFrame = NULL;&#xA;int m_frameIndex;&#xA;&#xA;// Output format&#xA;AVPixelFormat m_pixType = AV_PIX_FMT_NV12;&#xA;// Use for mpeg4&#xA;//AVPixelFormat m_pixType = AV_PIX_FMT_YUV420P;&#xA;&#xA;// Output frame rate&#xA;int m_frameRate = 30;&#xA;// Output image dimensions&#xA;int m_imageWidth = 256;&#xA;int m_imageHeight = 256;&#xA;// Number of frames to export&#xA;int m_frameCount = 1000;&#xA;// Output file name&#xA;const char* m_fileName = "c:/test/test.avi";&#xA;// Output file type&#xA;const char* m_fileType = "AVI";&#xA;// Codec name used to encode&#xA;const char* m_encoderName = "h264_qsv";&#xA;// use for mpeg4&#xA;//const char* m_encoderName = "mpeg4";&#xA;// Target bit rate&#xA;int m_targetBitRate = 400000;&#xA;&#xA;void addVideoStream()&#xA;{&#xA;    m_pStream = avformat_new_stream( m_pFormatContext, m_pCodec );&#xA;    m_pStream->id = m_pFormatContext->nb_streams - 1;&#xA;    m_pStream->time_base = m_pCodecContext->time_base;&#xA;    m_pStream->codec->pix_fmt = m_pixType;&#xA;    m_pStream->codec->flags = m_pCodecContext->flags;&#xA;    m_pStream->codec->width = m_pCodecContext->width;&#xA;    m_pStream->codec->height = m_pCodecContext->height;&#xA;    m_pStream->codec->time_base = m_pCodecContext->time_base;&#xA;    m_pStream->codec->bit_rate = m_pCodecContext->bit_rate;&#xA;}&#xA;&#xA;AVFrame* allocatePicture( enum AVPixelFormat pix_fmt, int width, int height )&#xA;{&#xA;    AVFrame *frame;&#xA;&#xA;    frame = av_frame_alloc();&#xA;&#xA;    if ( !frame )&#xA;    {&#xA;        return NULL;&#xA;    }&#xA;&#xA;    frame->format = pix_fmt;&#xA;    frame->width  = width;&#xA;    frame->height = height;&#xA;&#xA;    int checkImage = av_image_alloc( frame->data, frame->linesize, width, height, pix_fmt, 32 );&#xA;&#xA;    if ( checkImage &lt; 0 )&#xA;    {&#xA;        return NULL;&#xA;    }&#xA;&#xA;    return frame;&#xA;}&#xA;&#xA;bool initialize()&#xA;{&#xA;    AVRational frameRate;&#xA;    frameRate.den = m_frameRate;&#xA;    frameRate.num = 1;&#xA;&#xA;    av_register_all();&#xA;&#xA;    m_pCodec = avcodec_find_encoder_by_name(m_encoderName);&#xA;&#xA;    if( !m_pCodec )&#xA;    {&#xA;        return false;&#xA;    }&#xA;&#xA;    m_pCodecContext = avcodec_alloc_context3( m_pCodec );&#xA;    m_pCodecContext->width = m_imageWidth;&#xA;    m_pCodecContext->height = m_imageHeight;&#xA;    m_pCodecContext->time_base = frameRate;&#xA;    m_pCodecContext->gop_size = 0;&#xA;    m_pCodecContext->pix_fmt = m_pixType;&#xA;    m_pCodecContext->codec_id = m_pCodec->id;&#xA;    m_pCodecContext->bit_rate = m_targetBitRate;&#xA;&#xA;    av_opt_set( m_pCodecContext->priv_data, "&#x2B;CBR", "", 0 );&#xA;&#xA;    return true;&#xA;}&#xA;&#xA;bool startExport()&#xA;{&#xA;    m_frameIndex = 0;&#xA;    char fakeFileName[512]; &#xA;    int checkAllocContext = avformat_alloc_output_context2( &amp;m_pFormatContext, NULL, m_fileType, fakeFileName );&#xA;&#xA;    if ( checkAllocContext &lt; 0 )&#xA;    {&#xA;        return false;&#xA;    }&#xA;&#xA;    if ( !m_pFormatContext ) &#xA;    {&#xA;        return false;&#xA;    }&#xA;&#xA;    m_pFormat = m_pFormatContext->oformat;&#xA;&#xA;    if ( m_pFormat->video_codec != AV_CODEC_ID_NONE ) &#xA;    {&#xA;        addVideoStream();&#xA;&#xA;        int checkOpen = avcodec_open2( m_pCodecContext, m_pCodec, NULL );&#xA;&#xA;        if ( checkOpen &lt; 0 )&#xA;        {&#xA;            return false;&#xA;        }&#xA;&#xA;        m_pFrame = allocatePicture( m_pCodecContext->pix_fmt, m_pCodecContext->width, m_pCodecContext->height );                &#xA;        if( !m_pFrame ) &#xA;        {&#xA;            return false;&#xA;        }&#xA;        m_pFrame->pts = 0;&#xA;    }&#xA;&#xA;    int checkOpen = avio_open( &amp;m_pFormatContext->pb, m_fileName, AVIO_FLAG_WRITE );&#xA;    if ( checkOpen &lt; 0 )&#xA;    {&#xA;        return false;&#xA;    }&#xA;&#xA;    av_dict_set( &amp;(m_pFormatContext->metadata), "title", "QS Test", 0 );&#xA;&#xA;    int checkHeader = avformat_write_header( m_pFormatContext, NULL );&#xA;    if ( checkHeader &lt; 0 )&#xA;    {&#xA;        return false;&#xA;    }&#xA;&#xA;    return true;&#xA;}&#xA;&#xA;int processFrame( AVPacket&amp; avPacket )&#xA;{&#xA;    avPacket.stream_index = 0;&#xA;    avPacket.pts = av_rescale_q( m_pFrame->pts, m_pStream->codec->time_base, m_pStream->time_base );&#xA;    avPacket.dts = av_rescale_q( m_pFrame->pts, m_pStream->codec->time_base, m_pStream->time_base );&#xA;    m_pFrame->pts&#x2B;&#x2B;;&#xA;&#xA;    int retVal = av_interleaved_write_frame( m_pFormatContext, &amp;avPacket );&#xA;    return retVal;&#xA;}&#xA;&#xA;bool exportFrame()&#xA;{&#xA;    int success = 1;&#xA;    int result = 0;&#xA;&#xA;    AVPacket avPacket;&#xA;&#xA;    av_init_packet( &amp;avPacket );&#xA;    avPacket.data = NULL;&#xA;    avPacket.size = 0;&#xA;&#xA;    fflush(stdout);&#xA;&#xA;    std::cout &lt;&lt; "Before avcodec_encode_video2 for frame: " &lt;&lt; m_frameIndex &lt;&lt; std::endl;&#xA;    success = avcodec_encode_video2( m_pCodecContext, &amp;avPacket, m_pFrame, &amp;result );&#xA;    std::cout &lt;&lt; "After avcodec_encode_video2 for frame: " &lt;&lt; m_frameIndex &lt;&lt; std::endl;&#xA;&#xA;    if( result )&#xA;    { &#xA;        success = processFrame( avPacket );&#xA;    }&#xA;&#xA;    av_packet_unref( &amp;avPacket );&#xA;&#xA;    m_frameIndex&#x2B;&#x2B;;&#xA;    return ( success == 0 );&#xA;}&#xA;&#xA;void endExport()&#xA;{&#xA;    int result = 0;&#xA;    int success = 0;&#xA;&#xA;    if (m_pFrame)&#xA;    {&#xA;        while ( success == 0 )&#xA;        {&#xA;            AVPacket avPacket;&#xA;            av_init_packet( &amp;avPacket );&#xA;            avPacket.data = NULL;&#xA;            avPacket.size = 0;&#xA;&#xA;            fflush(stdout);&#xA;            success = avcodec_encode_video2( m_pCodecContext, &amp;avPacket, NULL, &amp;result );&#xA;&#xA;            if( result )&#xA;            { &#xA;                success = processFrame( avPacket );&#xA;            }&#xA;            av_packet_unref( &amp;avPacket );&#xA;&#xA;            if (!result)&#xA;            {&#xA;                break;&#xA;            }&#xA;        }&#xA;    }&#xA;&#xA;    if (m_pFormatContext)&#xA;    {&#xA;        av_write_trailer( m_pFormatContext );&#xA;&#xA;        if( m_pFrame )&#xA;        {&#xA;            av_frame_free( &amp;m_pFrame );&#xA;        }&#xA;&#xA;        avio_closep( &amp;m_pFormatContext->pb );&#xA;        avformat_free_context( m_pFormatContext );&#xA;        m_pFormatContext = NULL;&#xA;    }&#xA;}&#xA;&#xA;void cleanup()&#xA;{&#xA;    if( m_pFrame || m_pCodecContext )&#xA;    {&#xA;        if( m_pFrame )&#xA;        {&#xA;            av_frame_free( &amp;m_pFrame );&#xA;        }&#xA;&#xA;        if( m_pCodecContext )&#xA;        {&#xA;            avcodec_close( m_pCodecContext );&#xA;            av_free( m_pCodecContext );&#xA;        }&#xA;    }&#xA;}&#xA;&#xA;int main()&#xA;{&#xA;    bool success = true;&#xA;    if (initialize())&#xA;    {&#xA;        if (startExport())&#xA;        {&#xA;            for (int loop = 0; loop &lt; m_frameCount; loop&#x2B;&#x2B;)&#xA;            {&#xA;                if (!exportFrame())&#xA;                {&#xA;                    std::cout &lt;&lt; "Failed to export frame\n";&#xA;                    success = false;&#xA;                    break;&#xA;                }&#xA;            }&#xA;            endExport();&#xA;        }&#xA;        else&#xA;        {&#xA;            std::cout &lt;&lt; "Failed to start export\n";&#xA;            success = false;&#xA;        }&#xA;&#xA;        cleanup();&#xA;    }&#xA;    else&#xA;    {&#xA;        std::cout &lt;&lt; "Failed to initialize export\n";&#xA;        success = false;&#xA;    }&#xA;&#xA;    if (success)&#xA;    {&#xA;        std::cout &lt;&lt; "Successfully exported file\n";&#xA;    }&#xA;    return 1;&#xA;}&#xA;</iostream>

    &#xA;

  • FFMPEG Video to Audio Conversion Results in Different Durations

    10 juin 2020, par Eric J

    I am trying to covert an MP4 file into a mono WAV file sampled at 16,000 Hz.

    &#xA;&#xA;

    When I run below code, the duration goes from 00:09:59.99 (MP4) to 00:09:57.64 (WAV). Its original, longer version goes from 00:48:37.46 (MP4) to 00:48:23.38 (WAV).

    &#xA;&#xA;

    ffmpeg -i .mp4 -ac 1 -ar 16000 .wav&#xA;

    &#xA;&#xA;

    I've also tried below code. The result is much worse, going from 00:09:59.99 (MP4) to 00:12:56.29 (AAC).

    &#xA;&#xA;

    ffmpeg -I .mp4 -vn -acodec copy .aac&#xA;

    &#xA;&#xA;

    Attaching the log :

    &#xA;&#xA;

    Report written to "ffmpeg-20200610-093115.log"&#xA;Command line:&#xA;ffmpeg -i short.mp4 -ac 1 -ar 16000 short.wav -report&#xA;ffmpeg version 4.1.1 Copyright (c) 2000-2019 the FFmpeg developers&#xA;  built with Apple LLVM version 10.0.0 (clang-1000.11.45.5)&#xA;  configuration: --prefix=/usr/local/Cellar/ffmpeg/4.1.1 --enable-shared --enable-pthreads --enable-version3 --enable-hardcoded-tables --enable-avresample --cc=clang --host-cflags=&#x27;-I/Library/Java/JavaVirtualMachines/openjdk-11.0.2.jdk/Contents/Home/include -I/Library/Java/JavaVirtualMachines/openjdk-11.0.2.jdk/Contents/Home/include/darwin&#x27; --host-ldflags= --enable-ffplay --enable-gnutls --enable-gpl --enable-libaom --enable-libbluray --enable-libmp3lame --enable-libopus --enable-librubberband --enable-libsnappy --enable-libtesseract --enable-libtheora --enable-libvorbis --enable-libvpx --enable-libx264 --enable-libx265 --enable-libxvid --enable-lzma --enable-libfontconfig --enable-libfreetype --enable-frei0r --enable-libass --enable-libopencore-amrnb --enable-libopencore-amrwb --enable-libopenjpeg --enable-librtmp --enable-libspeex --enable-videotoolbox --disable-libjack --disable-indev=jack --enable-libaom --enable-libsoxr&#xA;  libavutil      56. 22.100 / 56. 22.100&#xA;  libavcodec     58. 35.100 / 58. 35.100&#xA;  libavformat    58. 20.100 / 58. 20.100&#xA;  libavdevice    58.  5.100 / 58.  5.100&#xA;  libavfilter     7. 40.101 /  7. 40.101&#xA;  libavresample   4.  0.  0 /  4.  0.  0&#xA;  libswscale      5.  3.100 /  5.  3.100&#xA;  libswresample   3.  3.100 /  3.  3.100&#xA;  libpostproc    55.  3.100 / 55.  3.100&#xA;Splitting the commandline.&#xA;Reading option &#x27;-i&#x27; ... matched as input url with argument &#x27;short.mp4&#x27;.&#xA;Reading option &#x27;-ac&#x27; ... matched as option &#x27;ac&#x27; (set number of audio channels) with argument &#x27;1&#x27;.&#xA;Reading option &#x27;-ar&#x27; ... matched as option &#x27;ar&#x27; (set audio sampling rate (in Hz)) with argument &#x27;16000&#x27;.&#xA;Reading option &#x27;short.wav&#x27; ... matched as output url.&#xA;Reading option &#x27;-report&#x27; ... matched as option &#x27;report&#x27; (generate a report) with argument &#x27;1&#x27;.&#xA;Finished splitting the commandline.&#xA;Parsing a group of options: global .&#xA;Applying option report (generate a report) with argument 1.&#xA;Successfully parsed a group of options.&#xA;Parsing a group of options: input url short.mp4.&#xA;Successfully parsed a group of options.&#xA;Opening an input file: short.mp4.&#xA;[NULL @ 0x7f98a3008200] Opening &#x27;short.mp4&#x27; for reading&#xA;[file @ 0x7f98a2904440] Setting default whitelist &#x27;file,crypto&#x27;&#xA;[mov,mp4,m4a,3gp,3g2,mj2 @ 0x7f98a3008200] Format mov,mp4,m4a,3gp,3g2,mj2 probed with size=2048 and score=100&#xA;[mov,mp4,m4a,3gp,3g2,mj2 @ 0x7f98a3008200] ISO: File Type Major Brand: mp42&#xA;[mov,mp4,m4a,3gp,3g2,mj2 @ 0x7f98a3008200] Unknown dref type 0x206c7275 size 12&#xA;[mov,mp4,m4a,3gp,3g2,mj2 @ 0x7f98a3008200] Processing st: 0, edit list 0 - media time: 0, duration: 7679872&#xA;[mov,mp4,m4a,3gp,3g2,mj2 @ 0x7f98a3008200] Unknown dref type 0x206c7275 size 12&#xA;[mov,mp4,m4a,3gp,3g2,mj2 @ 0x7f98a3008200] Processing st: 1, edit list 0 - media time: 1024, duration: 26459559&#xA;[mov,mp4,m4a,3gp,3g2,mj2 @ 0x7f98a3008200] drop a frame at curr_cts: 0 @ 0&#xA;[mov,mp4,m4a,3gp,3g2,mj2 @ 0x7f98a3008200] Before avformat_find_stream_info() pos: 11213917 bytes read:318782 seeks:1 nb_streams:2&#xA;[h264 @ 0x7f98a3808800] nal_unit_type: 7(SPS), nal_ref_idc: 3&#xA;[h264 @ 0x7f98a3808800] nal_unit_type: 8(PPS), nal_ref_idc: 3&#xA;[mov,mp4,m4a,3gp,3g2,mj2 @ 0x7f98a3008200] demuxer injecting skip 1024 / discard 0&#xA;[aac @ 0x7f98a1008c00] skip 1024 / discard 0 samples due to side data&#xA;[h264 @ 0x7f98a3808800] nal_unit_type: 6(SEI), nal_ref_idc: 0&#xA;[h264 @ 0x7f98a3808800] nal_unit_type: 5(IDR), nal_ref_idc: 3&#xA;[h264 @ 0x7f98a3808800] Format yuv420p chosen by get_format().&#xA;[h264 @ 0x7f98a3808800] Reinit context to 640x368, pix_fmt: yuv420p&#xA;[mov,mp4,m4a,3gp,3g2,mj2 @ 0x7f98a3008200] All info found&#xA;[mov,mp4,m4a,3gp,3g2,mj2 @ 0x7f98a3008200] After avformat_find_stream_info() pos: 21961 bytes read:351550 seeks:2 frames:46&#xA;Input #0, mov,mp4,m4a,3gp,3g2,mj2, from &#x27;short.mp4&#x27;:&#xA;  Metadata:&#xA;    major_brand     : mp42&#xA;    minor_version   : 1&#xA;    compatible_brands: isommp41mp42&#xA;    creation_time   : 2020-06-10T16:12:17.000000Z&#xA;  Duration: 00:09:59.99, start: 0.000000, bitrate: 149 kb/s&#xA;    Stream #0:0(eng), 1, 1/12800: Video: h264 (Constrained Baseline) (avc1 / 0x31637661), yuv420p, 640x360 [SAR 1:1 DAR 16:9], 47 kb/s, 25 fps, 25 tbr, 12800 tbn, 50 tbc (default)&#xA;    Metadata:&#xA;      creation_time   : 2020-06-10T16:12:17.000000Z&#xA;      handler_name    : Core Media Video&#xA;    Stream #0:1(eng), 45, 1/44100: Audio: aac (LC) (mp4a / 0x6134706D), 44100 Hz, mono, fltp, 98 kb/s (default)&#xA;    Metadata:&#xA;      creation_time   : 2020-06-10T16:12:17.000000Z&#xA;      handler_name    : Core Media Audio&#xA;Successfully opened the file.&#xA;Parsing a group of options: output url short.wav.&#xA;Applying option ac (set number of audio channels) with argument 1.&#xA;Applying option ar (set audio sampling rate (in Hz)) with argument 16000.&#xA;Successfully parsed a group of options.&#xA;Opening an output file: short.wav.&#xA;[file @ 0x7f98a0c1db40] Setting default whitelist &#x27;file,crypto&#x27;&#xA;Successfully opened the file.&#xA;Stream mapping:&#xA;  Stream #0:1 -> #0:0 (aac (native) -> pcm_s16le (native))&#xA;Press [q] to stop, [?] for help&#xA;cur_dts is invalid (this is harmless if it occurs once at the start per stream)&#xA;[aac @ 0x7f98a100de00] skip 1024 / discard 0 samples due to side data&#xA;cur_dts is invalid (this is harmless if it occurs once at the start per stream)&#xA;detected 12 logical cores&#xA;[graph_0_in_0_1 @ 0x7f98a0e2c4c0] Setting &#x27;time_base&#x27; to value &#x27;1/44100&#x27;&#xA;[graph_0_in_0_1 @ 0x7f98a0e2c4c0] Setting &#x27;sample_rate&#x27; to value &#x27;44100&#x27;&#xA;[graph_0_in_0_1 @ 0x7f98a0e2c4c0] Setting &#x27;sample_fmt&#x27; to value &#x27;fltp&#x27;&#xA;[graph_0_in_0_1 @ 0x7f98a0e2c4c0] Setting &#x27;channel_layout&#x27; to value &#x27;0x4&#x27;&#xA;[graph_0_in_0_1 @ 0x7f98a0e2c4c0] tb:1/44100 samplefmt:fltp samplerate:44100 chlayout:0x4&#xA;[format_out_0_0 @ 0x7f98a0e2cb80] Setting &#x27;sample_fmts&#x27; to value &#x27;s16&#x27;&#xA;[format_out_0_0 @ 0x7f98a0e2cb80] Setting &#x27;sample_rates&#x27; to value &#x27;16000&#x27;&#xA;[format_out_0_0 @ 0x7f98a0e2cb80] Setting &#x27;channel_layouts&#x27; to value &#x27;0x4&#x27;&#xA;[format_out_0_0 @ 0x7f98a0e2cb80] auto-inserting filter &#x27;auto_resampler_0&#x27; between the filter &#x27;Parsed_anull_0&#x27; and the filter &#x27;format_out_0_0&#x27;&#xA;[AVFilterGraph @ 0x7f98a0c16ac0] query_formats: 4 queried, 6 merged, 3 already done, 0 delayed&#xA;[auto_resampler_0 @ 0x7f98a0e2d540] [SWR @ 0x7f98a28e1000] Using fltp internally between filters&#xA;[auto_resampler_0 @ 0x7f98a0e2d540] ch:1 chl:mono fmt:fltp r:44100Hz -> ch:1 chl:mono fmt:s16 r:16000Hz&#xA;Output #0, wav, to &#x27;short.wav&#x27;:&#xA;  Metadata:&#xA;    major_brand     : mp42&#xA;    minor_version   : 1&#xA;    compatible_brands: isommp41mp42&#xA;    ISFT            : Lavf58.20.100&#xA;    Stream #0:0(eng), 0, 1/16000: Audio: pcm_s16le ([1][0][0][0] / 0x0001), 16000 Hz, mono, s16, 256 kb/s (default)&#xA;    Metadata:&#xA;      creation_time   : 2020-06-10T16:12:17.000000Z&#xA;      handler_name    : Core Media Audio&#xA;      encoder         : Lavc58.35.100 pcm_s16le&#xA;size=   17152kB time=00:09:16.63 bitrate= 252.4kbits/s speed=1.11e&#x2B;03x    &#xA;[out_0_0 @ 0x7f98a0e2c700] EOF on sink link out_0_0:default.&#xA;No more output streams to write to, finishing.&#xA;size=   18676kB time=00:09:59.99 bitrate= 255.0kbits/s speed=1.11e&#x2B;03x    &#xA;video:0kB audio:18676kB subtitle:0kB other streams:0kB global headers:0kB muxing overhead: 0.000408%&#xA;Input file #0 (short.mp4):&#xA;  Input stream #0:0 (video): 1 packets read (3689 bytes); &#xA;  Input stream #0:1 (audio): 25739 packets read (7375414 bytes); 25738 frames decoded (26355712 samples); &#xA;  Total: 25740 packets (7379103 bytes) demuxed&#xA;Output file #0 (short.wav):&#xA;  Output stream #0:0 (audio): 25739 frames encoded (9562163 samples); 25739 packets muxed (19124326 bytes); &#xA;  Total: 25739 packets (19124326 bytes) muxed&#xA;25738 frames successfully decoded, 0 decoding errors&#xA;[AVIOContext @ 0x7f98a0c1dc40] Statistics: 4 seeks, 76 writeouts&#xA;[AVIOContext @ 0x7f98a29045c0] Statistics: 10902846 bytes read, 29 seeks&#xA;

    &#xA;

  • ffmpeg webm to mp4 conversion failed

    13 juin 2020, par Jaunius Bumptirklu

    Trying to convert webm file to mp4. Getting "conversion failed" as a result. Other webm files I am working with converts just fine.

    &#xA;&#xA;

    ffprobe info on inputfile.webm

    &#xA;&#xA;

    $ ffprobe -v quiet -print_format json -show_format -show_streams inputfile.webm&#xA;{&#xA;    "streams": [&#xA;        {&#xA;            "index": 0,&#xA;            "codec_name": "vp8",&#xA;            "codec_long_name": "On2 VP8",&#xA;            "profile": "0",&#xA;            "codec_type": "video",&#xA;            "codec_time_base": "1/30",&#xA;            "codec_tag_string": "[0][0][0][0]",&#xA;            "codec_tag": "0x0000",&#xA;            "width": 640,&#xA;            "height": 480,&#xA;            "coded_width": 640,&#xA;            "coded_height": 480,&#xA;            "has_b_frames": 0,&#xA;            "sample_aspect_ratio": "1:1",&#xA;            "display_aspect_ratio": "4:3",&#xA;            "pix_fmt": "yuv420p",&#xA;            "level": -99,&#xA;            "field_order": "progressive",&#xA;            "refs": 1,&#xA;            "r_frame_rate": "30/1",&#xA;            "avg_frame_rate": "30/1",&#xA;            "time_base": "1/1000",&#xA;            "start_pts": 0,&#xA;            "start_time": "0.000000",&#xA;            "disposition": {&#xA;                "default": 1,&#xA;                "dub": 0,&#xA;                "original": 0,&#xA;                "comment": 0,&#xA;                "lyrics": 0,&#xA;                "karaoke": 0,&#xA;                "forced": 0,&#xA;                "hearing_impaired": 0,&#xA;                "visual_impaired": 0,&#xA;                "clean_effects": 0,&#xA;                "attached_pic": 0,&#xA;                "timed_thumbnails": 0&#xA;            }&#xA;        },&#xA;        {&#xA;            "index": 1,&#xA;            "codec_name": "opus",&#xA;            "codec_long_name": "Opus (Opus Interactive Audio Codec)",&#xA;            "codec_type": "audio",&#xA;            "codec_time_base": "1/48000",&#xA;            "codec_tag_string": "[0][0][0][0]",&#xA;            "codec_tag": "0x0000",&#xA;            "sample_fmt": "fltp",&#xA;            "sample_rate": "48000",&#xA;            "channels": 1,&#xA;            "channel_layout": "mono",&#xA;            "bits_per_sample": 0,&#xA;            "r_frame_rate": "0/0",&#xA;            "avg_frame_rate": "0/0",&#xA;            "time_base": "1/1000",&#xA;            "start_pts": 0,&#xA;            "start_time": "0.000000",&#xA;            "duration_ts": 12333,&#xA;            "duration": "12.333000",&#xA;            "disposition": {&#xA;                "default": 1,&#xA;                "dub": 0,&#xA;                "original": 0,&#xA;                "comment": 0,&#xA;                "lyrics": 0,&#xA;                "karaoke": 0,&#xA;                "forced": 0,&#xA;                "hearing_impaired": 0,&#xA;                "visual_impaired": 0,&#xA;                "clean_effects": 0,&#xA;                "attached_pic": 0,&#xA;                "timed_thumbnails": 0&#xA;            }&#xA;        }&#xA;    ],&#xA;    "format": {&#xA;        "filename": "inputfile.webm",&#xA;        "nb_streams": 2,&#xA;        "nb_programs": 0,&#xA;        "format_name": "matroska,webm",&#xA;        "format_long_name": "Matroska / WebM",&#xA;        "start_time": "0.000000",&#xA;        "duration": "12.333000",&#xA;        "size": "1609303",&#xA;        "bit_rate": "1043900",&#xA;        "probe_score": 100,&#xA;        "tags": {&#xA;            "encoder": "Lavf56.40.101",&#xA;            "creation_time": "2020-06-12T11:32:05.000000Z"&#xA;        }&#xA;    }&#xA;}&#xA;

    &#xA;&#xA;

    ffmpeg conversion log for command "ffmpeg -i inputfile.webm out.mp4" is below.

    &#xA;&#xA;

    $ ffmpeg -i inputfile.webm out.mp4&#xA;ffmpeg version 4.2.2 Copyright (c) 2000-2019 the FFmpeg developers&#xA;  built with Apple clang version 11.0.3 (clang-1103.0.32.59)&#xA;  configuration: --prefix=/usr/local/Cellar/ffmpeg/4.2.2_3 --enable-shared --enable-pthreads --enable-version3 --enable-avresample --cc=clang --host-cflags=-fno-stack-check --host-ldflags= --enable-ffplay --enable-gnutls --enable-gpl --enable-libaom --enable-libbluray --enable-libmp3lame --enable-libopus --enable-librubberband --enable-libsnappy --enable-libsrt --enable-libtesseract --enable-libtheora --enable-libvidstab --enable-libvorbis --enable-libvpx --enable-libwebp --enable-libx264 --enable-libx265 --enable-libxvid --enable-lzma --enable-libfontconfig --enable-libfreetype --enable-frei0r --enable-libass --enable-libopencore-amrnb --enable-libopencore-amrwb --enable-libopenjpeg --enable-librtmp --enable-libspeex --enable-libsoxr --enable-videotoolbox --disable-libjack --disable-indev=jack&#xA;  libavutil      56. 31.100 / 56. 31.100&#xA;  libavcodec     58. 54.100 / 58. 54.100&#xA;  libavformat    58. 29.100 / 58. 29.100&#xA;  libavdevice    58.  8.100 / 58.  8.100&#xA;  libavfilter     7. 57.100 /  7. 57.100&#xA;  libavresample   4.  0.  0 /  4.  0.  0&#xA;  libswscale      5.  5.100 /  5.  5.100&#xA;  libswresample   3.  5.100 /  3.  5.100&#xA;  libpostproc    55.  5.100 / 55.  5.100&#xA;Input #0, matroska,webm, from &#x27;inputfile.webm&#x27;:&#xA;  Metadata:&#xA;    encoder         : Lavf56.40.101&#xA;    creation_time   : 2020-06-12T11:32:05.000000Z&#xA;  Duration: 00:00:12.33, start: 0.000000, bitrate: 1043 kb/s&#xA;    Stream #0:0: Video: vp8, yuv420p(progressive), 640x480, SAR 1:1 DAR 4:3, 30 fps, 30 tbr, 1k tbn, 1k tbc (default)&#xA;    Stream #0:1: Audio: opus, 48000 Hz, mono, fltp (default)&#xA;Stream mapping:&#xA;  Stream #0:0 -> #0:0 (vp8 (native) -> h264 (libx264))&#xA;  Stream #0:1 -> #0:1 (opus (native) -> aac (native))&#xA;Press [q] to stop, [?] for help&#xA;[libx264 @ 0x7f9e64811600] using SAR=1/1&#xA;[libx264 @ 0x7f9e64811600] using cpu capabilities: MMX2 SSE2Fast SSSE3 SSE4.2 AVX FMA3 BMI2 AVX2&#xA;[libx264 @ 0x7f9e64811600] profile High, level 5.0&#xA;[libx264 @ 0x7f9e64811600] 264 - core 155 r2917 0a84d98 - H.264/MPEG-4 AVC codec - Copyleft 2003-2018 - http://www.videolan.org/x264.html - options: cabac=1 ref=3 deblock=1:0:0 analyse=0x3:0x113 me=hex subme=7 psy=1 psy_rd=1.00:0.00 mixed_ref=1 me_range=16 chroma_me=1 trellis=1 8x8dct=1 cqm=0 deadzone=21,11 fast_pskip=1 chroma_qp_offset=-2 threads=18 lookahead_threads=3 sliced_threads=0 nr=0 decimate=1 interlaced=0 bluray_compat=0 constrained_intra=0 bframes=3 b_pyramid=2 b_adapt=1 b_bias=0 direct=1 weightb=1 open_gop=0 weightp=2 keyint=250 keyint_min=25 scenecut=40 intra_refresh=0 rc_lookahead=40 rc=crf mbtree=1 crf=23.0 qcomp=0.60 qpmin=0 qpmax=69 qpstep=4 ip_ratio=1.40 aq=1:1.00&#xA;Too many packets buffered for output stream 0:0.577014:32:22.77 bitrate=  -0.0kbits/s dup=45 drop=0 speed=N/A&#xA;[libx264 @ 0x7f9e64811600] frame I:1     Avg QP:16.69  size: 56001&#xA;[libx264 @ 0x7f9e64811600] frame P:33    Avg QP:19.46  size:  9705&#xA;[libx264 @ 0x7f9e64811600] frame B:95    Avg QP:19.23  size:   662&#xA;[libx264 @ 0x7f9e64811600] consecutive B-frames:  0.8%  0.0%  4.6% 94.7%&#xA;[libx264 @ 0x7f9e64811600] mb I  I16..4: 46.7% 36.4% 16.9%&#xA;[libx264 @ 0x7f9e64811600] mb P  I16..4:  4.0%  9.4%  0.5%  P16..4:  6.5%  1.2%  0.6%  0.0%  0.0%    skip:77.8%&#xA;[libx264 @ 0x7f9e64811600] mb B  I16..4:  0.1%  0.1%  0.0%  B16..8:  6.0%  0.1%  0.0%  direct: 0.7%  skip:93.0%  L0:44.7% L1:54.8% BI: 0.4%&#xA;[libx264 @ 0x7f9e64811600] 8x8 transform intra:61.3% inter:37.9%&#xA;[libx264 @ 0x7f9e64811600] coded y,uvDC,uvAC intra: 8.6% 3.3% 1.3% inter: 0.9% 0.9% 0.1%&#xA;[libx264 @ 0x7f9e64811600] i16 v,h,dc,p: 41% 52%  6%  1%&#xA;[libx264 @ 0x7f9e64811600] i8 v,h,dc,ddl,ddr,vr,hd,vl,hu: 42% 16% 41%  0%  0%  0%  0%  0%  0%&#xA;[libx264 @ 0x7f9e64811600] i4 v,h,dc,ddl,ddr,vr,hd,vl,hu: 32% 40% 17%  2%  2%  2%  2%  1%  3%&#xA;[libx264 @ 0x7f9e64811600] i8c dc,h,v,p: 88%  8%  3%  0%&#xA;[libx264 @ 0x7f9e64811600] Weighted P-Frames: Y:0.0% UV:0.0%&#xA;[libx264 @ 0x7f9e64811600] ref P L0: 75.5% 13.1%  9.1%  2.3%&#xA;[libx264 @ 0x7f9e64811600] ref B L0: 82.1% 16.4%  1.5%&#xA;[libx264 @ 0x7f9e64811600] ref B L1: 97.0%  3.0%&#xA;[libx264 @ 0x7f9e64811600] kb/s:816.97&#xA;Conversion failed!&#xA;

    &#xA;&#xA;

    I don't have deeper experience with ffmpeg conversions and codecs. It seems to me that this is a frames related problem. Do you have a clue why does it fail ? What options should I use in ffmpeg command to solve this ? Thanks for any help.

    &#xA;