encoding-profiles.conf.bak 9.0 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263
  1. #
  2. # mpv configuration file
  3. #
  4. #########################
  5. # encoding profile file #
  6. #########################
  7. #
  8. # Note: by default, this file is installed to /etc/mpv/encoding-profiles.conf
  9. # (or a different location, depending on --prefix). mpv will load it by
  10. # default on program start. If ~/.mpv/encoding-profiles.conf exists, this file
  11. # will be loaded instead.
  12. #
  13. # Then, list all profiles by
  14. # mpv -profile help | grep enc-
  15. #
  16. # The following kinds of encoding profiles exist:
  17. # enc-a-*: initialize an audio codec including good defaults
  18. # enc-v-*: initialize a video codec including good defaults
  19. # enc-f-*: initialize a file format including good defaults, including
  20. # selecting and initializing a good audio and video codec
  21. # enc-to-*: load known good settings for a target device; this typically
  22. # includes selecting an enc-f-* profile, then adjusting some
  23. # settings like frame rate, resolution and codec parameters
  24. #
  25. # AFTER including a profile of these, you can of course still change
  26. # options, or even switch to another codec.
  27. #
  28. # You can view the exact options a profile sets by
  29. # mpv -show-profile enc-to-bb-9000
  30. #
  31. # Examples:
  32. # mpv -profile enc-to-dvdpal -o outfile.mpg infile.mkv
  33. # mpv -profile enc-f-avi -ofps 30 -o outfile.avi infile.mkv
  34. # mpv -profile enc-v-mpeg4 -ovcopts-add qscale=7 -profile enc-a-mp3 -oacopts-add b=320k -o outfile.avi infile.mkv
  35. ################
  36. # audio codecs #
  37. ################
  38. [enc-a-aac]
  39. profile-desc = "AAC (libfaac or FFmpeg)"
  40. oac = libfdk_aac,libfaac,libvo_aacenc,aac
  41. oacopts = b=96k
  42. [enc-a-ac3]
  43. profile-desc = "AC3 (FFmpeg)"
  44. oac = ac3
  45. oacopts = b=448k
  46. [enc-a-mp3]
  47. profile-desc = "MP3 (LAME)"
  48. oac = libmp3lame
  49. oacopts = b=128k
  50. [enc-a-vorbis]
  51. profile-desc = "Vorbis (libvorbis)"
  52. oac = libvorbis,vorbis
  53. oacopts = qscale=3
  54. ################
  55. # video codecs #
  56. ################
  57. [enc-v-h263]
  58. profile-desc = "H.263 (FFmpeg)"
  59. ovc = h263
  60. ovcopts = qscale=4
  61. [enc-v-h264]
  62. profile-desc = "H.264 (x264)"
  63. ovc = libx264
  64. ovcopts = preset=medium,crf=23,threads=0
  65. vf-add = noformat=444p,noformat=444p9,noformat=444p10,noformat=422p,noformat=422p9,noformat=422p10
  66. [enc-v-mpeg2]
  67. profile-desc = "MPEG-2 Video (FFmpeg)"
  68. ovc = mpeg2video
  69. ovcopts-clr = yes
  70. [enc-v-mpeg4]
  71. profile-desc = "MPEG-4 Part 2 (FFmpeg)"
  72. ovc = mpeg4
  73. ovcopts = qscale=4
  74. [enc-v-vp8]
  75. profile-desc = "VP8 (libvpx)"
  76. ovc = libvpx
  77. ovcopts = qmin=4,b=10000000k # ought to be enough for anyone; for CBR use, set b=; for VBR use, set qmin= to quality
  78. ###########
  79. # formats #
  80. ###########
  81. [enc-f-3gp]
  82. profile-desc = "H.263 + AAC (for 3GP)"
  83. of = 3gp
  84. ocopyts = yes
  85. profile = enc-v-h263
  86. profile = enc-a-aac
  87. ofopts-clr = yes
  88. [enc-f-avi]
  89. profile-desc = "MPEG-4 + MP3 (for AVI)"
  90. of = avi
  91. ocopyts = no
  92. oautofps = yes
  93. profile = enc-v-mpeg4
  94. profile = enc-a-mp3
  95. ofopts-clr = yes
  96. [enc-f-mp4]
  97. profile-desc = "H.264 + AAC (for MP4)"
  98. of = mp4
  99. ocopyts = yes
  100. profile = enc-v-h264
  101. profile = enc-a-aac
  102. ofopts-clr = yes
  103. [enc-f-webm]
  104. profile-desc = "VP8 + Vorbis (for WebM)"
  105. of = webm
  106. ocopyts = yes
  107. profile = enc-v-vp8
  108. profile = enc-a-vorbis
  109. ofopts-clr = yes
  110. ##################
  111. # target devices #
  112. ##################
  113. [enc-to-dvdpal]
  114. profile-desc = "DVD-Video PAL, use dvdauthor -v pal -a ac3+en (MUST be used with 4:3 or 16:9 aspect, and 720x576, 704x576, 352x576 or 352x288 resolution)"
  115. profile = enc-v-mpeg2
  116. profile = enc-a-ac3
  117. of = dvd
  118. ofopts-add = packetsize=2048,muxrate=10080000
  119. ofps = 25
  120. oharddup = yes
  121. ovfirst = yes # dvdauthor needs this
  122. audio-samplerate = 48000
  123. ovcopts-add = g=15,b=6000000,maxrate=9000000,minrate=0,bufsize=1835008
  124. [enc-to-dvdntsc]
  125. profile-desc = "DVD-Video NTSC, use dvdauthor -v ntsc -a ac3+en (MUST be used with 4:3 or 16:9 aspect, and 720x480, 704x480, 352x480 or 352x240 resolution)"
  126. profile = enc-v-mpeg2
  127. profile = enc-a-ac3
  128. of = dvd
  129. ofopts-add = packetsize=2048,muxrate=10080000
  130. ofps = 24000/1001
  131. oharddup = yes
  132. ovfirst = yes # dvdauthor needs this
  133. audio-samplerate = 48000
  134. ovcopts-add = g=18,b=6000000,maxrate=9000000,minrate=0,bufsize=1835008
  135. [enc-to-bb-9000]
  136. profile-desc = "MP4 for Blackberry Bold 9000"
  137. profile = enc-f-mp4
  138. vf-add = dsize=480:360:0:2,scale=w=0:h=0,dsize=-1:-1 # native screen res, letterbox
  139. ovcopts-add = maxrate=1500k,bufsize=1000k,rc_init_occupancy=900k,refs=1,profile=baseline
  140. omaxfps = 30
  141. [enc-to-nok-n900]
  142. profile-desc = "MP4 for Nokia N900"
  143. profile = enc-f-mp4
  144. # DW = 800, DH = 480, SAR = 1
  145. vf-add = lavfi=graph="scale=floor(min(min(800\,dar*480)\,in_w*max(1\,sar))/2+0.5)*2:floor(min(min(800/dar\,480)\,in_h*max(1/sar\,1))/2+0.5)*2,setsar=sar=1"
  146. ovcopts-add = profile=baseline,level=30,maxrate=10000k,bufsize=10000k,rc_init_occupancy=9000k,refs=5
  147. omaxfps = 30
  148. [enc-to-nok-6300]
  149. profile-desc = "3GP for Nokia 6300"
  150. profile = enc-f-3gp
  151. ofps = 25
  152. vf-add = scale=w=176:h=144
  153. audio-samplerate = 16000
  154. audio-channels = 1
  155. oacopts-add = b=32k
  156. [enc-to-psp]
  157. profile-desc = "MP4 for PlayStation Portable"
  158. profile = enc-f-mp4
  159. ofps = 30000/1001
  160. vf-add = scale=w=480:h=272,dsize=480:270
  161. audio-samplerate = 48000
  162. audio-channels = 2
  163. ovcopts-add = b=512k,profile=baseline
  164. [enc-to-iphone-noscale]
  165. profile-desc = "MP4 for iPhone (no scaling)"
  166. profile = enc-f-mp4
  167. oautofps = yes # iphone supports 30fps max
  168. ovcopts-add = maxrate=2500k,bufsize=1000k,rc_init_occupancy=900k,level=30,profile=baseline
  169. omaxfps = 30
  170. [enc-to-iphone]
  171. profile-desc = "MP4 for iPhone (480x320)"
  172. profile = enc-to-iphone-noscale
  173. vf-add = dsize=480:320:1:2,scale=w=0:h=0,dsize=-1:-1 # panscan
  174. omaxfps = 30
  175. [enc-to-iphone-4]
  176. profile-desc = "MP4 for iPhone 4 (960x640)"
  177. profile = enc-to-iphone-noscale
  178. vf-add = dsize=960:480:1:2,scale=w=0:h=0,dsize=-1:-1 # panscan
  179. omaxfps = 30
  180. [enc-to-iphone-5]
  181. profile-desc = "MP4 for iPhone 5 (1136x640)"
  182. profile = enc-to-iphone-noscale
  183. vf-add = dsize=1136:480:1:2,scale=w=0:h=0,dsize=-1:-1 # panscan
  184. omaxfps = 30
  185. [enc-to-hp-slate-7]
  186. profile-desc = "MP4 for HP Slate 7 (1024x600, crazy aspect)"
  187. profile = enc-f-mp4
  188. omaxfps = 30
  189. ovcopts-add = profile=high
  190. # DW = 1024, DH = 600, DAR = 97:54 (=> SAR = 2425:2304)
  191. vf-add = lavfi=graph="scale=floor(min(1024*min(1\,dar/(97/54))\,in_w*max(1\,sar/(2425/2304)))/2+0.5)*2:floor(min(600*min((97/54)/dar\,1)\,in_h*max((2425/2304)/sar\,1))/2+0.5)*2,setsar=sar=1"
  192. [enc-to-hp-slate-7-git]
  193. profile-desc = "MP4 for HP Slate 7 (1024x600, crazy aspect), FFmpeg-git"
  194. profile = enc-f-mp4
  195. omaxfps = 30
  196. ovcopts-add = profile=high
  197. # DW = 1024, DH = 600, DAR = 97:54 (=> SAR = 2425:2304)
  198. vf-add = lavfi=graph="scale=floor(min(1024*min(1\,dar/(97/54))\,in_w)/2+0.5)*2:floor(min(600*min((97/54)/dar\,1)\,in_h)/2+0.5)*2,setsar=sar=sar/(2425/2304)"
  199. # Advanced scaling for specific output devices - how it works:
  200. # DW = display width (px) (1024)
  201. # DH = display height (px) (600)
  202. # SAR = display sample aspect ratio, i.e. DAR * DH / DW (2425:2304)
  203. # DAR = display aspect ratio, i.e. SAR * DW / DH (97:54)
  204. # Variant: zoomed out
  205. # vf-add = lavfi=graph="scale=floor(min(DW*min(1\,dar/DAR)\,in_w*max(1\,sar/SAR))/2+0.5)*2:floor(min(DH*min(DAR/dar\,1)\,in_h*max(SAR/sar\,1))/2+0.5)*2,setsar=sar=1"
  206. # Variant: zoomed in
  207. # vf-add = lavfi=graph="scale=floor(min(DW*max(1\,dar/DAR)\,in_w*max(1\,sar/SAR))/2+0.5)*2:floor(min(DH*max(DAR/dar\,1)\,in_h*max(SAR/sar\,1))/2+0.5)*2,setsar=sar=1"
  208. # How it works:
  209. # 1a: DW, DH*dar/DAR - fit to display width
  210. # 1b: DH*DAR/dar, DH - fit to display height
  211. # 1: the min of 1a and 1b these (i.e. fit inside both width and height); for zoomed in view, use the max
  212. # 2a: in_w, in_h*SAR/sar - fit to original width
  213. # 2b: in_w*sar/SAR, in_h - fit to original height
  214. # 2: the max of 2a and 2b (i.e. avoid enlarging both dimensions - let HW scaling handle this)
  215. # output: the min of 1 and 2 (i.e. fulfill both constraints)
  216. # setsar=sar=1 to prevent scaling on the device (skip this if the device actually wants the proper SAR to be specified for not performing needless scaling)
  217. #
  218. # Simplified special case for SAR == 1, DAR == DW/DH:
  219. # Variant: zoomed out
  220. # vf-add = lavfi=graph="scale=floor(min(min(DW\,dar*DH)\,in_w*max(1\,sar))/2+0.5)*2:floor(min(min(DW/dar\,DH)\,in_h*max(1/sar\,1))/2+0.5)*2,setsar=sar=1"
  221. # Variant: zoomed in
  222. # vf-add = lavfi=graph="scale=floor(min(max(DW\,dar*DH)\,in_w*max(1\,sar))/2+0.5)*2:floor(min(max(DW/dar\,DH)\,in_h*max(1/sar\,1))/2+0.5)*2,setsar=sar=1"
  223. # setsar=sar=1 to prevent nasty almost-1 SAR to be passed to the codec due to the rounding which can fail
  224. #
  225. # If the device supports file SAR properly, we can make use of it to avoid
  226. # upscaling. The setsar=sar=sar/SAR at the end serves to fake the SAR for devices that don't know their own display's SAR.
  227. # Variant: zoomed out
  228. # vf-add = lavfi=graph="scale=floor(min(DW*min(1\,dar/DAR)\,in_w)/2+0.5)*2:floor(min(DH*min(DAR/dar\,1)\,in_h)/2+0.5)*2,setsar=sar=sar/SAR"
  229. # Variant: zoomed in
  230. # vf-add = lavfi=graph="scale=floor(min(DW*max(1\,dar/DAR)\,in_w)/2+0.5)*2:floor(min(DH*max(DAR/dar\,1)\,in_h)/2+0.5)*2,setsar=sar=sar/SAR"
  231. # Simplified special case for SAR == 1, DAR == DW/DH:
  232. # Variant: zoomed out
  233. # vf-add = lavfi=graph="scale=floor(min(min(DW\,dar*DH)\,in_w)/2+0.5)*2:floor(min(min(DW/dar\,DH)\,in_h)/2+0.5)*2"
  234. # Variant: zoomed in
  235. # vf-add = lavfi=graph="scale=floor(min(max(DW\,dar*DH)\,in_w)/2+0.5)*2:floor(min(max(DW/dar\,DH)\,in_h)/2+0.5)*2"