没人能解决这个问题吗?岂不是让我对csdn很失望!——十万火急,mpeg1的格式问题

try_wzh 2001-07-19 09:19:41
各位尊敬的大虾:
本小虾在做一个程序,在网络上传送mpeg1的数据(没有形成文件),然后接收端直接用DirectShow播放内存数据,但是播放mpeg1数据是需要知道mpeg1的头部格式,不然DirectShow播放不出来,我的问题是请教各位大虾能指点一下如何构造mpeg1的头部,给个例子或者给个文档(最好是中文,简单,拿来就用最好了),由于本人刚来门诊挂号,分数有限,但如有那位大虾帮我解决这个问题,本人砸锅卖铁,分数全给你了.谢了!
...全文
251 20 打赏 收藏 转发到动态 举报
写回复
用AI写文章
20 条回复
切换为时间正序
请发表友善的回复…
发表回复
wilddragon 2001-09-22
  • 打赏
  • 举报
回复
好困呀
wilddragon 2001-09-22
  • 打赏
  • 举报
回复
支持一把
wilddragon 2001-09-21
  • 打赏
  • 举报
回复
关注
wanliduxing 2001-09-21
  • 打赏
  • 举报
回复
我也要啊。tobefirst@21cn.com或者ggtian@china.com
gffly 2001-09-18
  • 打赏
  • 举报
回复
Mpeg 1.0/2.0 LayersI, II and III header and trailer formats
-----------------------------------------------------------

Laurent.Clevy@alcatel.fr



* HEADER


bits name comments
--------------------------------------------------
12 sync 0xFFF
1 version 1=mpeg1.0, 0=mpeg2.0
2 lay 4-lay = layerI, II or III
1 error protection 0=yes, 1=no
4 bitrate_index see table below
2 sampling_freq see table below
1 padding
1 extension see table below
2 mode see table below
2 mode_ext used with "joint stereo" mode
1 copyright 0=no 1=yes
1 original 0=no 1=yes
2 emphasis see table below
--------------------------------------------------

- bitrate_index

. mpeg1.0

1 2 3 4 5 6 7 8 9 10 11 12 13 14
layer1 32 64 96 128 160 192 224 256 288 320 352 384 416 448
layer2 32 48 56 64 80 96 112 128 160 192 224 256 320 384
layer3 32 40 48 56 64 80 96 112 128 160 192 224 256 320

. mpeg2.0

1 2 3 4 5 6 7 8 9 10 11 12 13 14
layer1 32 48 56 64 80 96 112 128 144 160 176 192 224 256
layer2 8 16 24 32 40 48 56 64 80 96 112 128 144 160
layer3 8 16 24 32 40 48 56 64 80 96 112 128 144 160


- sampling_freq

. mpeg1.0

0 1 2

44100 48000 32000

. mpeg2.0

0 1 2

22050 24000 16000


- mode:

0 "stereo"
1 "joint stereo"
2 "dual channel"
3 "single channel"


- mode extension:

0 MPG_MD_LR_LR
1 MPG_MD_LR_I
2 MPG_MD_MS_LR
3 MPG_MD_MS_I

jsbound :

mode_ext 0 1 2 3
layer
1 4 8 12 16
2 4 8 12 16
3 0 4 8 16


- emphasis:

0 "none"
1 "50/15 microsecs"
2 "reserved" must not be used !
3 "CCITT J 17"




* TRAILER

at end of file - 128 bytes

offset type len name
--------------------------------------------
0 char 3 "TAG"
3 char 30 title
33 char 30 artist
63 char 30 album
93 char 4 year
97 char 30 comments
127 byte 1 genre
--------------------------------------------

- genre :

0 "Blues"
1 "Classic Rock"
2 "Country"
3 "Dance"
4 "Disco"
5 "Funk"
6 "Grunge"
7 "Hip-Hop"
8 "Jazz"
9 "Metal"
10 "New Age"
11 "Oldies"
12 "Other"
13 "Pop"
14 "R&B"
15 "Rap"
16 "Reggae"
17 "Rock"
18 "Techno"
19 "Industrial"
20 "Alternative"
21 "Ska"
22 "Death Metal"
23 "Pranks"
24 "Soundtrack"
25 "Euro-Techno"
26 "Ambient"
27 "Trip-Hop"
28 "Vocal"
29 "Jazz+Funk"
30 "Fusion"
31 "Trance"
32 "Classical"
33 "Instrumental"
34 "Acid"
35 "House"
36 "Game"
37 "Sound Clip"
38 "Gospel"
39 "Noise"
40 "AlternRock"
41 "Bass"
42 "Soul"
43 "Punk"
44 "Space"
45 "Meditative"
46 "Instrumental Pop"
47 "Instrumental Rock"
48 "Ethnic"
49 "Gothic"
50 "Darkwave"
51 "Techno-Industrial"
52 "Electronic"
53 "Pop-Folk"
54 "Eurodance"
55 "Dream"
56 "Southern Rock"
57 "Comedy"
58 "Cult"
59 "Gangsta"
60 "Top 40"
61 "Christian Rap"
62 "Pop/Funk"
63 "Jungle"
64 "Native American"
65 "Cabaret"
66 "New Wave"
67 "Psychadelic"
68 "Rave"
69 "Showtunes"
70 "Trailer"
71 "Lo-Fi"
72 "Tribal"
73 "Acid Punk"
74 "Acid Jazz"
75 "Polka"
76 "Retro"
77 "Musical"
78 "Rock & Roll"
79 "Hard Rock"
80 "Unknown"



- frame length :

. mpeg1.0

layer1 :
(48000*bitrate)/sampling_freq + padding
layer2&3:
(144000*bitrate)/sampling_freq + padding

