Download python_embeded/Lib/site-packages/av/subtitles/codeccontext.pyx from hxrron/VTONmodels: direct link, hf CLI and curl.
- Browser
- Download file 656 Bytes
-
https://huggingface.co/hxrron/VTONmodels/resolve/main/python_embeded/Lib/site-packages/av/subtitles/codeccontext.pyx
- Command line
-
hf download hf://hxrron/VTONmodels/python_embeded/Lib/site-packages/av/subtitles/codeccontext.pyx
-
curl -L -o codeccontext.pyx https://huggingface.co/hxrron/VTONmodels/resolve/main/python_embeded/Lib/site-packages/av/subtitles/codeccontext.pyx
656 Bytes
| cimport libav as lib | |
| from av.error cimport err_check | |
| from av.packet cimport Packet | |
| from av.subtitles.subtitle cimport SubtitleProxy, SubtitleSet | |
| cdef class SubtitleCodecContext(CodecContext): | |
| cdef _send_packet_and_recv(self, Packet packet): | |
| if packet is None: | |
| raise RuntimeError("packet cannot be None") | |
| cdef SubtitleProxy proxy = SubtitleProxy() | |
| cdef int got_frame = 0 | |
| err_check( | |
| lib.avcodec_decode_subtitle2(self.ptr, &proxy.struct, &got_frame, packet.ptr) | |
| ) | |
| if got_frame: | |
| return [SubtitleSet(proxy)] | |
| else: | |
| return [] | |