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

PCR signalling in TS mux #635

Open
nriviera opened this issue Oct 18, 2019 · 2 comments
Open

PCR signalling in TS mux #635

nriviera opened this issue Oct 18, 2019 · 2 comments

Comments

@nriviera
Copy link

In a simple TS with one video es and one audio es, having the pcr_pid set equal to the video pid, led to a file that has some packet with random_access_filed = 1 but no pcr.
According to ISO/IEC 13818-1 "In the PCR_PID the random_access_indicator may only be set to '1' in Transport Stream packet containing the PCR fields."

I saw that the random access field is triggered in the multiplexer by the presence of the random field in the uref currently passing in the multiplexer, and that this field is set by the framer when it founds an IDR (I am using a h264 video stream).

A small and ugly patch in upipe_ts_encaps just where the tsaf_set_randomaccess is called can fix this (avoiding to set the random access field if there is no pcr), but I am not able to find and information related to the pcr_pid within the encapsulator, so maybe I am not getting the point of where it is managed.

Is this the point where the thing should be managed so I can write my own patch to propagate the pcr_pid information to the encapsulator and use it beside the tsaf_set_randomaccess or should it be addressed in a different way?

@nriviera
Copy link
Author

Well it seems easier, just changing

if (random)
    tsaf_set_randomaccess(buffer);

with

if ((random && !encaps->pcr_interval) || 
    (random && encaps->pcr_interval && pcr_prog!= UINT64_MAX))
       tsaf_set_randomaccess(buffer);

in upipe_ts_encaps_build_ts method does the trick.

@cmassiot
Copy link
Collaborator

I think you'd have it more readable with:
if (random && (!encaps->pcr_interval || pcr_progr != UINT64_MAX))
tsaf_set_randomaccess(buffer);

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants