4

Can a mpeg 2 transport stream ( .ts ) file be opened in binary mode in C ?? How to read the contents of the file bit by bit for analyzing the various tables in the transport stream?

user2400394
  • 91
  • 1
  • 6

2 Answers2

0

Read the data as byte and use shift operation to convert the BYTE to bit.

akhil
  • 732
  • 3
  • 13
0

Its very simple in belows 2 steps. But i guess to use this info you need to understand the file format of mpeg 2 transport stream ( .ts ).

1> you can open file with rb mode

2> Now read byte from file.

3> Now get desigred bit from that byte as follows

bit = Read_byte & (1 << position_of_bit);

here position of bit is the position of bit starting from 0 to LSB.

Jeegar Patel
  • 26,264
  • 51
  • 149
  • 222