How to overlay a png to piped video source with audio mixed in via ffmpeg?

Christopher Stevens

I'm successfully streaming silent video with music added from my Raspberry Pi (Raspbian) to YouTube via ffmpeg, with the help of this GitHub gist and this post:

raspivid -o - -t 0 -vf -hf -w 1280 -h 720 -fps 25 -b 4000000 | \
ffmpeg -i music.wav \
-f h264 -i - -vcodec copy -acodec aac -ab 128k -g 50 -strict experimental \
-f flv rtmp://a.rtmp.youtube.com/live2/STREAMKEY

The last step of my project to add a transparent, full width/height png overlay to the video (1280x720 size in my case). I've seen a few related answers such as this one and this one.

With the added complexity of piping in a camera feed, mixing in an audio source and outputting to a video stream, I haven't succeeded in adding the image overlay. Where/how would I add a transparent image overlay in the example above?

Gyan

The ffmpeg part will be

ffmpeg -i music.wav \
-f h264 -i - -i overlay.png
-filter_complex "[1][2]overlay"
-vcodec libx264 -preset ultrafast -tune zerolatency -acodec aac -ab 128k -g 50 -strict experimental \
-f flv rtmp://a.rtmp.youtube.com/live2/STREAMKEY

Since you're altering the video contents, copy can't be used, and the video has to be re-encoded.

Collected from the Internet

Please contact [email protected] to delete if infringement.

edited at
0

Comments

0 comments
Login to comment

Related

From Dev

How to overlay a transparent PNG over video and scale to video size in FFmpeg

From Dev

How to overlay multiple video files and merge all audio with ffmpeg?

From Dev

ffmpeg: overlay a png image on a video with custom transparency?

From Dev

FFMpeg Video Overlay with Delayed Audio and Video in Background Video

From Dev

how to combine two video and one audio via ffmpeg?

From Dev

Overlay image on video using ffmpeg with adjustable png image

From Dev

Ffmpeg - How to merge gdigrab and audio with webcam overlay?

From Dev

ffmpeg how to put color overlay over video

From Dev

ffmpeg -- How do I overlay a PNG over another PNG?

From Dev

How can I record an mp4 video from a webcam with a different audio source with FFMPEG?

From Dev

Loop a video overlay with ffmpeg

From Dev

How to merge audio and video file in ffmpeg

From Dev

ffmpeg unable to record video with audio how to solve it?

From Dev

Fill gaps in piped in audio with silence in FFMPEG

From Dev

ffmpeg - replace audio in video

From Dev

Crossfading Video AND Audio with ffmpeg

From Dev

ffmpeg: How to synchronize audio from overlayed video when that video is playing

From Dev

How to add web cam(video) recording as overlay using ffmpeg

From Dev

How to Overlay Multiple images as per second on video using ffmpeg

From Dev

How do I convert a video to GIF with text overlay using ffmpeg

From Dev

FFMPEG: how to enable overlay filter until the end of the video? (not knowing duration)

From Dev

How one video overlay with 2 different videos with ffmpeg?

From Dev

How to overlay multiple animated images on a video using ffmpeg

From Dev

ffmpeg: Buffer queue overflow error appears when adding audio with amix to overlay filtered video

From Dev

How to add replace audio of video and loop audio if video duration is greater than audio duration in ffmpeg?

From Dev

Add image overlay on video FFmpeg

From Dev

Delayed video overlay using FFmpeg

From Dev

Ffmpeg : Overlay 2 images on a video

From Dev

FFMPEG Overlay video on top of another video

Related Related

  1. 1

    How to overlay a transparent PNG over video and scale to video size in FFmpeg

  2. 2

    How to overlay multiple video files and merge all audio with ffmpeg?

  3. 3

    ffmpeg: overlay a png image on a video with custom transparency?

  4. 4

    FFMpeg Video Overlay with Delayed Audio and Video in Background Video

  5. 5

    how to combine two video and one audio via ffmpeg?

  6. 6

    Overlay image on video using ffmpeg with adjustable png image

  7. 7

    Ffmpeg - How to merge gdigrab and audio with webcam overlay?

  8. 8

    ffmpeg how to put color overlay over video

  9. 9

    ffmpeg -- How do I overlay a PNG over another PNG?

  10. 10

    How can I record an mp4 video from a webcam with a different audio source with FFMPEG?

  11. 11

    Loop a video overlay with ffmpeg

  12. 12

    How to merge audio and video file in ffmpeg

  13. 13

    ffmpeg unable to record video with audio how to solve it?

  14. 14

    Fill gaps in piped in audio with silence in FFMPEG

  15. 15

    ffmpeg - replace audio in video

  16. 16

    Crossfading Video AND Audio with ffmpeg

  17. 17

    ffmpeg: How to synchronize audio from overlayed video when that video is playing

  18. 18

    How to add web cam(video) recording as overlay using ffmpeg

  19. 19

    How to Overlay Multiple images as per second on video using ffmpeg

  20. 20

    How do I convert a video to GIF with text overlay using ffmpeg

  21. 21

    FFMPEG: how to enable overlay filter until the end of the video? (not knowing duration)

  22. 22

    How one video overlay with 2 different videos with ffmpeg?

  23. 23

    How to overlay multiple animated images on a video using ffmpeg

  24. 24

    ffmpeg: Buffer queue overflow error appears when adding audio with amix to overlay filtered video

  25. 25

    How to add replace audio of video and loop audio if video duration is greater than audio duration in ffmpeg?

  26. 26

    Add image overlay on video FFmpeg

  27. 27

    Delayed video overlay using FFmpeg

  28. 28

    Ffmpeg : Overlay 2 images on a video

  29. 29

    FFMPEG Overlay video on top of another video

HotTag

Archive