Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Synchronous data has no payload in processed stream #20

Open
dbussert opened this issue Jan 11, 2022 · 7 comments
Open

Synchronous data has no payload in processed stream #20

dbussert opened this issue Jan 11, 2022 · 7 comments
Labels
bug Something isn't working

Comments

@dbussert
Copy link
Contributor

I have a MPEG-TS video with 2 data pids, one is synchronous and one async. The async is processed by mpegts-demuxer correctly and provides a payload, but the synchronous never has a payload (and I've verified through other tools there is one). The packet output looks like this

Stream {
  program: 1,
  id: 2,
  type: 0,
  stream_id: 252,
  content_type: 0,
  dts: 886033149,
  has_dts: true,
  first_pts: 885961077,
  last_pts: 886033149,
  has_pts: true,
  frame_ticks: 3003,
  frame_num: 125,
  payload: null
}

I've verified the same behavior in a video with only H.264 video and a synchronous data PID. Any idea why the payload is always null for synchronous data?

@dbussert dbussert added the bug Something isn't working label Jan 11, 2022
@slifty
Copy link
Member

slifty commented Jan 11, 2022

I'll take a look!

Would you be able to share a video file and a code snippet that exhibits this problem? That'll make it a bit easier for me to debug.

@dbussert
Copy link
Contributor Author

I will try to find a video I can share. Is there an email I can send to? I've been digging in and I believe it's because of this block, which does not write a payload for unknown types. The type is 0 for this PID, TSDuck calls it Metadata in PES Packets.

if (s.stream_id && s.content_type !== _constants.MEDIA_TYPES.unknown) {
    const packet = s.write(mem, ptr, len, pstart, copy);
    if (packet) cb(packet);
  }

I added the 0x00 type into the getMediaType function, and now it will output a payload, but the payload isn't quite what I'm expecting. There's fragments and duplicates of the same payload being emitted. Possibly some parsing isn't quite right.

@slifty
Copy link
Member

slifty commented Jan 11, 2022

Sure thing -- email is my github handle and I use gmail (being cryptic to avoid the spam bots, though it's probably a lost cause).

@dbussert
Copy link
Contributor Author

sent, lmk if you received

@slifty
Copy link
Member

slifty commented Jan 12, 2022

@dbussert got it! I'm wrapping up a deadline today but hoping to be able to dig in by the end of the week.

@dbussert
Copy link
Contributor Author

hey, any chance to look at this? I've modified my packaged to allow payloads on type 0, but I imagine there is a more valid fix you might know of

@slifty
Copy link
Member

slifty commented Feb 28, 2022

@dbussert I apologize profusely for disappearing -- I hit a series of consecutive deadlines that pulled me away.

I'm glad you have solved this locally for the short term, but you're right this warrants trying to find the most correct solution (and patching the package). Just wanted to let you know I'm still planning to take this on (and wanting to confirm that you do indeed have a temporary solution that has unblocked you)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

2 participants