Ffmpeg: How To Make Output Video Has The Same Width, Height, And Sar With Input Video
I have 2 videos: v1.mp4 and v2.mp4. I want to make a output video that is a copied-v2.mp4 video but has the same width, height, SAR with v1.mp4. How could i do that by ffmpeg comma
Solution 1:
There is probably a way to get the values in one line, but I would just first get the values from video 1, and then plug in the numbers / strings into video 2. This can be done programatically with ffprobe, for example, by this command:
ffprobe -print_format json -show_format -show_streams v1.mp4
The output of ffprobe can be parsed as JSON or just read to get the width, height, and screen_aspect_ratio of video 1.
Post a Comment for "Ffmpeg: How To Make Output Video Has The Same Width, Height, And Sar With Input Video"