Creating video from images with different SARs with FFMPEG

jrkt

I am trying to run the ffmpeg command:

ffmpeg -y -threads 2  -loop 1 -t 5 -i watermark-0.png -loop 1 -t 2.5 -i watermark-1.png -loop 1 -t 2.5 -iwatermark-2.png -loop 1 -t 2.5 -i watermark-3.png -loop 1 -t 2.5 -i4.png -loop 1 -t 2.5 -i watermark-5.png -loop 1 -t 2.5 -i watermark-6.png -loop 1 -t 2.5 -i watermark-7.png -filter_complex [1:v][0:v]blend=all_expr='A*(if(gte(T,0.5),1,T/0.5))+B*(1-(if(gte(T,0.5),1,T/0.5)))'[b1v];[2:v][1:v]blend=all_expr='A*(if(gte(T,0.5),1,T/0.5))+B*(1-(if(gte(T,0.5),1,T/0.5)))'[b2v];[3:v][2:v]blend=all_expr='A*(if(gte(T,0.5),1,T/0.5))+B*(1-(if(gte(T,0.5),1,T/0.5)))'[b3v];[4:v][3:v]blend=all_expr='A*(if(gte(T,0.5),1,T/0.5))+B*(1-(if(gte(T,0.5),1,T/0.5)))'[b4v];[5:v][4:v]blend=all_expr='A*(if(gte(T,0.5),1,T/0.5))+B*(1-(if(gte(T,0.5),1,T/0.5)))'[b5v];[6:v][5:v]blend=all_expr='A*(if(gte(T,0.5),1,T/0.5))+B*(1-(if(gte(T,0.5),1,T/0.5)))'[b6v];[7:v][6:v]blend=all_expr='A*(if(gte(T,0.5),1,T/0.5))+B*(1-(if(gte(T,0.5),1,T/0.5)))'[b7v];[0:v][b1v][1:v][b2v][2:v][b3v][3:v][b4v][4:v][b5v][5:v][b6v][6:v][b7v][7:v]concat=n=15:v=1:a=0,format=yuv420p[v] -map [v] -c:v libx264 -r 120 -s 1280x720 -aspect 16:9 -crf 1 -preset ultrafast output.mp4

But, I get the ffmpeg error: First input link top parameters (size 1280x720, SAR 5689:5669) do not match the corresponding second input link bottom parameters (1280x720, SAR 1:1)

The ffmpeg stdout is:

Input #0, png_pipe, from '/media/test/a0201d256f97c39d4f05-watermark-0.png':
  Duration: N/A, bitrate: N/A
    Stream #0:0: Video: png, rgb24, 1280x720 [SAR 72:72 DAR 16:9], 25 fps, 25 tbr, 25 tbn, 25 tbc
Input #1, png_pipe, from '/media/test/a0201d256f97c39d4f05-watermark-1.png':
  Duration: N/A, bitrate: N/A
    Stream #1:0: Video: png, rgb24, 1280x720 [SAR 5905:5905 DAR 16:9], 25 fps, 25 tbr, 25 tbn, 25 tbc
Input #2, png_pipe, from '/media/test/a0201d256f97c39d4f05-watermark-2.png':
  Duration: N/A, bitrate: N/A
    Stream #2:0: Video: png, rgb24, 1280x720 [SAR 100:100 DAR 16:9], 25 fps, 25 tbr, 25 tbn, 25 tbc
Input #3, png_pipe, from '/media/test/a0201d256f97c39d4f05-watermark-3.png':
  Duration: N/A, bitrate: N/A
    Stream #3:0: Video: png, rgb24, 1280x720 [SAR 11378:11338 DAR 91024:51021], 25 fps, 25 tbr, 25 tbn, 25 tbc
Input #4, png_pipe, from '/media/test/a0201d256f97c39d4f05-watermark-4.png':
  Duration: N/A, bitrate: N/A
    Stream #4:0: Video: png, rgb24, 1280x720 [SAR 72:72 DAR 16:9], 25 fps, 25 tbr, 25 tbn, 25 tbc
