如何使用 H264 编解码器录制和保存 Flash 视频
现在我正在开发一个 AIR 3.2 应用程序,它可以让您将视频流式传输到 Flash Media Server 并将其保存在硬盘上。
该序列适用于标准 Sorenson 编解码器,但我想对我的视频使用 H.264。我找到了很多示例代码并在我的代码中实现了它,但是当我录制自己的视频时,我无法在事后重新观看它。
我找到了如何在 realeyes 博客文章位于此处。我的代码在这里。
它将视频保存为 .f4v
文件,但我的浏览器(我已经尝试了最新版本的 Chrome 和 Firefox,以及最新的 Flash)和 VLC 无法加载视频。我还使用了一个名为“电影播放器”的程序,它可以打开文件,但只能显示第一帧和音频。我也无法将视频上传到 YouTube,因为它们不支持文件扩展名。
以下是它保存的示例视频文件:H264Test1.f4v。
我的问题是:如何流式传输并保存具有文件扩展名的电影,以便在使用 H.264 编解码器时能够重新观看?
Right now I am working on an AIR 3.2 application which lets you stream a video to a Flash Media Server and saves it on a hard drive.
This sequence works fine with the standard Sorenson codec but I want to use H.264 for my videos. I found lots example code and implemented it in my code, but when I record a video of myself I am unable to re-watch it afterwards.
I found how to implement a H.264 encoding in a realeyes blog post here. My code is here.
It saves the video as a .f4v
file, but my browser (I've tried the latest versions of both Chrome and Firefox, with the latest Flash) and also VLC are unable to load the video. I also used a program called Movie Player which is able to open the file but can only show the first frame and the audio. Neither am I able to upload the video to YouTube because they do not support the file extension.
Here is an example video file it saved: H264Test1.f4v.
My question is: How do I stream and save the movie with a file extension that I am able to re-watch while using the H.264 codec?
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(3)
这是因为FMS录制mp4内容的方式,导致不少播放器无法播放视频。
通过以下 URL 下载 Adobe F4V 后处理器:http://www.adobe.com/products/flashmediaserver /tool_downloads/
这应该转换视频,以便可以在其他播放器中播放。
编辑:我刚刚用一些视频测试了该工具,它确实可以解决录制的 f4v 视频无法在其他播放器中播放的问题
This is because of how FMS records the mp4 content, quite a few players won't be able to play the videos.
Download the Adobe F4V Postprocessor at this URL: http://www.adobe.com/products/flashmediaserver/tool_downloads/
This should convert the video so it will be playable in other players.
Edit: I just tested the tool with some videos, it will indeed solve the issue of recorded f4v videos not playing in other players
使用ffmpeg将f4v文件转换为flv,命令如下:
Use ffmpeg to convert the f4v file to flv using the following command:
检查 Pavel Langweil 的在此处输入链接说明。他有一个很棒的 Theora / Vorbis 编码器,可以生成小的 ovg 文件,您可以使用 ffmpeg 轻松将其转换为 mp4。
Check the enter link description here from Pavel Langweil. He have a great Theora / Vorbis encoder that generates small ovg files that you can easily convert to mp4 using ffmpeg.