[FFmpeg-user] Stream a video with a watermark or image over it

Andrew Ramberg andyr at paulbunyan.net
Tue Dec 11 21:53:51 CET 2012



On 12/11/2012 01:45 PM, dj_def at webmail.it wrote:
>
> I want to stream a video with an image over it and I'm using this
> command:
>
> ffmpeg -i video.mp4 -i image.png -filter_complex
> "overlay=(main_w-overlay_w)/2:(main_h-overlay_h)/2"
> http://localhost:9090/feed0.ffm
>
> It works if I set a file output. How could I do this thing?
>
> I let you see a typical output that I get when trying to stream the
> video with the image applied on it.
>
>         $ ffmpeg -i
>         
> http://cdnbakmi.kaltura.com/p/243342/sp/24334200/serveFlavor/entryId/0_ntovmku5/flavorId/0_yiep8zj7/name/a.webm 
> -i image.png -filter_complex 
> "overlay=(main_w-overlay_w)/2:(main_h-overlay_h)/2" 
> http://localhost:9090/feed0.ffm
>         ffmpeg version N-47551-gda9a45b Copyright (c) 2000-2012 the
>         FFmpeg developers
>           built on Dec 11 2012 19:38:17 with gcc 4.7 (Ubuntu/Linaro
>         4.7.2-2ubuntu1)
>           configuration: --enable-gpl --enable-libmp3lame
>         --enable-libvpx --enable-libx264 --enable-version3
>         --enable-libvorbis
>           libavutil      52. 11.102 / 52. 11.102
>           libavcodec     54. 79.100 / 54. 79.100
>           libavformat    54. 47.100 / 54. 47.100
>           libavdevice    54.  3.102 / 54.  3.102
>           libavfilter     3. 25.101 /  3. 25.101
>           libswscale      2.  1.103 /  2.  1.103
>           libswresample   0. 17.102 /  0. 17.102
>           libpostproc    52.  2.100 / 52.  2.100
>         Input #0, matroska,webm, from
>         
> 'http://cdnbakmi.kaltura.com/p/243342/sp/24334200/serveFlavor/entryId/0_ntovmku5/flavorId/0_yiep8zj7/name/a.webm':
>           Duration: 00:01:41.23, start: 0.000000, bitrate: 1241 kb/s
>             Stream #0:0(eng): Video: vp8, yuv420p, 624x352, SAR 1:1 DAR
>         39:22, 23.98 fps, 23.98 tbr, 1k tbn, 1k tbc (default)
>             Stream #0:1(eng): Audio: vorbis, 48000 Hz, stereo, fltp
>         (default)
>         Input #1, image2, from 'image.png':
>           Duration: 00:00:00.04, start: 0.000000, bitrate: N/A
>             Stream #1:0: Video: png, rgba, 320x240 [SAR 2835:2835 DAR
>         4:3], 25 tbr, 25 tbn, 25 tbc
>         Tue Dec 11 20:00:27 2012 127.0.0.1 - - [GET] "/feed0.ffm
>         HTTP/1.1" 200 4175
>         [libvpx @ 0x9e98fc0] v1.1.0
>         Output #0, ffm, to 'http://localhost:9090/feed0.ffm':
>           Metadata:
>             creation_time   : now
>             encoder         : Lavf54.47.100
>             Stream #0:0(eng): Video: mpeg1video, yuv420p, 624x352 [SAR
>         1:1 DAR 39:22], q=2-31, 200 kb/s, 1000k tbn, 23.98 tbc (default)
>             Stream #0:1(eng): Audio: vorbis, 22050 Hz, mono, fltp, 64
>         kb/s (default)
>             Stream #0:2(eng): Video: vp8, yuv420p, 256x144 [SAR 351:352
>         DAR 39:22], q=2-31, 400 kb/s, 1000k tbn, 23.98 tbcTue Dec 11
>         20:00:27 2012 Feed '/tmp/feed0.ffm' stream number does not match
>         registered feed
>          (default)
>         Tue Dec 11 20:00:27 2012 127.0.0.1 - - [POST] "/feed0.ffm
>         HTTP/1.1" 200 4096
>         Stream mapping:
>           Stream #0:0 (vp8) -> overlay:main (graph 0)
>           Stream #1:0 (png) -> overlay:overlay (graph 0)
>           overlay (graph 0) -> Stream #0:0 (mpeg1video)
>           Stream #0:1 -> #0:1 (vorbis -> libvorbis)
>           Stream #0:0 -> #0:2 (vp8 -> libvpx)
>         Press [q] to stop, [?] for help
>         [libvorbis @ 0x9e988c0] Que input is backward in time
>             Last message repeated 1 times
>         [ffm @ 0x9e69f80] st:0 PTS: 223401 DTS: 223401 < 224355 invalid,
>         clipping
>         [libvorbis @ 0x9e988c0] Que input is backward in time
>             Last message repeated 5 times
>         av_interleaved_write_frame(): Connection reset by peer
>
>
>
> This is my ffserver.conf file:
>
> Port 9090
> BindAddress 0.0.0.0
> MaxHTTPConnections 2000
> MaxClients 1000
> MaxBandwidth 10000
> CustomLog -
> NoDaemon
>
> <Feed feed0.ffm>
> File /tmp/feed0.ffm
> FileMaxSize 100M
> ACL allow 127.0.0.1
> </Feed>
>
> <Stream video.webm>
> Feed feed0.ffm
> Format webm
> AudioCodec vorbis
> AudioBitRate 64
> VideoCodec libvpx
> VideoSize 256x144
> VideoFrameRate 25
> AVOptionVideo flags +global_header
> AVOptionAudio flags +global_header
> PreRoll 15
> StartSendOnKey
> VideoBitRate 400
> </Stream>
>
> <Stream stat.html>
> Format status
>
> # Only allow local people to get the status
> ACL allow localhost
> ACL allow 192.168.1.0 192.168.255.255
>
> #FaviconURL http://pond1.gladstonefamily.net:8080/favicon.ico
> </Stream>
>
> # Redirect index.html to the appropriate site
>
> <Redirect index.html>
> URL http://www.ffmpeg.org/
> </Redirect>
> _______________________________________________
> ffmpeg-user mailing list
> ffmpeg-user at ffmpeg.org
> http://ffmpeg.org/mailman/listinfo/ffmpeg-user
>
>

This is a known issue.  http://ffmpeg.org/trac/ffmpeg/ticket/1930 &  
http://ffmpeg.org/trac/ffmpeg/ticket/1970

I'd love to see this fixed as well!











More information about the ffmpeg-user mailing list