将 jpg 文件流转换为 FLV 流
我使用可由我的软件控制的 Panasonic hcm280a 摄像机,它会生成一个巨大的 jpeg 文件流,我想将此流转换为 FLV 流,最好具有良好的压缩比
FFMpeg 是否可以做到这一点? 我基本上是在寻找一个现成的开源软件(或商业软件),可以为我生成流媒体。 同样,我的输入是来自相机服务器的 jpg 文件流。
任何见解或评论将不胜感激 谢谢
I work with a Panasonic hcm280a camera that can be controlled by my software, It generates a stream of jpeg files that are huge and I want to convert this stream to a FLV stream preferably with a good compressional ration
Does FFMpeg do that? I am basically looking for an off the shelve open source software (or commercial software) that can generate that streaming media for me. Again my input is a stream of jpg files that come from the camera server.
Any insight or comment would be greatly appreciated
Thanks
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(4)
此问题的答案确认 FFmpeg 能够从图像序列构建视频。 然而,那里没有给出细节。
在 FFmpeg FAQ 中您可以找到:
3.2 如何将单张图片编码成电影?
首先,按照数字顺序重命名您的图片。 例如,
img1.jpg
、img2.jpg
、img3.jpg
,...然后您可以运行:注意
% d
被图像编号替换。img%03d.jpg
表示序列img001.jpg
、img002.jpg
等...相同的逻辑适用于任何图像格式ffmpeg 读取的内容。
Answers to this question confirm that FFmpeg is able to build a video from a sequence of images. However, no detail is given there.
In FFmpeg FAQ you can find:
3.2 How do I encode single pictures into movies?
First, rename your pictures to follow a numerical sequence. For example,
img1.jpg
,img2.jpg
,img3.jpg
,... Then you may run:Notice that
%d
is replaced by the image number.img%03d.jpg
means the sequenceimg001.jpg
,img002.jpg
, etc...The same logic is used for any image format that ffmpeg reads.
这并不是专门回答您的问题,但 www.doom9.org 是一个很好的信息视频来源相关,值得查看下载和指南
This isn't specifically an answer to your question, but www.doom9.org is an excellent source of information video related, worth checking out the downloads and guides
使用 ffmpeg 来完成此操作。 我假设您的帧的名称为
frame0000.jpg
、frame0001.jpg
、...-r 1
告诉输入流每帧一帧第二(每秒一张图像),选择您喜欢的一张-s 320x240
缩放所有帧-y -an
覆盖输出文件并禁用录音-r 24
在输出流中具有 24 fps您还可以考虑将
-sameq
放在中间以尽可能保持质量。要正确重命名所有框架,您可以使用以下 bash oneliner:
To do it with
ffmpeg
. I assume your frame are names asframe0000.jpg
,frame0001.jpg
, ...-r 1
tells that input stream is one frame per second (one image per second), choose the one you like-s 320x240
scales all frames-y -an
to overwrite output file and to disable audio recording-r 24
to have 24 fps in the output streamYou can also consider putting
-sameq
in the middle to preserve quality as much as possible.To rename all your frames properly, you can use this bash one liner:
Motion 使用 ffmpeg 输出 flv 文件: http://www.lavrsen.dk/twiki /bin/view/Motion/WebHome
您可以禁用运动检测并使其连续输出(请参阅“output_all on”“ffmpeg_video_codec flv”)。
Motion outputs flv files using ffmpeg: http://www.lavrsen.dk/twiki/bin/view/Motion/WebHome
you can disable the motion detection and make it output continuously (see 'output_all on' 'ffmpeg_video_codec flv').