[FFmpeg-devel] trying to pass a command to an input filter

JULIAN GARDNER joolzg at btinternet.com
Tue Sep 10 16:00:24 CEST 2013





----- Original Message -----
> From: Michael Niedermayer <michaelni at gmx.at>
> To: FFmpeg development discussions and patches <ffmpeg-devel at ffmpeg.org>
> Cc: 
> Sent: Tuesday, 10 September 2013, 15:01
> Subject: Re: [FFmpeg-devel] trying to pass a command to an input filter
> 
> On Tue, Sep 10, 2013 at 12:04:54PM +0200, Stefano Sabatini wrote:
>>  On date Monday 2013-09-09 18:03:15 +0100, JULIAN GARDNER encoded:
>>  > My command line is 
>>  > 
>>  > ffmpeg -f lavfi -i color=s=720x576:c=green -c:v libx264 -b:v 1500k -y 
> -f mpegts test.ts
>>  > 
>>  > Im having a play around with the 'c' command line way of 
> passing commands to filters and I cannot work out something.
>>  > 
>>  > in vsrc_testsrc.c the "color" command has a .process_command 
> setup in its structure, but when i press 'c' and then
>>  > 
>>  > all -1 color black
>>  > 
>>  > The command does not get to the vsrc_testsrc, now debugging this it 
> looks like the commands are not passed to the 
> vsrc_testsrc.c:color_process_command as it is not in the filtergraphs.
>>  > 
>> 
>>  > So my question is how do i get this working, or is it not possible to 
> pass commands to input sources
>> 
>>  Last time I tried I used the sendcmd and zmq filters. Don't know if
>>  the (undocumented) ffmpeg command is still working.
> 
> it is working
> 
> and is documented if you press '?' from ffmpeg
> where else would the documentation fit ? / where should i add more docs
> ?
> 

OK Added some debug

command line and output, with some notes
encoder at encoder:~/ffmpeg$ ./ffmpeg -f lavfi -re -i color=s=720x576:c=green -c:v libx264 -b:v 1500k -y -f mpegts a.ts
ffmpeg version N-56048-g8e2aece Copyright (c) 2000-2013 the FFmpeg developers
  built on Sep  5 2013 14:48:14 with gcc 4.6.1 (Ubuntu/Linaro 4.6.1-9ubuntu3)
  configuration: --enable-gpl --enable-version3 --enable-nonfree --enable-postproc --enable-libfaac --enable-libmp3lame --enable-libx264 --enable-libzvbi
  libavutil      52. 43.100 / 52. 43.100
  libavcodec     55. 31.101 / 55. 31.101
  libavformat    55. 16.101 / 55. 16.101
  libavdevice    55.  3.100 / 55.  3.100
  libavfilter     3. 83.102 /  3. 83.102
  libswscale      2.  5.100 /  2.  5.100
  libswresample   0. 17.103 /  0. 17.103
  libpostproc    52.  3.100 / 52.  3.100
Input #0, lavfi, from 'color=s=720x576:c=green':
  Duration: N/A, start: 0.000000, bitrate: N/A
    Stream #0:0: Video: rawvideo (I420 / 0x30323449), yuv420p, 720x576 [SAR 1:1 DAR 5:4], 25 tbr, 25 tbn, 25 tbc
[libx264 @ 0x2587d80] using SAR=1/1
[libx264 @ 0x2587d80] using cpu capabilities: MMX2 SSE2Fast SSSE3 SSE4.2
[libx264 @ 0x2587d80] profile High, level 3.0
Output #0, mpegts, to 'a.ts':
  Metadata:
    encoder         : Lavf55.16.101
    Stream #0:0: Video: h264 (libx264), yuv420p, 720x576 [SAR 1:1 DAR 5:4], q=-1--1, 1500 kb/s, 90k tbn, 25 tbc
Stream mapping:
  Stream #0:0 -> #0:0 (rawvideo -> libx264)
Press [q] to stop, [?] for help
frame=   65 fps= 26 q=21.0 size=       3kB time=00:00:00.28 bitrate=  85.9kbits/s    
PRESSED 'c' here and entered 'all -1 color black'
Enter command: <target> <time> <command>[ <argument>]
MYDEBUG Send color black to all
    Last message repeated 1 times
MYDEBUG color to Parsed_null_0
MYDEBUG color to graph 0 input from stream 0:0
MYDEBUG color to output stream 0:0
MYDEBUG color to format
MYDEBUG color to Parsed_null_0
MYDEBUG color to graph 0 input from stream 0:0
MYDEBUG color to output stream 0:0
MYDEBUG color to format
Command reply for stream 0: ret:-38 res:            ******** FAILED TO PROCESS COMMAND
frame=  249 fps= 25 q=-1.0 Lsize=      49kB time=00:00:09.88 bitrate=  40.9kbits/s    
video:7kB audio:0kB subtitle:0 global headers:0kB muxing overhead 560.295078%
[libx264 @ 0x2587d80] frame I:1     Avg QP: 7.00  size:   878
[libx264 @ 0x2587d80] frame P:62    Avg QP: 0.39  size:    33
[libx264 @ 0x2587d80] frame B:186   Avg QP: 0.78  size:    26
[libx264 @ 0x2587d80] consecutive B-frames:  0.4%  0.0%  0.0% 99.6%
[libx264 @ 0x2587d80] mb I  I16..4: 100.0%  0.0%  0.0%
[libx264 @ 0x2587d80] mb P  I16..4:  0.0%  0.0%  0.0%  P16..4:  0.0%  0.0%  0.0%  0.0%  0.0%    skip:100.0%
[libx264 @ 0x2587d80] mb B  I16..4:  0.0%  0.0%  0.0%  B16..8:  0.0%  0.0%  0.0%  direct: 0.0%  skip:100.0%


More information about the ffmpeg-devel mailing list