Input #5, png_pipe, from '/media/test/a0201d256f97c39d4f05-watermark-5.png':
  Duration: N/A, bitrate: N/A
    Stream #5:0: Video: png, rgb24, 1280x720 [SAR 3779:3779 DAR 16:9], 25 fps, 25 tbr, 25 tbn, 25 tbc
Input #6, png_pipe, from '/media/test/a0201d256f97c39d4f05-watermark-6.png':
  Duration: N/A, bitrate: N/A
    Stream #6:0: Video: png, rgb24, 1280x720 [SAR 100:100 DAR 16:9], 25 fps, 25 tbr, 25 tbn, 25 tbc
Input #7, png_pipe, from '/media/test/a0201d256f97c39d4f05-watermark-7.png':
  Duration: N/A, bitrate: N/A
    Stream #7:0: Video: png, rgb24, 1280x720 [SAR 72:72 DAR 16:9], 25 fps, 25 tbr, 25 tbn, 25 tbc
[Parsed_blend_2 @ 0x1d8ce80] First input link top parameters (size 1280x720, SAR 5689:5669) do not match the corresponding second input link bottom parameters (1280x720, SAR 1:1)
[Parsed_blend_2 @ 0x1d8ce80] Failed to configure output pad on Parsed_blend_2

So, I try to specify the SAR in the following command:

ffmpeg -y -threads 2  -loop 1 -t 5 -i watermark-0.png -loop 1 -t 2.5 -i watermark-1.png -loop 1 -t 2.5 -iwatermark-2.png -loop 1 -t 2.5 -i watermark-3.png -loop 1 -t 2.5 -i4.png -loop 1 -t 2.5 -i watermark-5.png -loop 1 -t 2.5 -i watermark-6.png -loop 1 -t 2.5 -i watermark-7.png -filter_complex [0:v]setsar=1[sar0];[1:v][sar0]blend=all_expr='A*(if(gte(T,0.5),1,T/0.5))+B*(1-(if(gte(T,0.5),1,T/0.5)))'[b1v];[1:v]setsar=1[sar1];[2:v][sar1]blend=all_expr='A*(if(gte(T,0.5),1,T/0.5))+B*(1-(if(gte(T,0.5),1,T/0.5)))'[b2v];[2:v]setsar=1[sar2];[3:v][sar2]blend=all_expr='A*(if(gte(T,0.5),1,T/0.5))+B*(1-(if(gte(T,0.5),1,T/0.5)))'[b3v];[3:v]setsar=1[sar3];[4:v][sar3]blend=all_expr='A*(if(gte(T,0.5),1,T/0.5))+B*(1-(if(gte(T,0.5),1,T/0.5)))'[b4v];[4:v]setsar=1[sar4];[5:v][sar4]blend=all_expr='A*(if(gte(T,0.5),1,T/0.5))+B*(1-(if(gte(T,0.5),1,T/0.5)))'[b5v];[5:v]setsar=1[sar5];[6:v][sar5]blend=all_expr='A*(if(gte(T,0.5),1,T/0.5))+B*(1-(if(gte(T,0.5),1,T/0.5)))'[b6v];[6:v]setsar=1[sar6];[7:v][sar6]blend=all_expr='A*(if(gte(T,0.5),1,T/0.5))+B*(1-(if(gte(T,0.5),1,T/0.5)))'[b7v];[0:v][b1v][1:v][b2v][2:v][b3v][3:v][b4v][4:v][b5v][5:v][b6v][6:v][b7v][7:v]concat=n=15:v=1:a=0,format=yuv420p[v] -map [v] -c:v libx264 -r 120 -s 1280x720 -aspect 16:9 -crf 1 -preset ultrafast output.mp4

But, I still get the exact same error: First input link top parameters (size 1280x720, SAR 5689:5669) do not match the corresponding second input link bottom parameters (1280x720, SAR 1:1)

That's the first issue. The second issue is that I need to get this command to run with the zoompan filter as well and I have no idea where to even start to get that additional filter to work or where to put it in the command.

Help??

Gyan

You have to set all the SARs beforehand. So, [1:v][sar0]blend=.. will fail because 1:v still presents a different SAR. [sar1][sar0]blend=.." will work and so on.

