Embed Image into video - FFMPEG or JW player? - image

So I thought to embed the image as part of video content while converting the m4a to mp4. The output file has the image as video content and it plays as expected in VLC but when the same was streamed from my CDN using JW player, I do not see the image as video content, still it is black and audio is heard. Not sure what is the issue with embeding. I used the FFMPEG to embed image as video content.
On the other hand is there any posibility with JW player to overlay an image as video content while audio can be heard in back end?

You need
to loop
the image
ffmpeg -loop 1 -r 1 -i img.png -i audio.m4a -shortest -filter:v \
'crop=trunc(iw/2)*2:trunc(ih/2)*2' out.mp4
repeat image over and over
once per second
stop video when audio stops
cut image to even dimensions if necessary

Related

Preview FFMPEG subtitles before encoding

I'm using FFMPEG to burn in subtitles using a command like this:
ffmpeg -i video.mp4 -vf "subtitles=subs.srt:force_style='Fontsize=24,PrimaryColour=&H0000ff&'" -c:a copy output.mp4
I'd like to create a sort of preview of what the the encoded file with subtitles will look like in the browser before the user clicks "Encode video". I've been creating a DIV with each bit of text from the .srt file and overlaying it on top of a VIDEO tag. I've then been fiddling with the font-size, positioning, color, etc. but just can't get it right. It would be nice if there were some sort of FFPLAY for the browser.
Is there some sort of approach/technique for creating an in-browser preview prior to encoding with FFMPEG?
Use WebVTT in your HTML5 video player. CSS is used for styling.
You can use ffmpeg to convert the SRT to VTT:
ffmpeg -i input.srt output.vtt

Overlay on full video length when making video from images sequence using ffmpeg

I am facing a issue when I overlay watermark image on video (I am making video from images sequence).The issue is that the overlay image only append on first image and ignoring all other images in video. I want to overlay this image on whole video. Possibly I am wrongly applying -filter_graph to input stream. I am executing below mentioned script. I searched online but did not find any relevant answer.
ffmpeg -r 1/5 -i img%2d.jpeg -i watermark.png -i music.mp3 -filter_complex "[0:v][1:v] overlay=x=10:y=10" video.mp4
Different resolution images causing the issue. Issue resolved after resizing images to same resolution.

iPhone video thumbnail upside down

Quicktime can play it right. But ffmpeg will produce an upside-down thumbnail sometimes.
ffmpeg -i input.MOV -ss 00:00:00.002 -vframes 1 -y output.png
I like to generate thumbnails of correct positions. What are some good remedies?
Thanks
Videos recorded on mobile devices will have a rotation attribute in their metadata. Quicktime uses this to know if it need to rotate the video. Use "MediaInfo" to see your media's metadata, you can download it from here; https://mediaarea.net/en/MediaInfo/Download
If the video is rotated 90' use -vf 'transpose=1', for 180' use -vf 'hflip,vflip'

Create a watermark in a separate track with FFmpeg

I have a PNG (alpha) file and a video file. I want to create a video in which the first track is the image and the second track is the video (PNG over video). The problem is that the PNG doesn't preserves transparency.
I need create a watermark (PNG) in a separate track with ffmpeg over video track.
ffmpeg -i base.mov -i logo.png -map 0 -map 1 output.mov
I needed the watermark is on a track (stream) separately in order to enable or disable it with quicktime pro.
Thanks.

Overlaying video with ffmpeg

I'm attempting to write a script that will merge 2 separate video files into 1 wider one, in which both videos play back simultaneously. I have it mostly figured out, but when I view the final output, the video that I'm overlaying is extremely slow.
Here's what I'm doing:
Expand the left video to the final video dimensions
ffmpeg -i left.avi -vf "pad=640:240:0:0:black" left_wide.avi
Overlay the right video on top of the left one
ffmpeg -i left_wide.avi -vf "movie=right.avi [mv]; [in][mv] overlay=320:0" combined_video.avi
In the resulting video, the playback on the right video is about half the speed of the left video. Any idea how I can get these files to sync up?
Like the user 65Fbef05 said, the both videos must have the same framerate
use -f framerate and framerate must be the same in both videos.
To find the framerate use:
ffmpeg -i video1
ffmpeg -i video2
and look for the line which contains "Stream #0.0: Video:"
on that line you'll find the fps in movie.
Also I don't know what problems you'll encounter by mixing 2 audio tracks.
From my part I will try to use the audio from the movie which will be overlayed
over and discard the rest.

Resources