[FFmpeg-devel] Filters

JULIAN GARDNER joolzg at btinternet.com
Mon Aug 18 19:51:41 CEST 2014


>________________________________
> From: Clément Bœsch <u at pkh.me>
>To: FFmpeg development discussions and patches <ffmpeg-devel at ffmpeg.org> 
>Sent: Sunday, 20 July 2014, 10:40
>Subject: Re: [FFmpeg-devel] Filters
> 
>
>On Fri, Jul 18, 2014 at 10:33:40PM +0100, JULIAN GARDNER wrote:
>[...]
>> fmpeg -i xxxx.ts -vcodec libx264 -b:v 1000k -acodec libfaac -async 1 -vf 'split [mark], drawbox=10:10:100:100:color=green [dontneed];[mark] drawbox=100:100:100;100:color=red [vid];[dontneed][vid] overlay' -y -f mpegts processed.ts
>> 
>
>try -filter_complex instead of -vf and
>-map [vid] -y -f mpegts processed.ts -map '[dontneed]' -f null -
>
>[...]
>
>-- 
>Clément B.
>

Thanks for this, its 99% what i need apart from I lose the audio on the [vid] output. I want the small picture [160x100] output without audio and the 640x360 output with audio


Commandlineffmpeg -threads 0 -i "udp://231.231.11.3:1234?localaddr=192.168.2.123" -filter_complex 'scale=iw/2:ih/2,split [mark], scale=160:90,drawbox=10:10:5:5:color=red [detect];[mark] drawbox=10:10:10:5:5:color=blue [vid]' -map [detect] -vcodec libx264 -preset faster -x264opts keyint=75 -x264opts bitrate=512 -bufsize 1M -r 25 -an -f mpegts "udp://238.170.112.96:1234?pkt_size=1316&buffer_size=1048576" -map [vid][0:a] -vcodec libx264 -preset faster -x264opts keyint=75 -x264opts bitrate=1150 -bufsize 1M -r 25 -acodec libfaac -ab 128k -ar 32k -ac 2 -f mpegts "udp://225.170.112.96:1234?pkt_size=1316&buffer_size=1048576"


Output (as I know you love this)ffmpeg version N-63057-g63504d8 Copyright (c) 2000-2014 the FFmpeg developers
  built on Aug 14 2014 10:36:36 with gcc 4.6 (Ubuntu/Linaro 4.6.4-1ubuntu1~12.04)
  configuration: --enable-gpl --enable-version3 --enable-nonfree --enable-postproc --enable-libfaac --enable-libmp3lame --enable-libx264 --enable-libzvbi --cc='ccache cc'
  libavutil      52. 82.100 / 52. 82.100
  libavcodec     55. 60.103 / 55. 60.103
  libavformat    55. 37.102 / 55. 37.102
  libavdevice    55. 13.101 / 55. 13.101
  libavfilter     4.  5.100 /  4.  5.100
  libswscale      2.  6.100 /  2.  6.100
  libswresample   0. 18.100 /  0. 18.100
  libpostproc    52.  3.100 / 52.  3.100
Input #0, mpegts, from 'udp://231.231.11.3:1234?localaddr=192.168.2.123':
  Duration: N/A, start: 12191.492622, bitrate: 128 kb/s
  Program 48
    Stream #0:0[0x41]: Video: h264 (High) ([27][0][0][0] / 0x001B), yuv420p, 1280x720 [SAR 1:1 DAR 16:9], 50 fps, 50 tbr, 90k tbn, 100 tbc
    Stream #0:1[0x42]: Audio: mp2 ([4][0][0][0] / 0x0004), 48000 Hz, stereo, s16p, 128 kb/s
Codec AVOption ab (set bitrate (in bits/s)) specified for output file #1 (udp://225.170.112.96:1234?pkt_size=1316&buffer_size=1048576) has not been used for any stream. The most likely reason is either wrong type (e.g. a video option with no video streams) or that it is a private option of some encoder which was not actually used for any stream.
[libx264 @ 0x2d72560] VBV maxrate unspecified, assuming CBR
[libx264 @ 0x2d72560] using SAR=1/1
[libx264 @ 0x2d72560] using cpu capabilities: MMX2 SSE2Fast SSSE3 SSE4.2
[libx264 @ 0x2d72560] profile High, level 1.3
[libx264 @ 0x2d74d60] VBV maxrate unspecified, assuming CBR
[libx264 @ 0x2d74d60] using SAR=1/1
[libx264 @ 0x2d74d60] using cpu capabilities: MMX2 SSE2Fast SSSE3 SSE4.2
[libx264 @ 0x2d74d60] profile High, level 3.0
Output #0, mpegts, to 'udp://238.170.112.96:1234?pkt_size=1316&buffer_size=1048576':
  Metadata:
    encoder         : Lavf55.37.102
    Stream #0:0: Video: h264 (libx264), yuv420p, 160x90 [SAR 1:1 DAR 16:9], q=-1--1, 512 kb/s, 90k tbn, 25 tbc
Output #1, mpegts, to 'udp://225.170.112.96:1234?pkt_size=1316&buffer_size=1048576':
  Metadata:
    encoder         : Lavf55.37.102
    Stream #1:0: Video: h264 (libx264), yuv420p, 640x360 [SAR 1:1 DAR 16:9], q=-1--1, 1150 kb/s, 90k tbn, 25 tbc
Stream mapping:
  Stream #0:0 (h264) -> scale
  drawbox -> Stream #0:0 (libx264)
  drawbox -> Stream #1:0 (libx264)
Press [q] to stop, [?] for help
[mpegts @ 0x2d40fc0] New 0011 Table, version 255 to 0
frame=  130 fps= 26 q=-1.0 Lq=-1.0 size=     245kB time=00:00:05.12 bitrate= 392.2kbits/s dup=24 drop=224

any idea on how i can get the audio back

joolz


More information about the ffmpeg-devel mailing list