-
Notifications
You must be signed in to change notification settings - Fork 155
"Unknown type: dependentField" when trying to write PES packet #23
Comments
This shouldn't happen. Please install stack-displayname to your project as dev dependency for better logs and also you can use lines from https://github.com/RReverser/mpegts/blob/gh-pages/node.js#L3-L24 for even more clear output. Then, you should see error stack trace being built from type names, field names and binary offsets instead of anonymous internal functions - hopefully that will help to track the issue more precisely. |
Thanks for reply. I've done it now but the error is still the same. |
That's exactly why I suggested steps above. They don't fix anything, just help to see error in better format to understand where and why it occurs. This has nothing to do with jBinary internals, most likely problem with some definition, but I can't say anything for sure without prepared stacktrace. |
Could you please show me your stacktrace prepared in this way? |
Oh sorry, I was unclear. By saying "I've done it now but the error is still the same" I meant that I could not make it work and the error and stacktrace is shown in the same way as before. I copied the code to the beginning of my node script and installed stack-displayname, but the result is the same as before. Anyway I debugged it and found that it fails within the following "stack": I ended up by workaround, so the issue is irrelevant for me, but I can try provide more information if you still want to solve the bug. Thanks anyway |
I hope you did notice that given block depends on |
This is pretty weird since |
I tried to comment out the condition, but the stack trace is still unclear. As an alternative, I created a small piece of code which reproduces the problem. Just npm install mpegts and jbinary in the folder and execute the following code:
|
I'm trying to write a PES packet using jBinary and PES.js implemented in this repo.
Something like:
I get the following exception:
if (!(type in this.typeSet)) throw new ReferenceError("Unknown typ
^
ReferenceError: Unknown type: dependentField
at jBinary.proto._getType (\node_modules\jbinary\dist\node\jbinary.js:198:48)
I guess that it's a simple bug in the PES definition which arises when trying to WRITE PES packet (which is not the common scenario in this repo), or that I've done something stupid. But due to lack of internal knowledge in jBinary implementation I found it hard to debug the problem.
Any help is appreciated.
EDIT: The same error appears also when trying to write an mpegts packet using mpegts.js. (It does not necessary mean that the problem is in jBinary, because the implementation of FlagDependent and Flag types is duplicated and identical between MPEGTS and PES).
The text was updated successfully, but these errors were encountered: