[FFmpeg-user] generating silent audio streams simultaneous with lavfi / generated video

James Heliker james.heliker at gmail.com
Wed Jul 1 21:13:43 CEST 2015


On 7/1/2015 7:32 AM, Dave P wrote:
> On Wed, Jul 1, 2015 at 2:45 AM, Carl Eugen Hoyos <cehoyos at ag.or.at> wrote:
>
>> James Heliker <james.heliker <at> gmail.com> writes:
>>
>>> C:\ffmpeg.exe -f lavfi -i color=c=black:s=1920x1080
>>> -frames:v 10
>>> -r 29.97
>> The color filter has a rate option.
>>
>>> However that results in a file with only video
>>> stream - no audio.
>> You failed to provide an input audio stream to
>> ffmpeg, I usually use:
>> ffmpeg -f s16le -i /dev/zero
>> The anullsrc filter should work fine on Windows.
>>
>> Carl Eugen
>>
>>
> Perhaps something like this could get you pretty close (I changed the
> drawtext font to suit my install):
>
> C:\ffmpeg\bin>ffmpeg.exe -f lavfi -i color=c=black:r=29.97:s=1920x1080 -f
> lavfi
> -i aevalsrc=0:s=48000 -vcodec mpeg2video -pix_fmt yuv422p -non_linear_quant
> 1 -f
> lags +ildct+ilme -top 1 -dc 10 -intra_vlc 1 -qmax 3 -lmin "1*QP2LAMBDA"
> -rc_max_
> vbv_use 1 -rc_min_vbv_use 1 -g 15 -bf 2 -r ntsc -b:v 50M -minrate 50M
> -maxrate 5
> 0M -bufsize 8M -vtag xd5c -frames:v 10 -acodec pcm_s24le -filter_complex
> "[0:v]d
> rawtext=subfont.ttf:fontcolor=white:fontsize=48:fontcolor=white:x=(w-text_w)/2:y
> =(h-text_h-line_h)/2:text='testing'[video];[1:a]asplit=8[a0][a1][a2][a3][a4][a5]
> [a6][a7]" -map "[video]" -map "[a0]" -map "[a1]" -map "[a2]" -map "[a3]"
> -map "[
> a4]" -map "[a5]" -map "[a6]" -map "[a7]" -shortest -report -y
> C:\Users\davep\des
> ktop\slate_output.mxf

Thanks Carl and Dave! Is there any benefit or drawback to using aevalsrc 
instead of anullsrc?


