Newest 'ffmpeg' Questions - Stack Overflow

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

Les articles publiés sur le site

  • AAC decoding with ffmpeg

    22 novembre 2011, par Ali

    I am trying to decode mms:// audio stream with ffmpeg. I am able to get stream using libmms and now using ffmpeg to decode frames. The problem is when i try to open codec using

    codec = avcodec_find_decoder(CODEC_ID_AAC);
    c= avcodec_alloc_context();
    avcodec_open(c, codec);
    

    FFmpeg library gives error :channel element 1.8 is not allocated and when i try to decode len = avcodec_decode_audio3(c, (short *)outbuf, &out_size,&avpkt); it does not decode, resulting len=-1

    Any idea?

  • VLC/FFMPEG streaming, how to detect ?

    22 novembre 2011, par John Smith

    I want something like that: user(s) decide to start a stream to my site. I know VLC and FFMPEG is able to do that. But how could a site detect that it's getting stream(s)? Because I want it to then display on a page "current live videos". And what kind of streams should I need to use? HTTP? RTSP? UPD?

    Thanx in advance.

  • Cross Platform C# Media API

    22 novembre 2011, par maxfridbe

    I'm trying to define a VideoFile in mono/.net object such that I can call

    var file = new VideoFile(filepath);
    file.VideoDuration 
    

    Is there a library (os or commercial) which will work across platforms mono/.net which can provide information such as VideoDuration. The only though I have had on this currently is to wrap ffmpeg.exe and read the console out-stream.

  • FFmpeg can 'encode' to mp3, but will not accept an 'input' mp3

    21 novembre 2011, par Jonathan Coe

    FYI: Fedora 8 running on Amazon EC2...

    Having a difficult time with FFmpeg doing a (what should be pretty simple) conversion. I can get FFmpeg to encode an mp3 file from an m4a file using the following:

    ffmpeg -i file1.m4a -acodec libmp3lame -ab 160k file2.mp3
    

    However, I cannot get it to to convert an mp3 -> mp3, it responds with "Unknown Format" using the following:

    ffmpeg -i file1.mp3 -acodec libmp3lame -ab 160k file2.mp3
    

    I get the following command string:

    FFmpeg version UNKNOWN, Copyright (c) 2000-2008 Fabrice Bellard, et al.
    
    
    configuration: --prefix=/usr --libdir=/usr/lib --shlibdir=/usr/lib --mandir=/usr/share/man --incdir=/usr/include/ffmpeg --enable-libmp3lame --enable-libvorbis --enable-libtheora --enable-libfaad --enable-libfaac --enable-libgsm --enable-libxvid --enable-libx264 --enable-liba52 --enable-liba52bin --enable-pp --enable-shared --enable-pthreads --enable-gpl --disable-strip
      libavutil version: 49.6.0
      libavcodec version: 51.50.1
      libavformat version: 52.7.0
      libavdevice version: 52.0.0
      built on Feb 14 2008 17:47:08, gcc: 4.1.2 20070925 (Red Hat 4.1.2-33)
    file1.mp3: Unknown format
    

    Any help would be hugely appreciated!

    Edit for clarity: The input file is in /ebs/queue/input.mp3 and the output is /ebs/converted/output.mp3

  • ffmpeg : images to 29.97fps mpeg2, audio not sync [migrated]

    21 novembre 2011, par Andy Le

    I have spent a lot of time on this issue. Hope someone can help.

    I want to convert 3147 images + ac3 audio file into an mpeg2 video at 29.97fps (about 1m45s). My command:

    ~/ffmpeg/ffmpeg/ffmpeg -loop_input -t 105 -i v%4d.tga -i final.ac3 -vcodec mpeg2video -qscale 1 -s 400x400 -r 30000/1001 -acodec copy -y out.mpeg 2> out.txt
    

    However, the audio file ends before the frame sequence. Which means the video is slower then audio.

    I checked the output file with imageinfo and see:

    General
    Complete name                    : out.mpeg
    Format                           : MPEG-PS
    File size                        : 7.18 MiB
    Duration                         : 1mn 44s
    Overall bit rate                 : 574 Kbps
    
    Video
    ID                               : 224 (0xE0)
    Format                           : MPEG Video
    Format version                   : Version 2
    Format profile                   : Main@Main
    Format settings, BVOP            : No
    Format settings, Matrix          : Default
    Format_Settings_GOP              : M=1, N=12
    Duration                         : 1mn 44s
    Bit rate mode                    : Variable
    Bit rate                         : 103 Kbps
    Width                            : 400 pixels
    Height                           : 400 pixels
    Display aspect ratio             : 1.000
    Frame rate                       : 29.970 fps
    Resolution                       : 8 bits
    Colorimetry                      : 4:2:0
    Scan type                        : Progressive
    Bits/(Pixel*Frame)               : 0.021
    Stream size                      : 1.29 MiB (18%)
    
    Audio
    ID                               : 128 (0x80)
    Format                           : AC-3
    Format/Info                      : Audio Coding 3
    Duration                         : 1mn 44s
    Bit rate mode                    : Constant
    Bit rate                         : 448 Kbps
    Channel(s)                       : 6 channels
    Channel positions                : Front: L C R, Side: L R, LFE
    Sampling rate                    : 44.1 KHz
    Stream size                      : 5.61 MiB (78%)
    

    The log from ffmpeg shows many duplicate frames. But I don't know how to get rid of that.

    -loop_input is deprecated, use -loop 1
    [image2 @ 0x9c17a80] max_analyze_duration 5000000 reached at 5000000
    Input #0, image2, from 'v%4d.tga':
      Duration: 00:02:05.88, start: 0.000000, bitrate: N/A
        Stream #0:0: Video: targa, bgr24, 400x400, 25 fps, 25 tbr, 25 tbn, 25 tbc
    -loop_input is deprecated, use -loop 1
    [ac3 @ 0x9ca5420] max_analyze_duration 5000000 reached at 5014400
    [ac3 @ 0x9ca5420] Estimating duration from bitrate, this may be inaccurate
    Input #1, ac3, from 'Final.ac3':
      Duration: 00:20:10.68, start: 0.000000, bitrate: 447 kb/s
        Stream #1:0: Audio: ac3, 44100 Hz, 5.1(side), s16, 448 kb/s
    Incompatible pixel format 'bgr24' for codec 'mpeg2video', auto-selecting format 'yuv420p'
    [buffer @ 0x9c1e060] w:400 h:400 pixfmt:bgr24 tb:1/1000000 sar:0/1 sws_param:
    [buffersink @ 0x9dd56c0] auto-inserting filter 'auto-inserted scale 0' between the filter 'src' and the filter 'out'
    [scale @ 0x9c178e0] w:400 h:400 fmt:bgr24 -> w:400 h:400 fmt:yuv420p flags:0x4
    [mpeg @ 0x9d58060] VBV buffer size not set, muxing may fail
    Output #0, mpeg, to 'out.mpeg':
      Metadata:
        encoder         : Lavf53.21.0
        Stream #0:0: Video: mpeg2video, yuv420p, 400x400, q=2-31, 200 kb/s, 90k tbn, 29.97 tbc
        Stream #0:1: Audio: ac3, 44100 Hz, 5.1(side), 448 kb/s
    Stream mapping:
      Stream #0:0 -> #0:0 (targa -> mpeg2video)
      Stream #1:0 -> #0:1 (copy)
    Press [q] to stop, [?] for help
    frame=  267 fps=  0 q=1.0 size=     564kB time=00:00:08.87 bitrate= 520.6kbits/s dup=43 drop=0    
    frame=  544 fps=542 q=1.0 size=    1186kB time=00:00:18.11 bitrate= 536.2kbits/s dup=89 drop=0    
    frame=  821 fps=546 q=1.0 size=    1818kB time=00:00:27.36 bitrate= 544.3kbits/s dup=135 drop=0    
    frame= 1098 fps=548 q=1.0 size=    2444kB time=00:00:36.60 bitrate= 547.0kbits/s dup=181 drop=0    
    frame= 1376 fps=549 q=1.0 size=    3072kB time=00:00:45.87 bitrate= 548.5kbits/s dup=227 drop=0    
    frame= 1653 fps=550 q=1.0 size=    3700kB time=00:00:55.12 bitrate= 549.9kbits/s dup=273 drop=0    
    frame= 1930 fps=550 q=1.0 size=    4326kB time=00:01:04.36 bitrate= 550.6kbits/s dup=319 drop=0    
    frame= 2208 fps=551 q=1.0 size=    4960kB time=00:01:13.64 bitrate= 551.8kbits/s dup=365 drop=0    
    frame= 2462 fps=546 q=1.0 size=    5746kB time=00:01:22.11 bitrate= 573.2kbits/s dup=407 drop=0    
    frame= 2728 fps=544 q=1.0 size=    6354kB time=00:01:30.99 bitrate= 572.1kbits/s dup=451 drop=0    
    frame= 3007 fps=545 q=1.0 size=    6980kB time=00:01:40.28 bitrate= 570.2kbits/s dup=498 drop=0    
    frame= 3146 fps=546 q=1.0 Lsize=    7352kB time=00:01:44.93 bitrate= 573.9kbits/s dup=521 drop=0    
    
    video:1518kB audio:5745kB global headers:0kB muxing overhead 1.230493%