基本流是什么意思H264 [英] What does Elementary Stream mean in Terms of H264

查看:351
本文介绍了基本流是什么意思H264的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我在维基百科阅读了一个基本流。我正在使用Live555的工具要求H.264视频基本流文件。那么当从视频应用程序导出视频时,是否必须选择特定的首选项来生成基本流?

I read what an Elementary Stream is on Wikipedia. A tool i am using "Live555" is demanding "H.264 Video Elementary Stream File". So when exporting a Video from a Video Application, do i have to choose specific preferences to generate a "Elementery Stream" ?

推荐答案

如果你使用ffmpeg,你可以使用类似于以下的东西:

If you're using ffmpeg you could use something similar to the following:

ffmpeg -f video4linux2 -s 320x240 -i /dev/video0 -vcodec libx264 -f h264 test.264   

您必须修改命令行您要从中导出视频的文件类型。
这将生成一个包含H.264访问单元的文件,其中每个访问单元由一个或多个NAL单元组成,每个NAL单元前缀有起始代码(0001或001)。您可以使用十六进制编辑器打开该文件以查看它。

You'll have to adapt the command line for the file type you're exporting the video from. This generates a file containing H.264 access units where each access unit consists of one or more NAL units with each NAL unit prefixed with a start code (0001 or 001). You can open the file using a hex editor to take a look at it.

您还可以使用该文件创建H.264基本流文件(.264)来自原始YUV输入文件的 H.264参考编码器

You can also create an H.264 elementary stream file (.264) by using the the H.264 reference encoder from raw YUV input files.

如果将生成的.264文件复制到live555 testOnDemandRTSPServer目录中,则可以通过RTSP / RTP测试流文件。

If you copy the generated .264 file into the live555 testOnDemandRTSPServer directory, you can test streaming the file over RTSP/RTP.


你可以给出一些参考,了解更多关于NAL / H.264基本流的信息。如何快速检查流是否是基本流?

Can you give some references to read more about NAL / H.264 elementary Stream. How can I quickly check if the stream is an elementary stream?

通常,容器(avi或mp4)中的任何内容都不是基本的流。用于基本流的典型扩展是.264。仔细检查文件是基本流的最快方法是在十六进制编辑器中打开文件,并在文件开头(00000001)查找一个起始代码。请注意,通过文件(在每个NAL单元之前)应该有3(000001)和4(00000001)个字节的起始代码。

Generally anything in a container (avi or mp4) is not an elementary stream. The typical extension used for elementary streams is ".264". The quickest way to double check that a file is an elementary stream is to open the file in a hex editor and look for a start code at the beginning of the file (00000001). Note that there should be 3 (000001) and 4 (00000001) byte start codes through out the file (before every NAL unit)


为什么live555不玩h264流不是基本的?

Why does live555 not play h264 streams which are not elementary?

这纯粹是因为live555没有实现所需的解码器(例如avi或mp4)。 AFAIK live555支持从matroska容器解码H.264。

This is purely if live555 has not implemented the required demux (e.g. avi or mp4). AFAIK live555 does support demuxing H.264 from the matroska container.

这篇关于基本流是什么意思H264的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