rawenc.c 7.7 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257
  1. /*
  2. * RAW muxers
  3. * Copyright (c) 2001 Fabrice Bellard
  4. * Copyright (c) 2005 Alex Beregszaszi
  5. *
  6. * This file is part of FFmpeg.
  7. *
  8. * FFmpeg is free software; you can redistribute it and/or
  9. * modify it under the terms of the GNU Lesser General Public
  10. * License as published by the Free Software Foundation; either
  11. * version 2.1 of the License, or (at your option) any later version.
  12. *
  13. * FFmpeg is distributed in the hope that it will be useful,
  14. * but WITHOUT ANY WARRANTY; without even the implied warranty of
  15. * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
  16. * Lesser General Public License for more details.
  17. *
  18. * You should have received a copy of the GNU Lesser General Public
  19. * License along with FFmpeg; if not, write to the Free Software
  20. * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
  21. */
  22. #include "avformat.h"
  23. #include "rawenc.h"
  24. int ff_raw_write_packet(AVFormatContext *s, AVPacket *pkt)
  25. {
  26. avio_write(s->pb, pkt->data, pkt->size);
  27. avio_flush(s->pb);
  28. return 0;
  29. }
  30. /* Note: Do not forget to add new entries to the Makefile as well. */
  31. #if CONFIG_AC3_MUXER
  32. AVOutputFormat ff_ac3_muxer = {
  33. .name = "ac3",
  34. .long_name = NULL_IF_CONFIG_SMALL("raw AC-3"),
  35. .mime_type = "audio/x-ac3",
  36. .extensions = "ac3",
  37. .audio_codec = CODEC_ID_AC3,
  38. .video_codec = CODEC_ID_NONE,
  39. .write_packet = ff_raw_write_packet,
  40. .flags= AVFMT_NOTIMESTAMPS,
  41. };
  42. #endif
  43. #if CONFIG_DIRAC_MUXER
  44. AVOutputFormat ff_dirac_muxer = {
  45. .name = "dirac",
  46. .long_name = NULL_IF_CONFIG_SMALL("raw Dirac"),
  47. .extensions = "drc",
  48. .audio_codec = CODEC_ID_NONE,
  49. .video_codec = CODEC_ID_DIRAC,
  50. .write_packet = ff_raw_write_packet,
  51. .flags= AVFMT_NOTIMESTAMPS,
  52. };
  53. #endif
  54. #if CONFIG_DNXHD_MUXER
  55. AVOutputFormat ff_dnxhd_muxer = {
  56. .name = "dnxhd",
  57. .long_name = NULL_IF_CONFIG_SMALL("raw DNxHD (SMPTE VC-3)"),
  58. .extensions = "dnxhd",
  59. .audio_codec = CODEC_ID_NONE,
  60. .video_codec = CODEC_ID_DNXHD,
  61. .write_packet = ff_raw_write_packet,
  62. .flags= AVFMT_NOTIMESTAMPS,
  63. };
  64. #endif
  65. #if CONFIG_DTS_MUXER
  66. AVOutputFormat ff_dts_muxer = {
  67. .name = "dts",
  68. .long_name = NULL_IF_CONFIG_SMALL("raw DTS"),
  69. .mime_type = "audio/x-dca",
  70. .extensions = "dts",
  71. .audio_codec = CODEC_ID_DTS,
  72. .video_codec = CODEC_ID_NONE,
  73. .write_packet = ff_raw_write_packet,
  74. .flags= AVFMT_NOTIMESTAMPS,
  75. };
  76. #endif
  77. #if CONFIG_EAC3_MUXER
  78. AVOutputFormat ff_eac3_muxer = {
  79. .name = "eac3",
  80. .long_name = NULL_IF_CONFIG_SMALL("raw E-AC-3"),
  81. .mime_type = "audio/x-eac3",
  82. .extensions = "eac3",
  83. .audio_codec = CODEC_ID_EAC3,
  84. .video_codec = CODEC_ID_NONE,
  85. .write_packet = ff_raw_write_packet,
  86. .flags= AVFMT_NOTIMESTAMPS,
  87. };
  88. #endif
  89. #if CONFIG_G722_MUXER
  90. AVOutputFormat ff_g722_muxer = {
  91. .name = "g722",
  92. .long_name = NULL_IF_CONFIG_SMALL("raw G.722"),
  93. .mime_type = "audio/G722",
  94. .extensions = "g722",
  95. .audio_codec = CODEC_ID_ADPCM_G722,
  96. .video_codec = CODEC_ID_NONE,
  97. .write_packet = ff_raw_write_packet,
  98. .flags= AVFMT_NOTIMESTAMPS,
  99. };
  100. #endif
  101. #if CONFIG_H261_MUXER
  102. AVOutputFormat ff_h261_muxer = {
  103. .name = "h261",
  104. .long_name = NULL_IF_CONFIG_SMALL("raw H.261"),
  105. .mime_type = "video/x-h261",
  106. .extensions = "h261",
  107. .audio_codec = CODEC_ID_NONE,
  108. .video_codec = CODEC_ID_H261,
  109. .write_packet = ff_raw_write_packet,
  110. .flags= AVFMT_NOTIMESTAMPS,
  111. };
  112. #endif
  113. #if CONFIG_H263_MUXER
  114. AVOutputFormat ff_h263_muxer = {
  115. .name = "h263",
  116. .long_name = NULL_IF_CONFIG_SMALL("raw H.263"),
  117. .mime_type = "video/x-h263",
  118. .extensions = "h263",
  119. .audio_codec = CODEC_ID_NONE,
  120. .video_codec = CODEC_ID_H263,
  121. .write_packet = ff_raw_write_packet,
  122. .flags= AVFMT_NOTIMESTAMPS,
  123. };
  124. #endif
  125. #if CONFIG_H264_MUXER
  126. AVOutputFormat ff_h264_muxer = {
  127. .name = "h264",
  128. .long_name = NULL_IF_CONFIG_SMALL("raw H.264 video format"),
  129. .extensions = "h264",
  130. .audio_codec = CODEC_ID_NONE,
  131. .video_codec = CODEC_ID_H264,
  132. .write_packet = ff_raw_write_packet,
  133. .flags= AVFMT_NOTIMESTAMPS,
  134. };
  135. #endif
  136. #if CONFIG_CAVSVIDEO_MUXER
  137. AVOutputFormat ff_cavsvideo_muxer = {
  138. .name = "cavsvideo",
  139. .long_name = NULL_IF_CONFIG_SMALL("raw Chinese AVS video"),
  140. .extensions = "cavs",
  141. .audio_codec = CODEC_ID_NONE,
  142. .video_codec = CODEC_ID_CAVS,
  143. .write_packet = ff_raw_write_packet,
  144. .flags= AVFMT_NOTIMESTAMPS,
  145. };
  146. #endif
  147. #if CONFIG_M4V_MUXER
  148. AVOutputFormat ff_m4v_muxer = {
  149. .name = "m4v",
  150. .long_name = NULL_IF_CONFIG_SMALL("raw MPEG-4 video format"),
  151. .extensions = "m4v",
  152. .audio_codec = CODEC_ID_NONE,
  153. .video_codec = CODEC_ID_MPEG4,
  154. .write_packet = ff_raw_write_packet,
  155. .flags= AVFMT_NOTIMESTAMPS,
  156. };
  157. #endif
  158. #if CONFIG_MJPEG_MUXER
  159. AVOutputFormat ff_mjpeg_muxer = {
  160. .name = "mjpeg",
  161. .long_name = NULL_IF_CONFIG_SMALL("raw MJPEG video"),
  162. .mime_type = "video/x-mjpeg",
  163. .extensions = "mjpg,mjpeg",
  164. .audio_codec = CODEC_ID_NONE,
  165. .video_codec = CODEC_ID_MJPEG,
  166. .write_packet = ff_raw_write_packet,
  167. .flags= AVFMT_NOTIMESTAMPS,
  168. };
  169. #endif
  170. #if CONFIG_MLP_MUXER
  171. AVOutputFormat ff_mlp_muxer = {
  172. .name = "mlp",
  173. .long_name = NULL_IF_CONFIG_SMALL("raw MLP"),
  174. .extensions = "mlp",
  175. .audio_codec = CODEC_ID_MLP,
  176. .video_codec = CODEC_ID_NONE,
  177. .write_packet = ff_raw_write_packet,
  178. .flags= AVFMT_NOTIMESTAMPS,
  179. };
  180. #endif
  181. #if CONFIG_SRT_MUXER
  182. AVOutputFormat ff_srt_muxer = {
  183. .name = "srt",
  184. .long_name = NULL_IF_CONFIG_SMALL("SubRip subtitle format"),
  185. .mime_type = "application/x-subrip",
  186. .extensions = "srt",
  187. .write_packet = ff_raw_write_packet,
  188. .flags = AVFMT_NOTIMESTAMPS,
  189. .subtitle_codec = CODEC_ID_SRT,
  190. };
  191. #endif
  192. #if CONFIG_TRUEHD_MUXER
  193. AVOutputFormat ff_truehd_muxer = {
  194. .name = "truehd",
  195. .long_name = NULL_IF_CONFIG_SMALL("raw TrueHD"),
  196. .extensions = "thd",
  197. .audio_codec = CODEC_ID_TRUEHD,
  198. .video_codec = CODEC_ID_NONE,
  199. .write_packet = ff_raw_write_packet,
  200. .flags= AVFMT_NOTIMESTAMPS,
  201. };
  202. #endif
  203. #if CONFIG_MPEG1VIDEO_MUXER
  204. AVOutputFormat ff_mpeg1video_muxer = {
  205. .name = "mpeg1video",
  206. .long_name = NULL_IF_CONFIG_SMALL("raw MPEG-1 video"),
  207. .mime_type = "video/x-mpeg",
  208. .extensions = "mpg,mpeg,m1v",
  209. .audio_codec = CODEC_ID_NONE,
  210. .video_codec = CODEC_ID_MPEG1VIDEO,
  211. .write_packet = ff_raw_write_packet,
  212. .flags= AVFMT_NOTIMESTAMPS,
  213. };
  214. #endif
  215. #if CONFIG_MPEG2VIDEO_MUXER
  216. AVOutputFormat ff_mpeg2video_muxer = {
  217. .name = "mpeg2video",
  218. .long_name = NULL_IF_CONFIG_SMALL("raw MPEG-2 video"),
  219. .extensions = "m2v",
  220. .audio_codec = CODEC_ID_NONE,
  221. .video_codec = CODEC_ID_MPEG2VIDEO,
  222. .write_packet = ff_raw_write_packet,
  223. .flags= AVFMT_NOTIMESTAMPS,
  224. };
  225. #endif
  226. #if CONFIG_RAWVIDEO_MUXER
  227. AVOutputFormat ff_rawvideo_muxer = {
  228. .name = "rawvideo",
  229. .long_name = NULL_IF_CONFIG_SMALL("raw video format"),
  230. .extensions = "yuv,rgb",
  231. .audio_codec = CODEC_ID_NONE,
  232. .video_codec = CODEC_ID_RAWVIDEO,
  233. .write_packet = ff_raw_write_packet,
  234. .flags= AVFMT_NOTIMESTAMPS,
  235. };
  236. #endif