Re: [FFmpeg-devel] Filters
On Sun, Aug 24, 2014 at 12:06:46AM +0100, JULIAN GARDNER wrote: [...] I tried your suggestion of splitting the -map [vid[0:a] into -map [vid] -map [0:a] and I get the following error message Output with label '0:a' does not exist in any defined filter graph, or is already used elsewhere. -mao 0:a [...] -- Clément B. pgpVJ9srhkOPj.pgp Description: PGP signature ___ ffmpeg-devel mailing list ffmpeg-devel@ffmpeg.org http://ffmpeg.org/mailman/listinfo/ffmpeg-devel
Re: [FFmpeg-devel] Filters
From: JULIAN GARDNER joo...@btinternet.com To: FFmpeg development discussions and patches ffmpeg-devel@ffmpeg.org Sent: Monday, 18 August 2014, 19:51 Subject: Re: [FFmpeg-devel] Filters From: Clément Bœsch u...@pkh.me To: FFmpeg development discussions and patches ffmpeg-devel@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 .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=1316buffer_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=1316buffer_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=1316buffer_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=1316buffer_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=1316buffer_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 I tried your suggestion of splitting the -map [vid[0:a] into -map [vid] -map [0:a] and I get the following error message Output with label '0:a' does not exist in any defined filter graph, or is already used elsewhere. I managed to get around this by using -map [vid] -map a:0x42, but why does the split one fail. joolz ___ ffmpeg-devel mailing list ffmpeg-devel@ffmpeg.org http://ffmpeg.org/mailman/listinfo/ffmpeg-devel
Re: [FFmpeg-devel] Filters
On Mon, Aug 18, 2014 at 06:51:41PM +0100, JULIAN GARDNER wrote: [...] 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=1316buffer_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=1316buffer_size=1048576 Please suggest improvements in the documentation if this is not obvious, but -map [vid][0:a] is not valid. Try -map [vid] -map [0:a]. [...] -- Clément B. pgp6ap5AXktCd.pgp Description: PGP signature ___ ffmpeg-devel mailing list ffmpeg-devel@ffmpeg.org http://ffmpeg.org/mailman/listinfo/ffmpeg-devel
Re: [FFmpeg-devel] Filters
On Fri, Jul 18, 2014 at 10:33:40PM +0100, JULIAN GARDNER wrote: [...] fmpeg -i .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. pgpPGqhWr9L1q.pgp Description: PGP signature ___ ffmpeg-devel mailing list ffmpeg-devel@ffmpeg.org http://ffmpeg.org/mailman/listinfo/ffmpeg-devel
Re: [FFmpeg-devel] Filters
On Fri, Jul 18, 2014 at 12:56:17PM +0100, JULIAN GARDNER wrote: From: Clément Bœsch u...@pkh.me To: FFmpeg development discussions and patches ffmpeg-devel@ffmpeg.org Sent: Friday, 18 July 2014, 13:38 Subject: Re: [FFmpeg-devel] Filters On Fri, Jul 18, 2014 at 12:08:41PM +0100, JULIAN GARDNER wrote: How do I fix a filter so that it takes in 1 input but has no output, this is part of a project and this part is a detection filter, it does nothing else. The problem at the moment is that with the current filter, based on drawbox, is that it produces an output which i need to the use overlay to dump. Is there a video filter which has 1 input but 0 outputs Just make a passthrough filtering (ff_filter_frame(in)), and do not map its output Can you elaborate a bit more as I have this code as my base code static int filter_frame(AVFilterLink *inlink, AVFrame *frame) { DrawBoxContext *s = inlink-dst-priv; int plane, x, y, xb = s-x, yb = s-y; unsigned char *row[4]; // Detect Stationary Object // Here I would like to dump the frame as it is no longer needed return ff_filter_frame(inlink-dst-outputs[0], frame); } You do exactly that and that's all. Then ffmpeg -i foo -vf bar -f null - There are a lot of detection only filters. volumedetect, signalstats, blackdetect, ... just copy their behaviour [...] -- Clément B. pgp5e6OydcHI4.pgp Description: PGP signature ___ ffmpeg-devel mailing list ffmpeg-devel@ffmpeg.org http://ffmpeg.org/mailman/listinfo/ffmpeg-devel
Re: [FFmpeg-devel] Filters
- Original Message - From: Clément Bœsch u...@pkh.me To: FFmpeg development discussions and patches ffmpeg-devel@ffmpeg.org Cc: Sent: Friday, 18 July 2014, 14:01 Subject: Re: [FFmpeg-devel] Filters On Fri, Jul 18, 2014 at 12:56:17PM +0100, JULIAN GARDNER wrote: From: Clément Bœsch u...@pkh.me To: FFmpeg development discussions and patches ffmpeg-devel@ffmpeg.org Sent: Friday, 18 July 2014, 13:38 Subject: Re: [FFmpeg-devel] Filters On Fri, Jul 18, 2014 at 12:08:41PM +0100, JULIAN GARDNER wrote: How do I fix a filter so that it takes in 1 input but has no output, this is part of a project and this part is a detection filter, it does nothing else. The problem at the moment is that with the current filter, based on drawbox, is that it produces an output which i need to the use overlay to dump. Is there a video filter which has 1 input but 0 outputs Just make a passthrough filtering (ff_filter_frame(in)), and do not map its output Can you elaborate a bit more as I have this code as my base code static int filter_frame(AVFilterLink *inlink, AVFrame *frame) { DrawBoxContext *s = inlink-dst-priv; int plane, x, y, xb = s-x, yb = s-y; unsigned char *row[4]; // Detect Stationary Object // Here I would like to dump the frame as it is no longer needed return ff_filter_frame(inlink-dst-outputs[0], frame); } You do exactly that and that's all. Then ffmpeg -i foo -vf bar -f null - There are a lot of detection only filters. volumedetect, signalstats, blackdetect, ... just copy their behaviour Yes but this is my problem, an example command line I need at the moment fmpeg -i .ts -vcodec libx264 -b:v 1000k -acodec libfaac -async 1 -vf 'split [mark], detection [dontneed];delay=5, markregion [vid];[dontneed][vid] overlay' -y -f mpegts processed.ts What I would like fmpeg -i .ts -vcodec libx264 -b:v 1000k -acodec libfaac -async 1 -vf 'split [mark], detection; delay=5, markregion' -y -f mpegts processed.ts I am working on the delay filter at the moment, as i need 5 frames to detect the block, but i need to mark all frames, including the 4 previous frames. I am trying to get rid of the overlay as the input source could be HD. joolz ___ ffmpeg-devel mailing list ffmpeg-devel@ffmpeg.org http://ffmpeg.org/mailman/listinfo/ffmpeg-devel
Re: [FFmpeg-devel] Filters
On Fri, Jul 18, 2014 at 01:14:25PM +0100, JULIAN GARDNER wrote: [...] You do exactly that and that's all. Then ffmpeg -i foo -vf bar -f null - There are a lot of detection only filters. volumedetect, signalstats, blackdetect, ... just copy their behaviour Yes but this is my problem, an example command line I need at the moment fmpeg -i .ts -vcodec libx264 -b:v 1000k -acodec libfaac -async 1 -vf 'split [mark], detection [dontneed];delay=5, markregion [vid];[dontneed][vid] overlay' -y -f mpegts processed.ts What I would like fmpeg -i .ts -vcodec libx264 -b:v 1000k -acodec libfaac -async 1 -vf 'split [mark], detection; delay=5, markregion' -y -f mpegts processed.ts Use -filter_complex and map only the output of markregion. Or maybe just explicit [out0] after markregion with your -vf version, that might work, I don't remember the details, but since I'm missing detection, delay and markregion filter I have no idea how to test. [...] -- Clément B. pgpltFZdDgJ72.pgp Description: PGP signature ___ ffmpeg-devel mailing list ffmpeg-devel@ffmpeg.org http://ffmpeg.org/mailman/listinfo/ffmpeg-devel