mp4-mux.h 1.7 KB

12345678910111213141516171819202122232425262728293031323334353637383940
  1. /******************************************************************************
  2. Copyright (C) 2024 by Dennis Sädtler <[email protected]>
  3. This program is free software: you can redistribute it and/or modify
  4. it under the terms of the GNU General Public License as published by
  5. the Free Software Foundation, either version 2 of the License, or
  6. (at your option) any later version.
  7. This program is distributed in the hope that it will be useful,
  8. but WITHOUT ANY WARRANTY; without even the implied warranty of
  9. MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
  10. GNU General Public License for more details.
  11. You should have received a copy of the GNU General Public License
  12. along with this program. If not, see <http://www.gnu.org/licenses/>.
  13. ******************************************************************************/
  14. #pragma once
  15. #include <obs.h>
  16. #include <util/serializer.h>
  17. struct mp4_mux;
  18. enum mp4_mux_flags {
  19. /* Uses mdta key/value list for metadata instead of QuickTime keys */
  20. MP4_USE_MDTA_KEY_VALUE = 1 << 0,
  21. /* Write encoder configuration to trak udat */
  22. MP4_WRITE_ENCODER_INFO = 1 << 1,
  23. /* Skip "soft-remux" and leave file in fragmented state */
  24. MP4_SKIP_FINALISATION = 1 << 2,
  25. /* Use negative CTS instead of edit lists */
  26. MP4_USE_NEGATIVE_CTS = 1 << 3,
  27. };
  28. struct mp4_mux *mp4_mux_create(obs_output_t *output, struct serializer *serializer, enum mp4_mux_flags flags);
  29. void mp4_mux_destroy(struct mp4_mux *mux);
  30. bool mp4_mux_submit_packet(struct mp4_mux *mux, struct encoder_packet *pkt);
  31. bool mp4_mux_add_chapter(struct mp4_mux *mux, int64_t dts_usec, const char *name);
  32. bool mp4_mux_finalise(struct mp4_mux *mux);