gpt4 book ai didi

image - 尝试使用 ffmpeg 从 ISO-8601 命名图片创建幻灯片。获得没有可播放流的输出

转载 作者:行者123 更新时间:2023-12-04 23:07:59 25 4
gpt4 key购买 nike

我正在尝试创建尺寸/方向不规则但均以相同的 ISO-8601 日期格式命名的图像的幻灯片。

我已经规范了文件名,所以它们都是 YYYYMMDD.jpg。我已经尝试使用 ffmpeg 的球状模式类型和输入文件的各种方法,包括将文件的串联连接到 ffmpeg。

以下是我尝试使用的图像:

$ ls *.jpg | xargs -n1 file
20190411.jpg: JPEG image data, Exif standard: [TIFF image data, big-endian, direntries=4, height=0, orientation=upper-left, width=0], baseline, precision 8, 10128x3984, components 3
20190417.jpg: JPEG image data, Exif standard: [TIFF image data, big-endian, direntries=4, height=0, orientation=lower-right, width=0], baseline, precision 8, 10176x3952, components 3
20190424.jpg: JPEG image data, Exif standard: [TIFF image data, big-endian, direntries=4, height=0, orientation=upper-left, width=0], baseline, precision 8, 12128x3840, components 3
20190429.jpg: JPEG image data, Exif standard: [TIFF image data, big-endian, direntries=4, height=0, orientation=upper-left, width=0], baseline, precision 8, 11104x3888, components 3
20190430.jpg: JPEG image data, Exif standard: [TIFF image data, big-endian, direntries=4, height=0, orientation=lower-right, width=0], baseline, precision 8, 10992x3920, components 3
20190501.jpg: JPEG image data, Exif standard: [TIFF image data, big-endian, direntries=4, height=0, orientation=lower-right, width=0], baseline, precision 8, 10528x3936, components 3
20190502.jpg: JPEG image data, Exif standard: [TIFF image data, big-endian, direntries=4, height=0, orientation=lower-right, width=0], baseline, precision 8, 10992x3792, components 3
20190508.jpg: JPEG image data, Exif standard: [TIFF image data, big-endian, direntries=4, height=0, orientation=lower-right, width=0], baseline, precision 8, 11008x3808, components 3
20190515.jpg: JPEG image data, Exif standard: [TIFF image data, big-endian, direntries=4, height=0, orientation=lower-right, width=0], baseline, precision 8, 10416x3760, components 3
20190516.jpg: JPEG image data, Exif standard: [TIFF image data, big-endian, direntries=4, height=0, orientation=lower-right, width=0], baseline, precision 8, 10928x3760, components 3
20190517.jpg: JPEG image data, Exif standard: [TIFF image data, big-endian, direntries=4, height=0, orientation=lower-right, width=0], baseline, precision 8, 10720x3840, components 3
20190522.jpg: JPEG image data, Exif standard: [TIFF image data, big-endian, direntries=4, height=0, orientation=[*0*], width=0], baseline, precision 8, 6552x1688, components 3
20190523.jpg: JPEG image data, Exif standard: [TIFF image data, big-endian, direntries=4, height=0, orientation=[*0*], width=0], baseline, precision 8, 6572x1700, components 3
20190524.jpg: JPEG image data, Exif standard: [TIFF image data, big-endian, direntries=4, height=0, orientation=[*0*], width=0], baseline, precision 8, 6468x1659, components 3
20190528.jpg: JPEG image data, Exif standard: [TIFF image data, big-endian, direntries=4, height=0, orientation=[*0*], width=0], baseline, precision 8, 5424x1644, components 3
20190529.jpg: JPEG image data, Exif standard: [TIFF image data, big-endian, direntries=7, model=Pixel 2 XL, height=0, manufacturer=Google, orientation=[*0*], datetime=2019:05:29 16:38:01, width=0]
20190531.jpg: JPEG image data, Exif standard: [TIFF image data, big-endian, direntries=4, height=0, orientation=[*0*], width=0], baseline, precision 8, 6584x1693, components 3
20190603.jpg: JPEG image data, Exif standard: [TIFF image data, big-endian, direntries=4, height=0, orientation=[*0*], width=0], baseline, precision 8, 6536x1690, components 3
20190604.jpg: JPEG image data, Exif standard: [TIFF image data, big-endian, direntries=4, height=0, orientation=[*0*], width=0], baseline, precision 8, 5748x1618, components 3
20190606.jpg: JPEG image data, Exif standard: [TIFF image data, big-endian, direntries=4, height=0, orientation=[*0*], width=0], baseline, precision 8, 6196x1690, components 3
20190607.jpg: JPEG image data, Exif standard: [TIFF image data, big-endian, direntries=4, height=0, orientation=[*0*], width=0], baseline, precision 8, 6112x1674, components 3
20190610.jpg: JPEG image data, Exif standard: [TIFF image data, big-endian, direntries=4, height=0, orientation=[*0*], width=0], baseline, precision 8, 6440x1670, components 3
20190611.jpg: JPEG image data, Exif standard: [TIFF image data, big-endian, direntries=4, height=0, orientation=[*0*], width=0], baseline, precision 8, 6312x1694, components 3
20190612.jpg: JPEG image data, Exif standard: [TIFF image data, big-endian, direntries=4, height=0, orientation=[*0*], width=0], baseline, precision 8, 6176x1689, components 3

这些是我尝试使用的各种 ffmpeg 命令:

cat *.jpg | ffmpeg -framerate 1/5 -c:v libx264 -r 30 -pix_fmt yuv420p out.mp4

cat *.jpg | ffmpeg -f image2pipe -i - output.mkv

ffmpeg -framerate 1/5 -pattern_type glob -i '*.jpg' out.mp4

ffmpeg -framerate 1/5 -pattern_type glob -i '*.jpg' -c:v libx264 -vf fps=25 -pix_fmt yuv420p out.mp4

我正在尝试创建一个按顺序显示每个图像 5 秒的视频,但我得到一个没有可播放流的 mp4 视频文件。

最佳答案

如此大的宽度 x 高度将难以解码。尝试添加比例过滤器来处理各种图像尺寸并制作更可玩的输出尺寸。

您可以填充差异:

ffmpeg -framerate 1/5 -pattern_type glob -i "*.jpg" -c:v libx264 -vf "scale=1920:1080:force_original_aspect_ratio=decrease:eval=frame,pad=1920:1080:(ow-iw)/2:(oh-ih)/2,setsar=1,format=yuv420p" -r 25 out.mp4

或裁剪:
ffmpeg -framerate 1/5 -pattern_type glob -i "*.jpg" -c:v libx264 -vf "scale=1920:1080:force_original_aspect_ratio=increase:eval=frame,crop=1920:1080,setsar=1,format=yuv420p" -r 25 out.mp4

关于image - 尝试使用 ffmpeg 从 ISO-8601 命名图片创建幻灯片。获得没有可播放流的输出,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/56674695/

25 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com