> ffmpeg started on 2015-07-01 at 10:29:00
> Report written to "ffmpeg-20150701-102900.log"
> ffmpeg version N-73319-g9c010ba Copyright (c) 2000-2015 the FFmpeg
> developers
>    built with gcc 4.9.2 (GCC)
>    configuration: --enable-gpl --enable-version3 --disable-w32threads
> --enable-av
> isynth --enable-bzlib --enable-fontconfig --enable-frei0r --enable-gnutls
> --enab
> le-iconv --enable-libass --enable-libbluray --enable-libbs2b
> --enable-libcaca --
> enable-libdcadec --enable-libfreetype --enable-libgme --enable-libgsm
> --enable-l
> ibilbc --enable-libmodplug --enable-libmp3lame --enable-libopencore-amrnb
> --enab
> le-libopencore-amrwb --enable-libopenjpeg --enable-libopus --enable-librtmp
> --en
> able-libschroedinger --enable-libsoxr --enable-libspeex --enable-libtheora
> --ena
> ble-libtwolame --enable-libvidstab --enable-libvo-aacenc
> --enable-libvo-amrwbenc
>   --enable-libvorbis --enable-libvpx --enable-libwavpack --enable-libwebp
> --enabl
> e-libx264 --enable-libx265 --enable-libxavs --enable-libxvid --enable-lzma
> --ena
> ble-decklink --enable-zlib
>    libavutil      54. 27.100 / 54. 27.100
>    libavcodec     56. 46.100 / 56. 46.100
>    libavformat    56. 40.100 / 56. 40.100
>    libavdevice    56.  4.100 / 56.  4.100
>    libavfilter     5. 19.100 /  5. 19.100
>    libswscale      3.  1.101 /  3.  1.101
>    libswresample   1.  2.100 /  1.  2.100
>    libpostproc    53.  3.100 / 53.  3.100
> Input #0, lavfi, from 'color=c=black:r=29.97:s=1920x1080':
>    Duration: N/A, start: 0.000000, bitrate: N/A
>      Stream #0:0: Video: rawvideo (I420 / 0x30323449), yuv420p, 1920x1080
> [SAR 1:
> 1 DAR 16:9], 29.97 tbr, 29.97 tbn, 29.97 tbc
> Input #1, lavfi, from 'aevalsrc=0:s=48000':
>    Duration: N/A, start: 0.000000, bitrate: 3072 kb/s
>      Stream #1:0: Audio: pcm_f64le, 48000 Hz, mono, dbl, 3072 kb/s
> Output #0, mxf, to 'C:\Users\davep\desktop\slate_output.mxf':
>    Metadata:
>      encoder         : Lavf56.40.100
>      Stream #0:0: Video: mpeg2video (xd5c / 0x63356478), yuv422p, 1920x1080
> [SAR
> 1:1 DAR 16:9], q=2-3, 50000 kb/s, 29.97 fps, 29.97 tbn, 29.97 tbc (default)
>      Metadata:
>        encoder         : Lavc56.46.100 mpeg2video
>      Stream #0:1: Audio: pcm_s24le, 48000 Hz, mono, s32, 1152 kb/s
>      Metadata:
>        encoder         : Lavc56.46.100 pcm_s24le
>      Stream #0:2: Audio: pcm_s24le, 48000 Hz, mono, s32, 1152 kb/s
>      Metadata:
>        encoder         : Lavc56.46.100 pcm_s24le
>      Stream #0:3: Audio: pcm_s24le, 48000 Hz, mono, s32, 1152 kb/s
>      Metadata:
>        encoder         : Lavc56.46.100 pcm_s24le
>      Stream #0:4: Audio: pcm_s24le, 48000 Hz, mono, s32, 1152 kb/s
>      Metadata:
>        encoder         : Lavc56.46.100 pcm_s24le
>      Stream #0:5: Audio: pcm_s24le, 48000 Hz, mono, s32, 1152 kb/s
>      Metadata:
>        encoder         : Lavc56.46.100 pcm_s24le
>      Stream #0:6: Audio: pcm_s24le, 48000 Hz, mono, s32, 1152 kb/s
>      Metadata:
>        encoder         : Lavc56.46.100 pcm_s24le
>      Stream #0:7: Audio: pcm_s24le, 48000 Hz, mono, s32, 1152 kb/s
>      Metadata:
>        encoder         : Lavc56.46.100 pcm_s24le
>      Stream #0:8: Audio: pcm_s24le, 48000 Hz, mono, s32, 1152 kb/s
>      Metadata:
>        encoder         : Lavc56.46.100 pcm_s24le
> Stream mapping:
>    Stream #0:0 (rawvideo) -> drawtext
>    Stream #1:0 (pcm_f64le) -> asplit
>    drawtext -> Stream #0:0 (mpeg2video)
>    asplit:output0 -> Stream #0:1 (pcm_s24le)
>    asplit:output1 -> Stream #0:2 (pcm_s24le)
>    asplit:output2 -> Stream #0:3 (pcm_s24le)
>    asplit:output3 -> Stream #0:4 (pcm_s24le)
>    asplit:output4 -> Stream #0:5 (pcm_s24le)
>    asplit:output5 -> Stream #0:6 (pcm_s24le)
>    asplit:output6 -> Stream #0:7 (pcm_s24le)
>    asplit:output7 -> Stream #0:8 (pcm_s24le)
> Press [q] to stop, [?] for help
> [mxf @ 00000000003badc0] -d10_channelcount requires MXF D-10 and will be
> ignored
>      Last message repeated 7 times
> [mxf @ 00000000003badc0] missing frames
> frame=   10 fps=0.0 q=0.0 Lsize=    1969kB time=00:00:00.30
> bitrate=53714.6kbits
> /s
> video:1792kB audio:336kB subtitle:0kB other streams:0kB global headers:0kB
> muxin
> g overhead: unknown
> _______________________________________________
> ffmpeg-user mailing list
> ffmpeg-user at ffmpeg.org
> http://ffmpeg.org/mailman/listinfo/ffmpeg-user



More information about the ffmpeg-user mailing list