Newest 'ffmpeg' Questions - Stack Overflow

http://stackoverflow.com/questions/tagged/ffmpeg

Les articles publiés sur le site

  • ffmpeg error : Could not write header for output file #0 (incorrect codec parameters ?) : Muxer not found

    30 janvier 2016, par Benjamin Russell

    I am trying to segment a mp4 video file for HLS playback and I am getting the following error:

    "Could not write header for output file #0 (incorrect codec parameters ?): Muxer not found"

    Does anyone know what I am doing wrong?

    input command:

    sudo ffmpeg -y -i adwd.mp4 -vcodec copy -acodec copy -force_key_frames 30 -map 0  -f segment segment_list adwd.m3u8 -segment_time 10 -segment_format mpeg_ts -segment_list_type m3u8 segment%d.ts
    
    
        ffmpeg version 2.8.5 Copyright (c) 2000-2016 the FFmpeg developers
          built with Apple LLVM version 7.0.2 (clang-700.1.81)
          configuration: --prefix=/usr/local/Cellar/ffmpeg/2.8.5 --enable-shared --enable-pthreads --enable-gpl --enable-version3 --enable-hardcoded-tables --enable-avresample --cc=clang --host-cflags= --host-ldflags= --enable-opencl --enable-libx264 --enable-libmp3lame --enable-libvo-aacenc --enable-libxvid --enable-vda
          libavutil      54. 31.100 / 54. 31.100
          libavcodec     56. 60.100 / 56. 60.100
          libavformat    56. 40.101 / 56. 40.101
          libavdevice    56.  4.100 / 56.  4.100
          libavfilter     5. 40.101 /  5. 40.101
          libavresample   2.  1.  0 /  2.  1.  0
          libswscale      3.  1.101 /  3.  1.101
          libswresample   1.  2.101 /  1.  2.101
          libpostproc    53.  3.100 / 53.  3.100
    

    Video information:

    General / Container Stream #1
        Total Video Streams for this File.................1
        Total Audio Streams for this File.................1
        Video Codecs Used.................................AVC
        Audio Codecs Used.................................AAC LC
        File Format.......................................MPEG-4
        Play Time.........................................9h 1mn
        Total File Size...................................588 MiB
        Total Stream BitRate..............................152 Kbps
        Encoded with......................................Lavf56.40.101
    Video Stream #1
        Codec (Human Name)................................AVC
        Codec (FourCC)....................................avc1
        Codec Profile.....................................High@L2.1
        Frame Width.......................................426 pixels
        Frame Height......................................240 pixels
        Frame Rate........................................29.970 fps
        Total Frames......................................973039
        Display Aspect Ratio..............................16:9
        Scan Type.........................................Progressive
        Color Space.......................................YUV
        Codec Settings (Summary)..........................CABAC / 4 Ref Frames
        QF (like Gordian Knot)............................0.005
        Codec Settings (CABAC)............................Yes
        Codec Settings (Reference Frames).................4
        Video Stream Length...............................9h 1mn 7s 68ms
        Video Stream BitRate..............................15.2 Kbps
        Video Stream BitRate Mode.........................VBR
        Bit Depth.........................................8 bits
        Video Stream Size.................................58.9 MiB (10%)
        Video Encoder.....................................x264 - core 148 r2601 a0cd7d3
        Video Encoder (Settings)..........................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=3 / lookahead_threads=1 / 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
    Audio Stream #1
        Codec.............................................AAC
        Codec (FourCC)....................................40
        Audio Stream Length...............................9h 1mn 7s 104ms
        Audio Stream BitRate..............................128 Kbps
        Audio Stream BitRate Mode.........................CBR
        Number of Audio Channels..........................2
        Audio Channel's Positions.........................Front: L R
        Sampling Rate.....................................44.1 KHz
        Audio Stream Size.................................495 MiB (84%)
    
  • rtmp Videos encoded with FFmpeg play too fast

    30 janvier 2016, par 江嘉荣

    play back too fast and loading Every once in a while

    here is the code ... please help...

    pFormatCtx = avformat_alloc_context();
    
    out_filename = "rtmp://192.168.1.105:1935/jc";
    
     avformat_alloc_output_context2(&pFormatCtx, ofmt, "flv", out_filename);    
    
     ofmt = pFormatCtx->oformat;
    
    if (avio_open(&pFormatCtx->pb,out_filename, AVIO_FLAG_WRITE) < 0){
        printf("Failed to open output file! \n");
        return -1;
    }
    
    video_st = avformat_new_stream(pFormatCtx, 0);
    video_st->time_base.num = 1;
    video_st->time_base.den = 30;
    
    
    br = 400 * 1000;
    pCodecCtx = video_st->codec;
    pCodecCtx->codec_id = AV_CODEC_ID_H264;
    pCodecCtx->codec_type = AVMEDIA_TYPE_VIDEO;
    pCodecCtx->pix_fmt = PIX_FMT_YUV420P;
    
    pCodecCtx->gop_size = 12;
     pCodecCtx->max_qdiff = 4;
    
    pCodecCtx->qmin = 0;
    pCodecCtx->qmax = 51;
    
    pCodecCtx->bit_rate = br;
    pCodecCtx->rc_min_rate =br;
    pCodecCtx->rc_max_rate = br;
    pCodecCtx->bit_rate_tolerance = br;
    pCodecCtx->rc_buffer_size=br;
    
    pCodecCtx->rc_initial_buffer_occupancy = pCodecCtx->rc_buffer_size*3/4;
    
    pCodecCtx->time_base.num = 1;
    pCodecCtx->time_base.den = 30;
    
    start_time = 0;
    
    pCodecCtx->max_b_frames = 3;
    
    AVDictionary *param = 0;
    
    if(pCodecCtx->codec_id == AV_CODEC_ID_H264) {
    
        av_dict_set(&param, "preset", "ultrafast", 0);
        av_dict_set(&param, "tune", "zerolatency", 0);
        av_dict_set(&param, "max_delay", "500", 0);
    }
    
    av_dump_format(pFormatCtx, 0, out_filename, AVIO_FLAG_WRITE);
    
    pCodec = avcodec_find_encoder(AV_CODEC_ID_H264);
    
    avformat_write_header(pFormatCtx, NULL);
    
    y_size = pCodecCtx->width * pCodecCtx->height;
    
    return 0;
    

    get pFrame

        pFrame->width = encoder_h264_frame_width;
        pFrame->height = encoder_h264_frame_height;
        pFrame->format = PIX_FMT_YUV420P;
    

    I don't know if it's right way to set the pFrame->pts here...

        pFrame->pts = av_rescale_q(framecnt, pCodecCtx->time_base, video_st-    >codec->time_base);
        avpicture_fill((AVPicture *)pFrame, picture_buf, pCodecCtx->pix_fmt, pCodecCtx->width,    pCodecCtx->height);
        pkt.data = NULL; 
        pkt.size = 0;
    
        int got_picture = 0;
    
        int ret = avcodec_encode_video2(pCodecCtx, &pkt, pFrame, &got_picture);
        framecnt++;
        if(ret < 0) {
        }
        if (got_picture=) {
            pkt.stream_index = video_st->index;
    

    is it right ?

            pkt.pts = av_rescale_q(pkt.pts, video_st->codec->time_base, video_st->time_base);
            pkt.dts = av_rescale_q(pkt.dts, video_st->codec->time_base, video_st->time_base); 
    
            ret = av_interleaved_write_frame(pFormatCtx, &pkt);
    
        }
        av_frame_free(&pFrame);
        av_free_packet(&pkt);
        free(yuv420_data);
    

    This problem has troubled me for a lot of days....

  • Installing ffmpeg on CentOS 6.6

    30 janvier 2016, par Kristaps Drozdovskis

    Im trying to install ffmpeg,.. When I write comand:

    git clone --depth 1 http://source.ffmpeg.org/git/ffmpeg.git
    

    I got this error.. why??

    Initialized empty Git repository in /root/ffmpeg_sources/ffmpeg/ffmpeg/.git/ fatal: dumb http transport does not support --depth

    Installing from this source.. https://trac.ffmpeg.org/wiki/CompilationGuide/Centos

  • How to convert the MP4 video file from images without audio using FFMPEG ?

    30 janvier 2016, par Rama Lingam

    I am converting the MP4 video file $output from some images and one audio file. But now I want to convert the same MP4 video file without audio. How to do it?

    Here is my sample code:

    // Convert Video from audio and images
    exec("$ffmpeg -framerate 1/5 -i $convImgPath -i $convAudioPath -c:v libx264 -c:a aac -strict experimental -b:a 16k -shortest $output");
    

    Please update my code where I am change.

  • Is it possible install only ffprobe ? [on hold]

    30 janvier 2016, par Kristaps Drozdovskis

    i have installed ffmpeg. But missed ffprobe. Is it posible to install only ffprobe? I have looked all around.. but can't find a answer.