- html - 出于某种原因,IE8 对我的 Sass 文件中继承的 html5 CSS 不友好?
- JMeter 在响应断言中使用 span 标签的问题
- html - 在 :hover and :active? 上具有不同效果的 CSS 动画
- html - 相对于居中的 html 内容固定的 CSS 重复背景?
我的第一篇文章在这里 [所以请原谅最终的格式/公式/等问题]。我正在将原始 H.264 写入 mpeg 2 传输流转码器(仅更改容器,本身不涉及视频转码)。我认为我了解 mpeg 2 传输流规范 (H.222.0),但我无法让 QuickTime 播放生成的 .ts 文件(VLC 和 FFMPEG 播放正常)。我在做什么:
我有两个(几乎相同的)文件 - 其中一个是 VLC 转储的两帧 .ts 文件,另一个是 VLC 转储的两帧 .ts 文件转码为原始 H.264,然后转码再次使用我的工具.ts。差异很小,但对于我的生活来说,QuickTime 只播放原始的 VLC .ts,而不是我转码后的。我正在使用来自 http://tstools.berlios.de 的 tsreport报告各种 .ts 文件结构,它们看起来几乎相同。下面是 tsreport 导出的日志。有任何想法吗 ?
原始 VLC .ts 文件的 tsreport 日志
0: TS Packet 1 PID 0000 [pusi] PAT Adaptation field len 166 [flags 00] section length: 00d (13) transport stream id: 7fc2 version number 08, current next 1, section number 0, last section number 0 Program 001 ( 1) -> PID 0042 ( 66) 188: TS Packet 2 PID 0042 [pusi] PMT Adaptation field len 155 [flags 00] section length: 018 (24) program number: 0001 version number 10, current next 1, section number 0, last section number 0 PCR PID: 0044 program info length: 0 Program streams: PID 0044 -> Stream 1b H.264/14496-10 video (MPEG-4/AVC) Languages: ^@^@^@ 376: TS Packet 3 PID 0044 [pusi] stream type 1b (H.264/14496-10 video (MPEG-4/AVC)) Adaptation field len 7 [flags 10]: PCR .. PCR 0 PES header Start code: 00 00 01 Stream ID: e0 (224) SYSTEM START: Video stream 0 PES packet length: 0000 (0) Flags: 80 c0 : PTS DTS PES header len 10 PTS 0 DTS 0 Data (176 bytes): 00 00 01 e0 00 00 80 c0 0a 31 00 01 00 01 11 00 01 00 01 00... 564: TS Packet 4 PID 0044 stream type 1b (H.264/14496-10 video (MPEG-4/AVC)) 752: TS Packet 5 PID 0044 stream type 1b (H.264/14496-10 video (MPEG-4/AVC)) 940: TS Packet 6 PID 0044 stream type 1b (H.264/14496-10 video (MPEG-4/AVC)) 1128: TS Packet 7 PID 0044 stream type 1b (H.264/14496-10 video (MPEG-4/AVC)) 1316: TS Packet 8 PID 0044 stream type 1b (H.264/14496-10 video (MPEG-4/AVC)) Adaptation field len 164 [flags 10]: PCR .. PCR 562829905200 1504: TS Packet 9 PID 0044 [pusi] stream type 1b (H.264/14496-10 video (MPEG-4/AVC)) Adaptation field len 134 [flags 00] PES header Start code: 00 00 01 Stream ID: e0 (224) SYSTEM START: Video stream 0 PES packet length: 0000 (0) Flags: 80 c0 : PTS DTS PES header len 10 PTS 1876128985 DTS 1876128985 Data (49 bytes): 00 00 01 e0 00 00 80 c0 0a 33 bf 4d e9 b3 13 bf 4d e9 b3 00...Read 9 TS packets
我拿了上面的 VLC .ts 文件,从中提取了原始比特流——然后我用我的工具再次将它转换为 .ts;我的 .ts 的 tsreport 日志如下:
0: TS Packet 1 PID 0000 [pusi] PAT Adaptation field len 166 [flags 00] section length: 00d (13) transport stream id: 79d4 version number 08, current next 1, section number 0, last section number 0 Program 001 ( 1) -> PID 0035 ( 53) 188: TS Packet 2 PID 0035 [pusi] PMT Adaptation field len 161 [flags 00] section length: 012 (18) program number: 0001 version number 10, current next 1, section number 0, last section number 0 PCR PID: 0046 program info length: 0 Program streams: PID 0046 -> Stream 1b H.264/14496-10 video (MPEG-4/AVC) 376: TS Packet 3 PID 0046 [pusi] stream type 1b (H.264/14496-10 video (MPEG-4/AVC)) Adaptation field len 7 [flags 10]: PCR .. PCR 5370000 PES header Start code: 00 00 01 Stream ID: e0 (224) SYSTEM START: Video stream 0 PES packet length: 0000 (0) Flags: 80 c0 : PTS DTS PES header len 10 PTS 18000 DTS 18000 Data (176 bytes): 00 00 01 e0 00 00 80 c0 0a 31 00 01 8c a1 11 00 01 8c a1 00... 564: TS Packet 4 PID 0046 stream type 1b (H.264/14496-10 video (MPEG-4/AVC)) 752: TS Packet 5 PID 0046 stream type 1b (H.264/14496-10 video (MPEG-4/AVC)) 940: TS Packet 6 PID 0046 stream type 1b (H.264/14496-10 video (MPEG-4/AVC)) 1128: TS Packet 7 PID 0046 stream type 1b (H.264/14496-10 video (MPEG-4/AVC)) 1316: TS Packet 8 PID 0046 stream type 1b (H.264/14496-10 video (MPEG-4/AVC)) Adaptation field len 122 [flags 00] 1504: TS Packet 9 PID 0046 [pusi] stream type 1b (H.264/14496-10 video (MPEG-4/AVC)) Adaptation field len 122 [flags 10]: PCR .. PCR 7170000 PES header Start code: 00 00 01 Stream ID: e0 (224) SYSTEM START: Video stream 0 PES packet length: 0000 (0) Flags: 80 c0 : PTS DTS PES header len 10 PTS 24000 DTS 24000 Data (61 bytes): 00 00 01 e0 00 00 80 c0 0a 31 00 01 bb 81 11 00 01 bb 81 00...Read 9 TS packets
更新
事实证明,我在每个 NALU 之前都有 9 类型的 NALU - 即,我的流类似于 9 7 9 8 9 6 9 5 ... 而不是 9 7 8 6 5 9 1 9 1 ...
最佳答案
问题是我在每个 NALU 之前都有 9 类型的 NALU - 即,我的流类似于 9 7 9 8 9 6 9 5 ... 而不是 9 7 8 6 5 9 1 9 1 ... 我改变了我的容器转码器只输出一个访问单元定界符——即 NALU 类型 9——每帧(不是每个 NALU),现在一切都很好。
关于H.264 到传输流转码器问题,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/22754231/
我正在尝试做的一个小项目遇到了一个小问题。我正在尝试使用 Java 程序调用 Python 脚本。 Java: ProcessBuilder pb = new ProcessBuilder("pyth
我正在编写一个 Web 应用程序来管理和查看来自 ONVIF 网络摄像机的流。 它是用 nodejs 编写的。这个想法是在节点中运行一个子进程并将输出管道输出到节点,然后将缓冲区发送到客户端并将其呈现
我是一名优秀的程序员,十分优秀!