Commit Graph

17 Commits (master)

Author SHA1 Message Date
jpark37 6494d46111 libobs: Use nal_ref_idc for H.264 priority
H.264 spec only mentions zero/non-zero, but RFC 6184 uses 0/1/2/3 values
for prioritization. Go back to reading packet field for priority.
2022-08-17 05:30:16 -07:00
jpark37 0e5420750b libobs: Implement H.264/HEVC priority parsing
Parsing priority while serializing/discarding packet data is too gross.
2022-08-01 08:15:29 -07:00
jpark37 55f35d1d89 libobs: Consolidate H.264 priority scheme
The spec for nal_ref_idc doesn't indicate that it should be used for
priority like x264 seems to be using it for. NVENC seems to pass
different values, so let's not rely on it.

The new scheme might be naive, but we can iterate on it, and apply
evenly to all H.264 encoders.
2022-07-31 17:38:25 -07:00
Jim 84e6d77ad5 Revert "libobs: Allow null sei in obs_extract_avc_headers"
This reverts commit baa8d03f78.
2022-04-22 17:00:55 -07:00
jp9000 baa8d03f78 libobs: Allow null sei in obs_extract_avc_headers 2022-04-22 12:48:09 -07:00
jpark37 76893fb7b9 libobs: Add HEVC parsing functions
Also create obs_nal_find_startcode from obs_avc_find_startcode to share
with HEVC functions.
2022-03-19 15:46:34 -07:00
jp9000 f53df7da64 clang-format: Apply formatting
Code submissions have continually suffered from formatting
inconsistencies that constantly have to be addressed.  Using
clang-format simplifies this by making code formatting more consistent,
and allows automation of the code formatting so that maintainers can
focus more on the code itself instead of code formatting.
2019-06-23 23:49:10 -07:00
jp9000 fba152aed9 libobs: Fix bug in AVC encoder packet allocation
Meant to subtract the ref size, not add.  This is what one gets for
"clever" coding tricks.
2016-12-24 03:44:13 -08:00
jp9000 50773499a1 libobs: Create referenced parsed AVC encoder packet
When creating an encoder packet via obs_parse_avc_packet, make sure to
create a proper referenced encoder packet
2016-12-24 03:01:50 -08:00
jp9000 4c2a49285e Revert "libobs: Ensure AVC priority is always highest for keyframes"
This reverts commit 66525632a0.
2016-11-14 17:43:37 -08:00
jp9000 66525632a0 libobs: Ensure AVC priority is always highest for keyframes 2016-11-13 16:29:06 -08:00
jp9000 7d5df34a6b libobs: Do not set p-frames to highest priority
P-frames were initially set as highest priority to prevent them from
being dropped (not sure what the rationale was behind this), but this
caused a problem where if there's too much congestion for whatever
reason data will continue to stay buffered, so to prevent this p-frames
should be droppable.
2016-08-13 01:24:47 -07:00
jp9000 1a38d779c9 libobs: Add function to extract AVC header/sei
Allows extraction of headers/sei from a frame so that an encoder can
separate those headers and provide them for later use.
2016-04-19 08:29:24 -07:00
jp9000 9f97b02c32 libobs: Add function to determine AVC keyframes
Added obs_avc_keyframe that returns whether an avc packet is a keyframe
or not.  This function is particularly useful for when writing custom
encoder plugins.
2014-12-21 10:14:22 -08:00
jp9000 f8e56a4e1e libobs: Expose NAL enums in obs-avc.h
I encountered some cases where I needed to use these enumerations
outside of the file, so this allows other modules to use AVC
enumerations without having to redefine them each time.  Especially
useful for custom encoder modules.
2014-12-21 10:14:21 -08:00
jp9000 4a652ec82d obs-output module: Fill out more functions
- Add start/stop code to obs-output module

 - Use a circular buffer for the buffered encoder packets instead of a
   dynamic array

 - Add pthreads.lib as a dependency to obs-output module on windows in
   visual studio project files

 - Fix an windows export bug for avc parsing functions on windows.
   Also, rename those functions to be more consistent with each other.

 - Make outputs use a single function for encoded data rather than
   multiple functions

 - Add the ability to make 'text' properties be passworded
2014-04-02 00:42:12 -07:00
jp9000 0cf9e0cfdd Add preliminary FLV/RTMP output (incomplete)
- obs-outputs module:  Add preliminary code to send out data, and add
   an FLV muxer.  This time we don't really need to build the packets
   ourselves, we can just use the FLV muxer and send it directly to
   RTMP_Write and it should automatically parse the entire stream for us
   without us having to do much manual code at all.  We'll see how it
   goes.

 - libobs:  Add AVC NAL packet parsing code

 - libobs/media-io:  Add quick helper functions for audio/video to get
   the width/height/fps/samplerate/etc rather than having to query the
   info structures each time.

 - libobs (obs-output.c):  Change 'connect' signal to 'start' and 'stop'
   signals.  'start' now specifies an error code rather than whether it
   simply failed, that way the client can actually know *why* a failure
   occurred.  Added those error codes to obs-defs.h.

 - libobs:  Add a few functions to duplicate/free encoder packets
2014-04-01 11:55:18 -07:00