[FFmpeg-user] piped ffmpeg output to movie filter with preserved alpha channel

Alex Vasilenko aa.vasilenko at gmail.com
Mon Mar 25 20:09:16 CET 2013


Hello, 

Trying to add another watermark to the beginning of the video. This time trying to pipe faded out watermark to another ffmpeg instance. Got following command and output:

ffmpeg -loop 1 -i watermark2.jpg -t 5 -c qtrle -vf 'fade=out:123:1:alpha=1 ' -f mpegts -pix_fmt argb - | 
ffmpeg -y -i video.mov \
-af 'aresample=async=1:min_hard_comp=0.100000' \
-vf 'scale=480:trunc(ow/a/2)*2,transpose=1 [in]; movie=watermark.png,scale=320:40 [bg];[in][bg] overlay=x=20:y=main_h-60,drawtext=fontsize=13:fix_bounds=1:fontfile=Helvetica\\:Style=bold:fontcolor=0xe6b300:text=small kitten:x=30:y=h-60+ascent/2:draw=gte(t\,0)\;lt(t\,5),drawtext=fontsize=11:fix_bounds=1:fontfile=Helvetica\\:Style=bold:fontcolor=0xCCCCCC:text=Alex:x=52:y=h-47+ascent/2:draw=gte(t\,0)\;lt(t\,5) [out];movie=pipe\\:0:format_name=mpegts, scale=20:20 [avatar];[out][avatar] overlay=x=30:y=main_h-44 [out]' -pix_fmt yuv420p -r 24.39 -map_metadata -1 -movflags +faststart -f mp4 -vcodec libx264 -b:v 800k -maxrate 1100k -bufsize 2M -bt 256k -profile:v baseline -acodec libfdk_aac -ab 64k -ar 44100 -ac 1 /tmp/kitten.mp4
ffmpeg version 1.2 Copyright (c) 2000-2013 the FFmpeg developers
  built on Mar 15 2013 18:40:14 with gcc 4.4.6 (GCC) 20120305 (Red Hat 4.4.6-4)
  configuration: --enable-gpl --enable-libmp3lame --enable-libvo-aacenc --enable-libx264 --enable-version3 --enable-pthreads --enable-libfaac --enable-nonfree --enable-libfdk_a
ac --enable-fontconfig --enable-libfreetype
  libavutil      52. 18.100 / 52. 18.100
  libavcodec     54. 92.100 / 54. 92.100
  libavformat    54. 63.104 / 54. 63.104
  libavdevice    54.  3.103 / 54.  3.103
  libavfilter     3. 42.103 /  3. 42.103
  libswscale      2.  2.100 /  2.  2.100
  libswresample   0. 17.102 /  0. 17.102
  libpostproc    52.  2.100 / 52.  2.100
ffmpeg version 1.2 Copyright (c) 2000-2013 the FFmpeg developers
  built on Mar 15 2013 18:40:14 with gcc 4.4.6 (GCC) 20120305 (Red Hat 4.4.6-4)
  configuration: --enable-gpl --enable-libmp3lame --enable-libvo-aacenc --enable-libx264 --enable-version3 --enable-pthreads --enable-libfaac --enable-nonfree --enable-libfdk_a
ac --enable-fontconfig --enable-libfreetype
  libavutil      52. 18.100 / 52. 18.100
  libavcodec     54. 92.100 / 54. 92.100
  libavformat    54. 63.104 / 54. 63.104
  libavdevice    54.  3.103 / 54.  3.103
  libavfilter     3. 42.103 /  3. 42.103
  libswscale      2.  2.100 /  2.  2.100
  libswresample   0. 17.102 /  0. 17.102
  libpostproc    52.  2.100 / 52.  2.100
[image2 @ 0x332c100] max_analyze_duration 5000000 reached at 5000000 microseconds
Input #0, image2, from 'watermark2.jpg':
  Duration: 00:00:00.04, start: 0.000000, bitrate: N/A
    Stream #0:0: Video: mjpeg, yuvj420p, 160x160 [SAR 72:72 DAR 1:1], 25 fps, 25 tbr, 25 tbn, 25 tbc
[swscaler @ 0x331d600] No accelerated colorspace conversion found from yuv420p to argb.
[swscaler @ 0x3316040] No accelerated colorspace conversion found from yuv420p to argb.
[swscaler @ 0x33365a0] No accelerated colorspace conversion found from yuv420p to argb.
Output #0, mpegts, to 'pipe:':
  Metadata:
    encoder         : Lavf54.63.104
    Stream #0:0: Video: qtrle, argb, 160x160 [SAR 1:1 DAR 1:1], q=2-31, 200 kb/s, 90k tbn, 25 tbc
Stream mapping:
  Stream #0:0 -> #0:0 (mjpeg -> qtrle)
Press [q] to stop, [?] for help
Input #0, mov,mp4,m4a,3gp,3g2,mj2, from 'video.mov':
  Metadata:
    major_brand     : qt
    minor_version   : 0
    compatible_brands: qt
    creation_time   : 2012-07-17 07:42:35
    model           : iPhone 3GS
    model-rus       : iPhone 3GS
    encoder         : 4.2.1
    encoder-rus     : 4.2.1
    date            : 2012-07-17T10:42:35+0300
    date-rus        : 2012-07-17T10:42:35+0300
    make            : Apple
    make-rus        : Apple
  Duration: 00:00:09.38, start: 0.000000, bitrate: 790 kb/s
    Stream #0:0(und): Video: h264 (Baseline) (avc1 / 0x31637661), yuv420p, 480x360, 720 kb/s, 29.97 fps, 29.97 tbr, 600 tbn, 1200 tbc
    Metadata:
      rotate          : 90
      creation_time   : 2012-07-17 07:42:35
      handler_name    : Core Media Data Handler
    Stream #0:1(und): Audio: aac (mp4a / 0x6134706D), 44100 Hz, mono, fltp, 63 kb/s
    Metadata:
      creation_time   : 2012-07-17 07:42:35
      handler_name    : Core Media Data Handler
[Parsed_drawtext_5 @ 0x21052c0] Using "/usr/share/fonts/default/Type1/n019003l.pfb"
[Parsed_drawtext_6 @ 0x20249e0] Using "/usr/share/fonts/default/Type1/n019003l.pfb"
frame=  125 fps=0.0 q=0.0 Lsize=    1208kB time=00:00:05.00 bitrate=1979.0kbits/s
video:1096kB audio:0kB subtitle:0 global headers:0kB muxing overhead 10.158016%
[mpegts @ 0x20240a0] probed stream 0 failed
[mpegts @ 0x20240a0] Could not find codec parameters for stream 0 (Unknown: none ([6][0][0][0] / 0x0006)): unknown codec
Consider increasing the value for the 'analyzeduration' and 'probesize' options
[mpegts @ 0x20240a0] Estimating duration from bitrate, this may be inaccurate
[Parsed_movie_7 @ 0x21153c0] Failed to find stream info
[Parsed_movie_7 @ 0x21153c0] No video stream with index '-1' found
[AVFilterGraph @ 0x20569c0] Error initializing filter 'movie' with args 'pipe\:0:format_name=mpegts'
Error opening filters!

The only format that gave me at least any output was yuv4mpegpipe but it forces yuv420p pixel format for output that loses alpha (btw why yuva420p is not supported for piping?)

So my question is: what combination of codec/format can be used to safely pipe into another ffmpeg command?

Thanks in advance,
-- 
Alex Vasilenko



More information about the ffmpeg-user mailing list