来自avconv的静止图像的输出格式

时间:2022-01-14 09:00:11

I'd like to generate a still image from my video in mpeg to pipe, something like

我想从mpeg中的视频生成一个静止图像到管道,就像

avconv -ss 0:01 -i my.mpg -frames:v 1 -f jpeg -

However, avconv (ffmpeg) does not have jpeg among allowed output formats. There is no problem to specify format by output extension:

但是,avconv(ffmpeg)在允许的输出格式中没有jpeg。通过输出扩展名指定格式没有问题:

avconv -ss 0:01 -i my.mpg -frames:v 1 my.jpg; cat my.jpg

but I don't want to create redundant files. Any hint?

但我不想创建冗余文件。任何提示?

1 个解决方案

#1


From the docs, you can pipe to stdout by setting the output filename as the pipe protocol, i.e. pipe:1. And though it's not stated explicitly, you can set the output format as a file extension, the same way you would for a normal filename:

从文档中,您可以通过将输出文件名设置为管道协议来管道到stdout,即pipe:1。虽然没有明确说明,但您可以将输出格式设置为文件扩展名,与普通文件名相同:

avconv -ss 0:01 -i my.mpg -frames:v 1 pipe:1.jpg

Sidenote:

Note that some formats (typically MOV), require the output protocol to be seekable, so they will fail with the pipe output protocol

请注意,某些格式(通常为MOV)要求输出协议是可搜索的,因此它们将使用管道输出协议失败

#1


From the docs, you can pipe to stdout by setting the output filename as the pipe protocol, i.e. pipe:1. And though it's not stated explicitly, you can set the output format as a file extension, the same way you would for a normal filename:

从文档中,您可以通过将输出文件名设置为管道协议来管道到stdout,即pipe:1。虽然没有明确说明,但您可以将输出格式设置为文件扩展名,与普通文件名相同:

avconv -ss 0:01 -i my.mpg -frames:v 1 pipe:1.jpg

Sidenote:

Note that some formats (typically MOV), require the output protocol to be seekable, so they will fail with the pipe output protocol

请注意,某些格式(通常为MOV)要求输出协议是可搜索的,因此它们将使用管道输出协议失败