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

Make mpeg4 clock rate configurable #693

Closed
wants to merge 2 commits into from

Conversation

hexbabe
Copy link

@hexbabe hexbabe commented Feb 7, 2025

What

1.	Added SampleRate Field: A new field SampleRate of type int has been added to the MPEG4Video struct.
2.	Updated ClockRate Method: The ClockRate method now returns the value of f.SampleRate instead of a hardcoded value of 90000.
3.	Updated RTPMap Method: The RTPMap method has been modified to return a string that includes the SampleRate, formatted as "MP4V-ES/<SampleRate>".

Why

These changes enhance the flexibility and accuracy of the MPEG4Video implementation by allowing the SampleRate to be dynamically set and retrieved. This is crucial for older cameras that support lower clock rates e.g. 30000.

@hexbabe
Copy link
Author

hexbabe commented Feb 7, 2025

@aler9 Hi Alessandro, hope you are having a nice day :)

Just pinging you here so this is on your radar!

@aler9
Copy link
Member

aler9 commented Feb 7, 2025

@hexbabe we can of course add support for older cameras but are you sure that the real rate of the MPEG-4 stream (not the one written inside the SDP) is 30khz and not 90khz? i performed a quick search in FFmpeg and i found that MP4V/90000 is practically embedded into the code, so there's no support for such scenario. In my opinion it's just an error in the SDP (which we can fix).

@hexbabe
Copy link
Author

hexbabe commented Feb 7, 2025

@hexbabe we can of course add support for older cameras but are you sure that the real rate of the MPEG-4 stream (not the one written inside the SDP) is 30khz and not 90khz? i performed a quick search in FFmpeg and i found that MP4V/90000 is practically embedded into the code, so there's no support for such scenario. In my opinion it's just an error in the SDP (which we can fix).

Thanks for the information. I'm going to double check with some extra manual tests with the camera in question to see if omitting the clock rate is affecting the playback of the stream.

@hexbabe
Copy link
Author

hexbabe commented Feb 11, 2025

Thanks for the info again. I tested that the stream looks healthy with the 90K clock rate. Closing

@hexbabe hexbabe closed this Feb 11, 2025
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

Successfully merging this pull request may close these issues.

2 participants