Newest 'ffmpeg' Questions - Stack Overflow

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

Les articles publiés sur le site

  • Streaming audio + still image using ffmpeg

    21 juin 2017, par AEnimaH

    I'm streaming an audio source to azure media services using RTMP and a raspberry pi. This works great using this command:

    ffmpeg -f alsa -ac 1 -i hw:1,0 -c:a aac -b:a 128k -ar 44100 -f flv rtmp://...
    

    But know we want to add an image to this flv container because azure media player wants a video component.

    So I added video using this command:

    ffmpeg -loop 1 -i image.png -f alsa -ac 1 -i hw:1,0 -c:a aac -b:a 128k -ar 44100 -g 50 -pix_fmt yuv420p -f flv rtmp://...
    

    Yet it crashes with following log:

    ffmpeg version N-86429-gf8593c2 Copyright (c) 2000-2017 the FFmpeg developers
    built with gcc 4.9.2 (Raspbian 4.9.2-10)
    configuration: --prefix=/home/pi/ffmpeg/dependencies/output --enable-gpl --enable-libx264 --enable-libmp3lame --enable-nonfree --extra-cflags=-I/home/pi/ffmpeg/dependencies/output/include --extra-ldflags=-L/home/pi/ffmpeg/dependencies/output/lib --extra-libs='-lx264 -lpthread -lm -ldl'
    libavutil      55. 63.100 / 55. 63.100
    libavcodec     57. 98.100 / 57. 98.100
    libavformat    57. 73.100 / 57. 73.100
    libavdevice    57.  7.100 / 57.  7.100
    libavfilter     6. 91.100 /  6. 91.100
    libswscale      4.  7.101 /  4.  7.101
    libswresample   2.  8.100 /  2.  8.100
    libpostproc    54.  6.100 / 54.  6.100
    Input #0, png_pipe, from 'image.png':
    Duration: N/A, bitrate: N/A
        Stream #0:0: Video: png, rgba(pc), 600x400 [SAR 5669:5669 DAR 3:2], 25 fps, 25 tbr, 25 tbn, 25 tbc
    Guessed Channel Layout for Input Stream #1.0 : mono
    Input #1, alsa, from 'hw:1,0':
    Duration: N/A, start: 1497522851.947685, bitrate: 768 kb/s
        Stream #1:0: Audio: pcm_s16le, 48000 Hz, mono, s16, 768 kb/s
    Stream mapping:
    Stream #0:0 -> #0:0 (png (native) -> flv1 (flv))
    Stream #1:0 -> #0:1 (pcm_s16le (native) -> aac (native))
    Press [q] to stop, [?] for help
    [alsa @ 0x18e3330] Thread message queue blocking; consider raising the thread_queue_size option (current value: :sunglasses:
    Output #0, flv, to 'rtmp://aptus2-aptus.channel.mediaservices.windows.net:1935/live/b962f6df8d3b4e97a608981d019faaa4/default':
    Metadata:
        encoder         : Lavf57.73.100
        Stream #0:0: Video: flv1 (flv) ([2][0][0][0] / 0x0002), yuv420p(progressive), 600x400 [SAR 1:1 DAR 3:2], q=2-31, 200 kb/s, 25 fps, 1k tbn, 25 tbc
        Metadata:
        encoder         : Lavc57.98.100 flv
        Side data:
        cpb: bitrate max/min/avg: 0/0/200000 buffer size: 0 vbv_delay: -1
        Stream #0:1: Audio: aac (LC) ([10][0][0][0] / 0x000A), 44100 Hz, mono, fltp, 128 kb/s
        Metadata:
        encoder         : Lavc57.98.100 aac
    frame=    3 fps=0.0 q=2.0 size=      56kB time=00:00:00.08 bitrate=5700.0kbits/sframe=   12 fps= 12 q=2.0 size=      66kB time=00:00:00.44 bitrate=1227.2kbits/sframe=   21 fps= 14 q=2.0 size=      72kB time=00:00:00.80 bitrate= 739.8kbits/sframe=   29 fps= 14 q=2.0 size=      79kB time=00:00:01.12 bitrate= 573.9kbits/s[alsa @ 0x18e3330] ALSA buffer xrun.
    frame=   39 fps= 15 q=2.0 size=      85kB time=00:00:02.81 bitrate= 246.9kbits/sframe=   50 fps= 16 q=2.0 size=      86kB time=00:00:02.81 bitrate= 251.4kbits/sframe=   60 fps= 17 q=2.0 size=     157kB time=00:00:02.81 bitrate= 457.1kbits/sframe=   71 fps= 17 q=2.0 size=     159kB time=00:00:02.81 bitrate= 462.2kbits/s[alsa @ 0x18e3330] ALSA buffer xrun.
    frame=   81 fps= 18 q=2.0 size=     161kB time=00:00:04.57 bitrate= 289.0kbits/sframe=   92 fps= 18 q=2.0 size=     163kB time=00:00:04.57 bitrate= 291.8kbits/sframe=  103 fps= 18 q=2.0 size=     234kB time=00:00:04.57 bitrate= 418.5kbits/sframe=  114 fps= 19 q=2.0 size=     235kB time=00:00:04.57 bitrate= 421.3kbits/s[alsa @ 0x18e3330] ALSA buffer xrun.
    frame=  124 fps= 19 q=2.0 size=     238kB time=00:00:06.66 bitrate= 292.8kbits/sframe=  135 fps= 19 q=2.0 size=     240kB time=00:00:06.66 bitrate= 294.7kbits/sframe=  146 fps= 19 q=2.0 size=     241kB time=00:00:06.66 bitrate= 296.6kbits/sav_interleaved_write_frame(): Broken pipe
    [flv @ 0x18f9ea0] Failed to update header with correct duration.
    [flv @ 0x18f9ea0] Failed to update header with correct filesize.
    Error writing trailer of rtmp://aptus2-aptus.channel.mediaservices.windows.net:1935/live/b962f6df8d3b4e97a608981d019faaa4/default: Broken pipe
    frame=  151 fps= 15 q=1.6 Lsize=     306kB time=00:00:06.70 bitrate= 373.5kbits/s speed=0.644x    
    video:284kB audio:24kB subtitle:0kB other streams:0kB global headers:0kB muxing overhead: unknown
    [aac @ 0x18fe6e0] Qavg: 3428.370
    Conversion failed!
    

    what am I doing wrong? Any help would be awesome!

  • ffmpeg convert video to image sequence Want to get 20 images per second

    21 juin 2017, par Jochen

    I wanna convert a video to images sequence. video is 20s long, and other basic information are as follows:

    Duration: 00:00:20.04, start: 0.000000, bitrate: 576 kb/s
    Stream #0:0(und): Video: h264 (High) (avc1 / 0x31637661), yuv420p, 1080x720 [SAR 1:1 DAR 3:2], 796 kb/s, 30 fps, 30 tbr, 15360 tbn, 60 tbc (default)
    

    I want to get 20 images per second, I use ffmpeg -I input.mp4 -r 20 ./output/%04d.jpg,and ffmpeg -I input.mp4 -vf fps=1/20 ./output/%04d.jpg but I only got about 190 images at last. It should be 20*20=400.

    More, the default fps is 25, that means I should get 25*20=500 images? So whats the error?

  • FFMPEG output frame name issue

    20 juin 2017, par Aleksey Tarasenko

    I'm going to convert DPX sequence of files to JPG sequence.

    ffmpeg -i F:\test\my_files.%07d.dpx  F:\test2\my_files.%07d.jpg  -report
    

    DPX files starts from zero frame (example: my_files.0000000.dpx), but JPG files after ffmpeg conversion get name that starts from first frame (example: my_files.0000001.jpg).

    How to get name of JPG files start from zero frame?

  • ffmpeg - unknown keyword [duplicate]

    20 juin 2017, par Jublo

    This question already has an answer here:

    When calling ffmpeg with the following command line:

    ffmpeg -f concat
      -i "/Users/demo/mono128fixed.mp3"
      -i "/Users/demo/stereo256fixed.mp3" 
      -acodec copy "/Users/Demo/outfile 2017-06-20 20-56-23.mp3"    
    

    I'm getting the following error message:

    [concat @ 0x102800000] Line 1: unknown keyword '\377\373\220\304'
    /Users/demo/mono128fixed.mp3: Invalid data found when processing input
    

    Why would this be?

    ffmpeg config is like this:

    ffmpeg version 3.3.2 Copyright (c) 2000-2017 the FFmpeg developers
      built with Apple LLVM version 8.1.0 (clang-802.0.42)
      configuration: --prefix=/Volumes/Ramdisk/sw --enable-pthreads --enable-version3 --disable-decoder=libvpx --enable-libmp3lame --enable-avfilter --enable-libopencore_amrwb --enable-libopencore_amrnb --enable-filters --arch=x86_64 --enable-runtime-cpudetect
      libavutil      55. 58.100 / 55. 58.100
      libavcodec     57. 89.100 / 57. 89.100
      libavformat    57. 71.100 / 57. 71.100
      libavdevice    57.  6.100 / 57.  6.100
      libavfilter     6. 82.100 /  6. 82.100
      libswscale      4.  6.100 /  4.  6.100
      libswresample   2.  7.100 /  2.  7.100
    
  • AAC decoding with FFmpeg and Audio Toolbox decoder on the Mac not working

    20 juin 2017, par MrBigPixel

    I'm connecting to an mp4 RTSP stream with AAC audio. Connecting to it via command line ffmpeg and specifying "aac_at" for the decoder does playback audio correctly.

    However in my code when connecting to the same stream using avcodec_find_decoder_by_name("aac_at") the audio toolbox decoder produces white noise.

    To verify the correctness of the code by just replacing that line with avcodec_find_decoder_by_name("aac") the decoder does produce correct audio.

    Has anybody else experienced anything like this when using the ffmpeg libs and the audio toolbox AAC decoder on the Mac?