. mpeg2.0

layer1 :
(24000*bitrate)/sampling_freq + padding
layer2&3 :
(72000*bitrate)/sampling_freq + padding
atree 2001-09-18
  • 打赏
  • 举报
回复
我也想要阿
atree_zhang@263.net

不知道自己直接先在服务端向directshow传送一个mpeg1的头
是不是就可以啦?
hornbills 2001-08-04
  • 打赏
  • 举报
回复
MPEG Video

THIS TEXT CONTAINS ONLY MPEG VIDEO HEADER INFO - BY WILSON WOO
It's only what I know. Please feel free to update it.

Below is information got from someone.

/*****************************************************************/

Sequence Header

This contains information related to one or more "group-of-pictures"

Byte# Data Details
===================================================================
1-4 Sequence header In Hex 000001B3
code
12 bits Horizontal size In pixels
12 bits Vertical size In pixels
4 bits Pel aspect ratio See below
18 bits Picture rate See below
1 bit Marker bit Always 1
10 bits VBV buffer size Minimum buffer needed to decode this
sequence of pictures; in 16KB units
1 bit Constrained
parameter flag
1 bit Load intra 0: false; 1: true (matrix follows)
quantizer matrix
64 bytes Intra quantizer Optional
matrix
1 bit Load nonintra 0: false; 1: true (matrix follows)
quantizer matrix
64 bytes Nonintra quantizer Optional
matrix
- Squence extension Optional
Data
- User data Optional application-dependent data
===================================================================

Aspect raios are defined by a code which represents the height and
width of the Video image.
Picture rates are also defined by a code that represents the number
of pictures that may be displayed each second.

Each group of pictures has a header that contains one "I picture"
and zero or more B and P pictures. The header is concerned with
the time synchronisation for the first picture in this group, and
the closeness of the previous group to this one.

/*****************************************************************/

For picture rate:
1 = 23.976 frames/sec
2 = 24
3 = 25
4 = 29.97
5 = 30
6 = 50
7 = 59.94
8 = 60

Here gives an example. Below is Hex dump of first 256 bytes of
the first Video frame of TEST.MPG from XingMPEG.

00 00 01 B3 16 00 F0 C4 02 A3 20 A5 10 12 12 14
14 14 16 16 16 16 18 18 19 18 18 1A 1B 1B 1B 1B
1A 1C 1D 1E 1E 1E 1D 1C 1E 1F 20 21 21 20 1F 1E
21 23 23 24 23 23 21 25 26 27 27 26 25 29 2A 2A
2A 29 2D 2D 2D 2D 30 31 30 34 34 38 16 00 F0 C4
00 00 01 B8 00 08 00 00 00 00 01 00 00 0A 72 00
00 00 01 01 13 F9 50 02 BC B2 B8 BE 68 8B A4 9F
C5 B5 CA 00 56 76 39 65 F2 30 8B A6 9D 50 69 E7
DA FE 13 CF B7 FF 8F F4 CE 7B FA 0E F0 66 AE 1C
5D E7 00 C8 0A 92 B9 29 3C 21 23 F1 D6 40 13 06
F0 10 10 C6 27 80 A0 34 E1 C8 E4 0F 74 91 DA C4
03 A0 DC 03 12 60 18 49 27 1D D4 BC 67 0E 54 8C
96 FC 5D C0 06 E0 1A 72 11 7C 9A 8D C9 45 89 6D
CD C4 0B 63 DC 90 18 24 00 EC 84 90 18 10 C9 3B
1E A7 60 3C 9D 74 80 76 05 0B 02 81 A9 29 39 68
53 8F 59 F1 BF 93 FB A0 04 01 BC B0 CE 18 E1 25

Sequence header = (Hex) 00 00 01 B3
Horizontal size = 0x160 = 352
Vertical size = 0x0F0 = 240
Pel aspect ratio = [I don't know]
Picture rate = 4 = 29.97 frames/sec
Marker bit = 1
yrb 2001-08-03
  • 打赏
  • 举报
回复
hama您好:
给我也发一份mpeg1/2的文档吧!yangrunbing@163.com
yrb 2001-08-03
  • 打赏
  • 举报
回复
hama您好:
jixian 2001-08-01
  • 打赏
  • 举报
回复
pop
jixian 2001-08-01
  • 打赏
  • 举报
回复
pop
yxy1977 2001-08-01
  • 打赏
  • 举报
回复
我也要,yxy1977@eyou.com,谢谢
DarkRuler 2001-08-01
  • 打赏
  • 举报
回复
我也要snoopy_sizhu@sohu.com
eestar 2001-07-31
  • 打赏
  • 举报
回复
eestar@china.com
我也要
我也要
我也要
先发给我!!!!!
不然死不赖账!!!!!!!!!!
tinydust 2001-07-26
  • 打赏
  • 举报
回复
wwwhpq@163.net我也要
smartzhou 2001-07-23
  • 打赏
  • 举报
回复
zhoubogeo@263.net
smartzhou 2001-07-23
  • 打赏
  • 举报
回复
也给我来一份
moleboy 2001-07-22
  • 打赏
  • 举报
回复
我也要!moleboy@263.net
try_wzh 2001-07-22
  • 打赏
  • 举报
回复
谢谢hama兄!我的地址是wzh511@263.net
hama 2001-07-20
  • 打赏
  • 举报
回复
我有关于mpeg1/2的文档,也有c语言代码,不过是英文的,寄给你吧......
给个地址先......

2,586

社区成员

发帖
与我相关
我的任务
社区描述
VC/MFC 资源
社区管理员
  • 资源
加入社区
  • 近7日
  • 近30日
  • 至今
社区公告
暂无公告

试试用AI创作助手写篇文章吧