缩略图和传输流 [英] Thumbnails and Transport Streams
问题描述
我正在写一个传输流复用器.一切似乎都运行良好(该流在Windows Media 12和VLC中播放),
I'm writing a transport stream muxer. Everything appears to be working well (the stream plays in Windows Media 12 and VLC),
,但该图标未显示图像缩略图.我使用tsMuxerGUI构建的TS文件显示图像缩略图,但是我构建的文件
but the icon doesn't show an image thumbnail. TS files I build with tsMuxerGUI show an image thumbnail, but files I build
使用我自己的代码不会. (该流包含带有AVC视频和AAC音频的单个程序.)
with my own code do not. (The stream contains a single program with AVC video and AAC audio).
使用tsMuxer制作的文件与我自己的代码之间存在很多差异,但是尝试针对每种差异构建测试
There are many differences between the files made with tsMuxer vs my own code, but to try and build a test for each difference
不切实际.
有人知道Windows 7桌面在生成缩略图时在文件中查找的内容吗?
Does anyone know what specifically the Windows 7 desktop is looking for in the file when it generates a thumbnail image?
谢谢
-Neil
推荐答案
尼尔,
最近在编写归档服务时遇到了类似的问题.
I came across a similar issue when writing an archiving service recently.
当我指的是多路复用图"时,在下面,我的意思是这样的图:
When I'm referring to a "mux graph" below, I mean a graph like this:
[source filter (video and audio pins)] -> [Mux Filter] -> [File Writer Filter]
虽然在文件创建后WMV多路复用器图形将在Windows资源管理器中生成缩略图,但我发现H.264 AVC多路复用器图形不会.
While WMV mux graphs will produce a thumbnail in the windows explorer as soon as the file's created, I found that H.264 AVC mux graphs don't.
我发现对于H.264,只有将文件完全写入磁盘后,Windows资源管理器才会生成缩略图.
I found that for H.264, it's only when the file has completely been written to disk that a thumbnail is generated by windows explorer.
虽然我不确定,但我相信这与将文件头写入磁盘(可能在文件末尾)有关,直到写入头之前,Windows无法识别它作为可以制作缩略图的媒体文件 没了.
While I'm not sure, I believe that this will have something to do with the file's header being written to disk - perhaps at the end of the file - and until the header has been written, windows doesn't recognise it as a media file that it can make a thumbnail out of.
虽然文件末尾的标头听起来有些奇怪,但去年年底我在使用On2的VP8编解码器时发现,我遇到的媒体文件格式可以添加到文件的开头和结尾.对于媒体文件,这可以使 意义-在将网络流写入磁盘时,通常只有在帧数据已被写入之前,流大小才会被知道.
While a header at the end of the file might sound a bit strange, I was working with On2's VP8 codec late last year and found that media file formats I encountered can be added at the beginning and the end of their files. For a media file this can make sense - when writing a network stream to disk, the stream size often won't be known until the frame data has already been written.
尝试运行程序并生成几兆字节的媒体文件.然后使用GraphStudio或类似工具远程连接到图形,并使用GraphStudio工具停止正在运行的图形.
Try running your program and generating a media file of a few megabytes. Then connect to your graph remotely using GraphStudio or similar, and stop the running graph using the GraphStudio tool.
您应该发现缩略图几乎是在此之后立即创建的.我正在W7 x64平台上进行开发-尽管出于与生产服务器兼容性的考虑,该代码以x86平台为目标.我不应该那样做 差异.
You should find that the thumbnail is created almost immediately thereafter. I am developing on W7 x64 platform - although for compatibility reasons with our production servers, the code targets the x86 platform. I shouldn't think that'd make a difference.
这篇关于缩略图和传输流的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!