It may just be easier to do this in a separate command preemptively for each input image and use the output:

ffmpeg -i watermark-5.png -vf setsar=1 watermark-5n.png

Collected from the Internet

Please contact [email protected] to delete if infringement.

edited at
0

Comments

0 comments
Login to comment

Related

From Dev

Creating Video Slideshow From Images With Different Sizing/Aspect Ratio Using FFMPEG?

From Dev

ffmpeg slideshow video from images creating empty mp4

From Dev

ffmpeg- make video from images in different folders

From Dev

FFmpeg making video from images placed in different folders

From Dev

Add watermark to each frame while creating video from images using ffmpeg

From Dev

creating video from selected images using FFMPEG through command Line Android

From Java

FFmpeg producing a flickering video from images

From Dev

Producing stable video from slow images with FFmpeg

From

How to create a video from images with FFmpeg?

From Dev

ffmpeg how to output images from a video

From Dev

ffmpeg pipe images extracted from video

From Dev

Make video from images with ffmpeg/imagemagic

From Dev

Can FFMPEG extract images from a video with timestamps?

From Dev

create video from jpg images using ffmpeg

From Dev

Creating a sequence of images from lyrics to use in ffmpeg

From Dev

creating video from sequence of images javacv

From Java

Python creating video from images using opencv

From Dev

Creating a video from a sequence of images in Matlab

From Dev

Creating a video from set of images Android

From Dev

FFMpeg : Converting a video file to a gif with multiple images from video

From Dev

ffmpeg - merge images with video

From Dev

FFmpeg. Video to images

From

Creating a video from a single image for a specific duration in ffmpeg

From Dev

FFMPEG - Create a slideshow video from images in a directory, sorted alphabetically

From Dev

Create video from images and audio with varying image durations using FFMPEG?

From Dev

Producing lossless video from set of .png images using ffmpeg

From Dev

Combining images into video with ffmpeg, but from multiple folders into the same frames

From Dev

ffmpeg: Is there a way to create video from images and overlay on image at same time?

From Dev

FFmpeg make video from images skip middle or rear range

Related Related

  1. 1

    Creating Video Slideshow From Images With Different Sizing/Aspect Ratio Using FFMPEG?

  2. 2

    ffmpeg slideshow video from images creating empty mp4

  3. 3

    ffmpeg- make video from images in different folders

  4. 4

    FFmpeg making video from images placed in different folders

  5. 5

    Add watermark to each frame while creating video from images using ffmpeg

  6. 6

    creating video from selected images using FFMPEG through command Line Android

  7. 7

    FFmpeg producing a flickering video from images

  8. 8

    Producing stable video from slow images with FFmpeg

  9. 9

    How to create a video from images with FFmpeg?

  10. 10

    ffmpeg how to output images from a video

  11. 11

    ffmpeg pipe images extracted from video

  12. 12

    Make video from images with ffmpeg/imagemagic

  13. 13

    Can FFMPEG extract images from a video with timestamps?

  14. 14

    create video from jpg images using ffmpeg

  15. 15

    Creating a sequence of images from lyrics to use in ffmpeg

  16. 16

    creating video from sequence of images javacv

  17. 17

    Python creating video from images using opencv

  18. 18

    Creating a video from a sequence of images in Matlab

  19. 19

    Creating a video from set of images Android

  20. 20

    FFMpeg : Converting a video file to a gif with multiple images from video

  21. 21

    ffmpeg - merge images with video

  22. 22

    FFmpeg. Video to images

  23. 23

    Creating a video from a single image for a specific duration in ffmpeg

  24. 24

    FFMPEG - Create a slideshow video from images in a directory, sorted alphabetically

  25. 25

    Create video from images and audio with varying image durations using FFMPEG?

  26. 26

    Producing lossless video from set of .png images using ffmpeg

  27. 27

    Combining images into video with ffmpeg, but from multiple folders into the same frames

  28. 28

    ffmpeg: Is there a way to create video from images and overlay on image at same time?

  29. 29

    FFmpeg make video from images skip middle or rear range

HotTag

Archive