0

In function handle_packet() of mpegts.c (libavformat), I got a position of positive value which is lesser than 188. Which cause assertion failure. Could you please tell the reason for this issue and also suggest a solution.

pos = avio_tell(ts->stream->pb); // pos giving +ve value less than 188
av_assert0(pos >= TS_PACKET_SIZE). // which cause assertion issue
n0p
  • 3,399
  • 2
  • 29
  • 50
user-ag
  • 224
  • 3
  • 20

1 Answers1

1

There can be several causes, mainly:

  • The TS file contains some garbage
  • A desynchronization occured during your process

Whatever happened, you can retrieve synchronization by skipping bytes until you reach the Transport Packet synchro byte which is 0x47

n0p
  • 3,399
  • 2
  • 29
  • 50