video.scm 94 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667668669670671672673674675676677678679680681682683684685686687688689690691692693694695696697698699700701702703704705706707708709710711712713714715716717718719720721722723724725726727728729730731732733734735736737738739740741742743744745746747748749750751752753754755756757758759760761762763764765766767768769770771772773774775776777778779780781782783784785786787788789790791792793794795796797798799800801802803804805806807808809810811812813814815816817818819820821822823824825826827828829830831832833834835836837838839840841842843844845846847848849850851852853854855856857858859860861862863864865866867868869870871872873874875876877878879880881882883884885886887888889890891892893894895896897898899900901902903904905906907908909910911912913914915916917918919920921922923924925926927928929930931932933934935936937938939940941942943944945946947948949950951952953954955956957958959960961962963964965966967968969970971972973974975976977978979980981982983984985986987988989990991992993994995996997998999100010011002100310041005100610071008100910101011101210131014101510161017101810191020102110221023102410251026102710281029103010311032103310341035103610371038103910401041104210431044104510461047104810491050105110521053105410551056105710581059106010611062106310641065106610671068106910701071107210731074107510761077107810791080108110821083108410851086108710881089109010911092109310941095109610971098109911001101110211031104110511061107110811091110111111121113111411151116111711181119112011211122112311241125112611271128112911301131113211331134113511361137113811391140114111421143114411451146114711481149115011511152115311541155115611571158115911601161116211631164116511661167116811691170117111721173117411751176117711781179118011811182118311841185118611871188118911901191119211931194119511961197119811991200120112021203120412051206120712081209121012111212121312141215121612171218121912201221122212231224122512261227122812291230123112321233123412351236123712381239124012411242124312441245124612471248124912501251125212531254125512561257125812591260126112621263126412651266126712681269127012711272127312741275127612771278127912801281128212831284128512861287128812891290129112921293129412951296129712981299130013011302130313041305130613071308130913101311131213131314131513161317131813191320132113221323132413251326132713281329133013311332133313341335133613371338133913401341134213431344134513461347134813491350135113521353135413551356135713581359136013611362136313641365136613671368136913701371137213731374137513761377137813791380138113821383138413851386138713881389139013911392139313941395139613971398139914001401140214031404140514061407140814091410141114121413141414151416141714181419142014211422142314241425142614271428142914301431143214331434143514361437143814391440144114421443144414451446144714481449145014511452145314541455145614571458145914601461146214631464146514661467146814691470147114721473147414751476147714781479148014811482148314841485148614871488148914901491149214931494149514961497149814991500150115021503150415051506150715081509151015111512151315141515151615171518151915201521152215231524152515261527152815291530153115321533153415351536153715381539154015411542154315441545154615471548154915501551155215531554155515561557155815591560156115621563156415651566156715681569157015711572157315741575157615771578157915801581158215831584158515861587158815891590159115921593159415951596159715981599160016011602160316041605160616071608160916101611161216131614161516161617161816191620162116221623162416251626162716281629163016311632163316341635163616371638163916401641164216431644164516461647164816491650165116521653165416551656165716581659166016611662166316641665166616671668166916701671167216731674167516761677167816791680168116821683168416851686168716881689169016911692169316941695169616971698169917001701170217031704170517061707170817091710171117121713171417151716171717181719172017211722172317241725172617271728172917301731173217331734173517361737173817391740174117421743174417451746174717481749175017511752175317541755175617571758175917601761176217631764176517661767176817691770177117721773177417751776177717781779178017811782178317841785178617871788178917901791179217931794179517961797179817991800180118021803180418051806180718081809181018111812181318141815181618171818181918201821182218231824182518261827182818291830183118321833183418351836183718381839184018411842184318441845184618471848184918501851185218531854185518561857185818591860186118621863186418651866186718681869187018711872187318741875187618771878187918801881188218831884188518861887188818891890189118921893189418951896189718981899190019011902190319041905190619071908190919101911191219131914191519161917191819191920192119221923192419251926192719281929193019311932193319341935193619371938193919401941194219431944194519461947194819491950195119521953195419551956195719581959196019611962196319641965196619671968196919701971197219731974197519761977197819791980198119821983198419851986198719881989199019911992199319941995199619971998199920002001200220032004200520062007200820092010201120122013201420152016201720182019202020212022202320242025202620272028202920302031203220332034203520362037203820392040204120422043204420452046204720482049205020512052205320542055205620572058205920602061206220632064206520662067206820692070207120722073207420752076207720782079208020812082208320842085208620872088208920902091209220932094209520962097209820992100210121022103210421052106210721082109211021112112211321142115211621172118211921202121212221232124212521262127212821292130213121322133213421352136213721382139214021412142214321442145214621472148214921502151215221532154215521562157215821592160216121622163216421652166216721682169217021712172217321742175217621772178217921802181218221832184218521862187218821892190219121922193219421952196219721982199220022012202220322042205220622072208220922102211221222132214221522162217221822192220222122222223222422252226222722282229223022312232223322342235223622372238223922402241224222432244224522462247224822492250225122522253225422552256225722582259226022612262226322642265226622672268226922702271227222732274227522762277227822792280228122822283228422852286228722882289229022912292229322942295229622972298229923002301230223032304230523062307230823092310231123122313231423152316231723182319232023212322232323242325232623272328232923302331233223332334233523362337233823392340234123422343234423452346234723482349235023512352235323542355235623572358235923602361236223632364236523662367236823692370237123722373237423752376237723782379238023812382238323842385
  1. ;;; GNU Guix --- Functional package management for GNU
  2. ;;; Copyright © 2013, 2014, 2015, 2016 Andreas Enge <andreas@enge.fr>
  3. ;;; Copyright © 2014, 2015, 2016 David Thompson <davet@gnu.org>
  4. ;;; Copyright © 2014, 2015, 2016 Mark H Weaver <mhw@netris.org>
  5. ;;; Copyright © 2015 Taylan Ulrich Bayırlı/Kammer <taylanbayirli@gmail.com>
  6. ;;; Copyright © 2015, 2016, 2017 Efraim Flashner <efraim@flashner.co.il>
  7. ;;; Copyright © 2015 Andy Patterson <ajpatter@uwaterloo.ca>
  8. ;;; Copyright © 2015 Ricardo Wurmus <rekado@elephly.net>
  9. ;;; Copyright © 2015, 2016, 2017 Alex Vong <alexvong1995@gmail.com>
  10. ;;; Copyright © 2016, 2017 Alex Griffin <a@ajgrf.com>
  11. ;;; Copyright © 2016 Kei Kebreau <kkebreau@posteo.net>
  12. ;;; Copyright © 2016 Dmitry Nikolaev <cameltheman@gmail.com>
  13. ;;; Copyright © 2016 Andy Patterson <ajpatter@uwaterloo.ca>
  14. ;;; Copyright © 2016, 2017 ng0 <contact.ng0@cryptolab.net>
  15. ;;; Copyright © 2016 Eric Bavier <bavier@member.fsf.org>
  16. ;;; Copyright © 2016 Jan Nieuwenhuizen <janneke@gnu.org>
  17. ;;; Copyright © 2017 Feng Shu <tumashu@163.com>
  18. ;;; Copyright © 2017 Tobias Geerinckx-Rice <me@tobias.gr>
  19. ;;; Copyright © 2017 Chris Marusich <cmmarusich@gmail.com>
  20. ;;; Copyright © 2017 Thomas Danckaert <post@thomasdanckaert.be>
  21. ;;; Copyright © 2017 Ethan R. Jones <doubleplusgood23@gmail.com>
  22. ;;; Copyright © 2017 Clément Lassieur <clement@lassieur.org>
  23. ;;; Copyright © 2017 Gregor Giesen <giesen@zaehlwerk.net>
  24. ;;;
  25. ;;; This file is part of GNU Guix.
  26. ;;;
  27. ;;; GNU Guix is free software; you can redistribute it and/or modify it
  28. ;;; under the terms of the GNU General Public License as published by
  29. ;;; the Free Software Foundation; either version 3 of the License, or (at
  30. ;;; your option) any later version.
  31. ;;;
  32. ;;; GNU Guix is distributed in the hope that it will be useful, but
  33. ;;; WITHOUT ANY WARRANTY; without even the implied warranty of
  34. ;;; MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
  35. ;;; GNU General Public License for more details.
  36. ;;;
  37. ;;; You should have received a copy of the GNU General Public License
  38. ;;; along with GNU Guix. If not, see <http://www.gnu.org/licenses/>.
  39. (define-module (gnu packages video)
  40. #:use-module (ice-9 match)
  41. #:use-module (srfi srfi-1)
  42. #:use-module ((guix licenses) #:prefix license:)
  43. #:use-module (guix utils)
  44. #:use-module (guix packages)
  45. #:use-module (guix download)
  46. #:use-module (guix git-download)
  47. #:use-module (guix svn-download)
  48. #:use-module (guix build-system cmake)
  49. #:use-module (guix build-system gnu)
  50. #:use-module (guix build-system glib-or-gtk)
  51. #:use-module (guix build-system python)
  52. #:use-module (guix build-system waf)
  53. #:use-module (gnu packages)
  54. #:use-module (gnu packages algebra)
  55. #:use-module (gnu packages audio)
  56. #:use-module (gnu packages autotools)
  57. #:use-module (gnu packages avahi)
  58. #:use-module (gnu packages base)
  59. #:use-module (gnu packages bison)
  60. #:use-module (gnu packages boost)
  61. #:use-module (gnu packages cdrom)
  62. #:use-module (gnu packages check)
  63. #:use-module (gnu packages cmake)
  64. #:use-module (gnu packages compression)
  65. #:use-module (gnu packages cpp)
  66. #:use-module (gnu packages curl)
  67. #:use-module (gnu packages databases)
  68. #:use-module (gnu packages dejagnu)
  69. #:use-module (gnu packages docbook)
  70. #:use-module (gnu packages elf)
  71. #:use-module (gnu packages file)
  72. #:use-module (gnu packages flex)
  73. #:use-module (gnu packages fontutils)
  74. #:use-module (gnu packages freedesktop)
  75. #:use-module (gnu packages fribidi)
  76. #:use-module (gnu packages gettext)
  77. #:use-module (gnu packages ghostscript)
  78. #:use-module (gnu packages gl)
  79. #:use-module (gnu packages glib)
  80. #:use-module (gnu packages guile)
  81. #:use-module (gnu packages gnome)
  82. #:use-module (gnu packages gnupg)
  83. #:use-module (gnu packages gstreamer)
  84. #:use-module (gnu packages gtk)
  85. #:use-module (gnu packages image)
  86. #:use-module (gnu packages imagemagick)
  87. #:use-module (gnu packages linux)
  88. #:use-module (gnu packages lua)
  89. #:use-module (gnu packages m4)
  90. #:use-module (gnu packages man)
  91. #:use-module (gnu packages mp3)
  92. #:use-module (gnu packages ncurses)
  93. #:use-module (gnu packages ocr)
  94. #:use-module (gnu packages perl)
  95. #:use-module (gnu packages pkg-config)
  96. #:use-module (gnu packages popt)
  97. #:use-module (gnu packages pulseaudio)
  98. #:use-module (gnu packages python)
  99. #:use-module (gnu packages qt)
  100. #:use-module (gnu packages ruby)
  101. #:use-module (gnu packages sdl)
  102. #:use-module (gnu packages serialization)
  103. #:use-module (gnu packages shells)
  104. #:use-module (gnu packages ssh)
  105. #:use-module (gnu packages texinfo)
  106. #:use-module (gnu packages textutils)
  107. #:use-module (gnu packages tls)
  108. #:use-module (gnu packages version-control)
  109. #:use-module (gnu packages web)
  110. #:use-module (gnu packages webkit)
  111. #:use-module (gnu packages wxwidgets)
  112. #:use-module (gnu packages xdisorg)
  113. #:use-module (gnu packages xiph)
  114. #:use-module (gnu packages xml)
  115. #:use-module (gnu packages xorg)
  116. #:use-module (gnu packages assembly))
  117. (define-public aalib
  118. (package
  119. (name "aalib")
  120. (version "1.4rc5")
  121. (source (origin
  122. (method url-fetch)
  123. (uri (string-append "mirror://sourceforge/aa-project/aa-lib/"
  124. version "/" name "-" version ".tar.gz"))
  125. (sha256
  126. (base32
  127. "1vkh19gb76agvh4h87ysbrgy82hrw88lnsvhynjf4vng629dmpgv"))))
  128. (build-system gnu-build-system)
  129. (native-inputs
  130. `(("makeinfo" ,texinfo)))
  131. (inputs
  132. `(("ncurses" ,ncurses)))
  133. (arguments
  134. `(#:phases
  135. (modify-phases %standard-phases
  136. (replace 'configure
  137. (lambda* (#:key build inputs outputs #:allow-other-keys)
  138. ;; This old `configure' script doesn't support
  139. ;; variables passed as arguments.
  140. (let ((out (assoc-ref outputs "out"))
  141. (ncurses (assoc-ref inputs "ncurses")))
  142. (setenv "CONFIG_SHELL" (which "bash"))
  143. (zero? (system* "./configure"
  144. (string-append "--prefix=" out)
  145. (string-append "--build=" build)
  146. ;; The ancient config.guess is unable to
  147. ;; guess the host triplet on mips64el.
  148. ,@(if (string=? "mips64el-linux"
  149. (%current-system))
  150. '("--host=mips64el-unknown-linux-gnu")
  151. '())
  152. ;; The same is also true with aarch64.
  153. ,@(if (string=? "aarch64-linux"
  154. (%current-system))
  155. '("--host=aarch64-unknown-linux-gnu")
  156. '())
  157. (string-append "--with-ncurses="
  158. ncurses)))))))))
  159. (home-page "http://aa-project.sourceforge.net/aalib/")
  160. (synopsis "ASCII-art library")
  161. (description
  162. "AA-lib is a low level gfx library which does not require graphics device.
  163. In fact, there is no graphical output possible. AA-lib replaces those
  164. old-fashioned output methods with powerful ascii-art renderer.")
  165. (license license:lgpl2.0+)))
  166. (define-public liba52
  167. (package
  168. (name "liba52")
  169. (version "0.7.4")
  170. (source (origin
  171. (method url-fetch)
  172. (uri (string-append
  173. ;; A mirror://sourceforge URI doesn't work, presumably
  174. ;; because the SourceForge project is misconfigured.
  175. "http://liba52.sourceforge.net/files/a52dec-" version
  176. ".tar.gz"))
  177. (sha256
  178. (base32
  179. "0czccp4fcpf2ykp16xcrzdfmnircz1ynhls334q374xknd5747d2"))
  180. (patches (search-patches "liba52-enable-pic.patch"
  181. "liba52-set-soname.patch"
  182. "liba52-use-mtune-not-mcpu.patch"
  183. "liba52-link-with-libm.patch"))))
  184. (build-system gnu-build-system)
  185. ;; XXX We need to run ./bootstrap because of the build system fixes above.
  186. (native-inputs
  187. `(("autoconf" ,autoconf)
  188. ("automake" ,automake)
  189. ("libtool" ,libtool)))
  190. (arguments `(#:configure-flags '("--enable-shared")
  191. #:phases
  192. (modify-phases %standard-phases
  193. ;; XXX We need to run ./bootstrap because of the build
  194. ;; system fixes above.
  195. (add-after
  196. 'unpack 'bootstrap
  197. (lambda _ (zero? (system* "sh" "bootstrap")))))))
  198. (home-page "http://liba52.sourceforge.net/")
  199. (synopsis "ATSC A/52 stream decoder")
  200. (description "liba52 is a library for decoding ATSC A/52 streams. The
  201. A/52 standard is used in a variety of applications, including digital
  202. television and DVD. It is also known as AC-3.")
  203. (license license:gpl2+)))
  204. (define-public libmpeg2
  205. (package
  206. (name "libmpeg2")
  207. (version "0.5.1")
  208. (source (origin
  209. (method url-fetch)
  210. ;; A mirror://sourceforge URI doesn't work, presumably
  211. ;; because the SourceForge project is misconfigured.
  212. (uri (string-append "http://libmpeg2.sourceforge.net/files/"
  213. name "-" version ".tar.gz"))
  214. (sha256
  215. (base32
  216. "1m3i322n2fwgrvbs1yck7g5md1dbg22bhq5xdqmjpz5m7j4jxqny"))))
  217. (inputs
  218. `(("libx11" ,libx11)
  219. ("libxext" ,libxext)
  220. ("libxv" ,libxv)
  221. ("libsm" ,libsm)
  222. ("libice" ,libice)
  223. ("sdl" ,sdl)))
  224. (build-system gnu-build-system)
  225. (home-page "http://libmpeg2.sourceforge.net/")
  226. (synopsis "MPEG1 and MPEG2 video decoder library")
  227. (description
  228. "libmpeg2 is a library which can decode MPEG1 and MPEG2 video streams.")
  229. (license license:gpl2+)))
  230. (define-public libx264
  231. (package
  232. (name "libx264")
  233. (version "20170316-2245")
  234. (source (origin
  235. (method url-fetch)
  236. (uri (string-append "https://download.videolan.org/pub/x264/snapshots/"
  237. "x264-snapshot-" version ".tar.bz2"))
  238. (sha256
  239. (base32
  240. "1s1nnvl3axz38sv4g09skijl6k9mbbngbb1nsh26w4dr2w2gyzad"))))
  241. (build-system gnu-build-system)
  242. (native-inputs
  243. `(("pkg-config" ,pkg-config)
  244. ("yasm" ,yasm)))
  245. ;; TODO: Add gpac input
  246. (arguments
  247. `(#:tests? #f ;no check target
  248. #:configure-flags '("--enable-shared"
  249. ;; Don't build the command-line program. If we
  250. ;; want it later, we should do so in a different
  251. ;; package to avoid a circular dependency (the x264
  252. ;; program depends on ffmpeg and ffmpeg depends on
  253. ;; libx264).
  254. "--disable-cli"
  255. ;; On MIPS, we must pass "--disable-asm" or else
  256. ;; configure fails after printing: "You specified a
  257. ;; pre-MSA CPU in your CFLAGS. If you really want
  258. ;; to run on such a CPU, configure with
  259. ;; --disable-asm."
  260. ,@(if (string-prefix? "mips"
  261. (or (%current-target-system)
  262. (%current-system)))
  263. '("--disable-asm")
  264. '()))))
  265. (home-page "https://www.videolan.org/developers/x264.html")
  266. (synopsis "H.264 video coding library")
  267. (description "libx264 is an advanced encoding library for creating
  268. H.264 (MPEG-4 AVC) video streams.")
  269. (license (list license:gpl2+ ;most files
  270. license:isc ;common/x86/x86inc.asm
  271. license:lgpl2.1+ ;extras/getopt.c
  272. license:bsd-3 ;extras/inttypes.h
  273. (license:non-copyleft ;extras/cl*.h
  274. "file://extras/cl.h"
  275. "See extras/cl.h in the distribution.")))))
  276. (define-public mkvtoolnix
  277. (package
  278. (name "mkvtoolnix")
  279. (version "13.0.0")
  280. (source
  281. (origin
  282. (method url-fetch)
  283. (uri (string-append "https://mkvtoolnix.download/sources/"
  284. name "-" version ".tar.xz"))
  285. (sha256
  286. (base32
  287. "0hknnnnx9661igm1r73dc7aqxnnrl5a8yvyvr1nhd9ymn2klwpl5"))
  288. (modules '((guix build utils)))
  289. (snippet
  290. '(begin
  291. ;; Delete bundled libraries.
  292. (for-each delete-file-recursively
  293. '("lib/libebml"
  294. "lib/libmatroska"
  295. "lib/nlohmann-json"
  296. "lib/pugixml"
  297. "lib/utf8-cpp"))))))
  298. (build-system gnu-build-system)
  299. (inputs
  300. `(("boost" ,boost)
  301. ("bzip2" ,bzip2)
  302. ("libebml" ,libebml)
  303. ("flac" ,flac)
  304. ("file" ,file)
  305. ("libmatroska" ,libmatroska)
  306. ("libogg" ,libogg)
  307. ("libvorbis" ,libvorbis)
  308. ("lzo" ,lzo)
  309. ("pugixml" ,pugixml)
  310. ("qt" ,qt)
  311. ("utfcpp" ,utfcpp)
  312. ("zlib" ,zlib)))
  313. (native-inputs
  314. `(("docbook-xsl" ,docbook-xsl)
  315. ("gettext" ,gettext-minimal)
  316. ("googletest" ,googletest)
  317. ("libxslt" ,libxslt)
  318. ("nlohmann-json-cpp" ,nlohmann-json-cpp)
  319. ("perl" ,perl)
  320. ("pkg-config" ,pkg-config)
  321. ("po4a" ,po4a)
  322. ("ruby" ,ruby)))
  323. (arguments
  324. `(#:configure-flags
  325. (list (string-append "--with-boost="
  326. (assoc-ref %build-inputs "boost"))
  327. (string-append "--with-docbook-xsl-root="
  328. (assoc-ref %build-inputs "docbook-xsl")
  329. "/xml/xsl/docbook-xsl-"
  330. ,(package-version docbook-xsl))
  331. (string-append "--with-extra-includes="
  332. (assoc-ref %build-inputs "nlohmann-json-cpp")
  333. "/include/nlohmann"))
  334. #:phases
  335. (modify-phases %standard-phases
  336. (add-before 'configure 'add-googletest
  337. (lambda _
  338. (symlink
  339. (string-append (assoc-ref %build-inputs "googletest")
  340. "/include/gtest") "lib/gtest")
  341. #t))
  342. (replace 'build
  343. (lambda _
  344. (let ((-j (list "-j" (number->string (parallel-job-count)))))
  345. (zero? (apply system* "rake" -j)))))
  346. (replace 'check
  347. (lambda _
  348. (zero? (system* "rake" "tests/unit"))))
  349. (replace 'install
  350. (lambda _
  351. (zero? (system* "rake" "install")))))))
  352. (home-page "https://mkvtoolnix.download")
  353. (synopsis "Tools to create, alter and inspect Matroska files")
  354. (description
  355. "MKVToolNix provides tools for getting information about Matroska files
  356. (@code{mkvinfo}), extracting tracks/data from Matroska files (@code{mkvextract})
  357. and creating Matroska files from other media files (@code{mkvmerge}).")
  358. (license license:gpl2)))
  359. (define-public x265
  360. (package
  361. (name "x265")
  362. (version "2.4")
  363. (source
  364. (origin
  365. (method url-fetch)
  366. (uri (string-append "https://download.videolan.org/videolan/x265/"
  367. "x265_" version ".tar.gz"))
  368. (sha256
  369. (base32
  370. "0afp0xlk0fb4q6j4sh3hyvjnjccdp61sn21zg3fyqvwgswcafalw"))
  371. (modules '((guix build utils)))
  372. (snippet
  373. '(delete-file-recursively "source/compat/getopt"))))
  374. (build-system cmake-build-system)
  375. (arguments
  376. `(#:tests? #f ; tests are skipped if cpu-optimized code isn't built
  377. ;; Currently the source code doesn't check for aarch64
  378. ,@(if (string-prefix? "aarch64" (or (%current-target-system) (%current-system)))
  379. '(#:configure-flags '("-DENABLE_PIC=TRUE"))
  380. '())
  381. #:phases
  382. (modify-phases %standard-phases
  383. (add-before 'configure 'prepare-build
  384. (lambda _
  385. (delete-file-recursively "build")
  386. (chdir "source")
  387. #t)))))
  388. (home-page "http://x265.org/")
  389. (synopsis "Library for encoding h.265/HEVC video streams")
  390. (description "x265 is a H.265 / HEVC video encoder application library,
  391. designed to encode video or images into an H.265 / HEVC encoded bitstream.")
  392. (license license:gpl2+)))
  393. (define-public libass
  394. (package
  395. (name "libass")
  396. (version "0.13.7")
  397. (source (origin
  398. (method url-fetch)
  399. (uri (string-append
  400. "https://github.com/libass/libass/releases/download/"
  401. version "/libass-" version ".tar.xz"))
  402. (sha256
  403. (base32
  404. "17byv926w1mxn56n896sxvdq4m0yv1l7qbm688h6zr3nzgsyarbh"))))
  405. (build-system gnu-build-system)
  406. (native-inputs
  407. `(("pkg-config" ,pkg-config)
  408. ("yasm" ,yasm)))
  409. (propagated-inputs
  410. `(("freetype" ,freetype)
  411. ("fribidi" ,fribidi)
  412. ("fontconfig" ,fontconfig)
  413. ("harfbuzz" ,harfbuzz)
  414. ("enca" ,enca)))
  415. (home-page "https://github.com/libass/libass")
  416. (synopsis "Subtitle rendering library for the ASS/SSA format")
  417. (description "libass is a subtitle rendering library for the
  418. ASS/SSA (Advanced Substation Alpha/SubStation Alpha) subtitle format.")
  419. (license license:isc)))
  420. (define-public libcaca
  421. (package
  422. (name "libcaca")
  423. (version "0.99.beta19")
  424. (source (origin
  425. (method url-fetch)
  426. (uri (string-append "http://caca.zoy.org/files/libcaca/libcaca-"
  427. version ".tar.gz"))
  428. (sha256
  429. (base32
  430. "1x3j6yfyxl52adgnabycr0n38j9hx2j74la0hz0n8cnh9ry4d2qj"))))
  431. (build-system gnu-build-system)
  432. (native-inputs `(("pkg-config" ,pkg-config)))
  433. (inputs
  434. `(("freeglut" ,freeglut)
  435. ("ftgl" ,ftgl)
  436. ("imlib2" ,imlib2)
  437. ("libx11" ,libx11)
  438. ("mesa" ,mesa)
  439. ("ncurses" ,ncurses)
  440. ("zlib" ,zlib)))
  441. (home-page "http://caca.zoy.org/wiki/libcaca")
  442. (synopsis "Colour ASCII-art library")
  443. (description "libcaca is a graphics library that outputs text instead of
  444. pixels, so that it can work on older video cards or text terminals. It
  445. supports Unicode, 2048 colors, dithering of color images, and advanced text
  446. canvas operations.")
  447. (license (license:fsf-free "file://COPYING")))) ;WTFPL version 2
  448. (define-public libdca
  449. (package
  450. (name "libdca")
  451. (version "0.0.5")
  452. (source (origin
  453. (method url-fetch)
  454. (uri (string-append
  455. "https://download.videolan.org/pub/videolan/libdca/"
  456. version "/libdca-" version ".tar.bz2"))
  457. (sha256
  458. (base32
  459. "0hh6a7l8vvccsd5i1fkv9av2gzv9fy8m0b8jpsn5p6hh4bh2586v"))))
  460. (build-system gnu-build-system)
  461. (home-page "https://www.videolan.org/developers/libdca.html")
  462. (synopsis "DTS Coherent Acoustics decoder")
  463. (description "libdca is a library for decoding DTS Coherent Acoustics
  464. streams.")
  465. (license license:gpl2+)))
  466. (define-public libdv
  467. (package
  468. (name "libdv")
  469. (version "1.0.0")
  470. (source (origin
  471. (method url-fetch)
  472. (uri (string-append
  473. "mirror://sourceforge/" name "/" name "/"
  474. version "/" name "-" version ".tar.gz"))
  475. (sha256
  476. (base32
  477. "1fl96f2xh2slkv1i1ix7kqk576a0ak1d33cylm0mbhm96d0761d3"))))
  478. (build-system gnu-build-system)
  479. (native-inputs `(("pkg-config" ,pkg-config)))
  480. (inputs `(("libxv" ,libxv)))
  481. (home-page "http://libdv.sourceforge.net/")
  482. (synopsis "DV video (IEC 61834 and SMPTE 314M) codec")
  483. (description "The Quasar DV codec (libdv) is a software codec for DV
  484. video, the encoding format used by most digital camcorders, typically those
  485. that support the IEEE 1394 (a.k.a. FireWire or i.Link) interface. Libdv was
  486. developed according to the official standards for DV video: IEC 61834 and
  487. SMPTE 314M.")
  488. (license license:lgpl2.1+)))
  489. (define-public libmatroska
  490. (package
  491. (name "libmatroska")
  492. (version "1.4.7")
  493. (source
  494. (origin
  495. (method url-fetch)
  496. (uri (string-append "https://dl.matroska.org/downloads/"
  497. name "/" name "-" version ".tar.bz2"))
  498. (sha256
  499. (base32
  500. "1yi5cnv13nhl27xyqayd5l3sf0j3swfj3apzibv71yg9pariwi26"))))
  501. (build-system gnu-build-system)
  502. (native-inputs
  503. `(("pkg-config" ,pkg-config)))
  504. (inputs
  505. `(("libebml" ,libebml)))
  506. (home-page "https://www.matroska.org")
  507. (synopsis "C++ libary to parse Matroska files (.mkv and .mka)")
  508. (description
  509. "Matroska aims to become the standard of multimedia container formats.
  510. It is based on EBML (Extensible Binary Meta Language), a binary derivative
  511. of XML. EBML enables the Matroska Development Team to gain significant
  512. advantages in terms of future format extensibility, without breaking file
  513. support in old parsers.
  514. libebml is a C++ library to read and write EBML files.")
  515. (license license:lgpl2.1)))
  516. (define-public libva
  517. (package
  518. (name "libva")
  519. (version "1.8.2")
  520. (source
  521. (origin
  522. (method url-fetch)
  523. (uri (string-append
  524. "https://www.freedesktop.org/software/vaapi/releases/libva/libva-"
  525. version".tar.bz2"))
  526. (sha256
  527. (base32 "1pnfl3q7dzxs26l3jk9xi97gr0qwnaz6dhvf9ifp2yplr3fy7lwy"))))
  528. (build-system gnu-build-system)
  529. (native-inputs
  530. `(("pkg-config" ,pkg-config)))
  531. (inputs
  532. `(("libdrm" ,libdrm)
  533. ("libx11" ,libx11)
  534. ("libxext" ,libxext)
  535. ("libxfixes" ,libxfixes)
  536. ("mesa" ,mesa)))
  537. (arguments
  538. `(#:phases
  539. (modify-phases %standard-phases
  540. (add-before
  541. 'build 'fix-dlopen-paths
  542. (lambda* (#:key outputs #:allow-other-keys)
  543. (let ((out (assoc-ref outputs "out")))
  544. (substitute* "va/drm/va_drm_auth_x11.c"
  545. (("\"libva-x11\\.so\\.%d\"")
  546. (string-append "\"" out "/lib/libva-x11.so.%d\"")))))))
  547. ;; Most drivers are in mesa's $prefix/lib/dri, so use that. (Can be
  548. ;; overridden at run-time via LIBVA_DRIVERS_PATH.)
  549. #:configure-flags
  550. (list (string-append "--with-drivers-path="
  551. (assoc-ref %build-inputs "mesa") "/lib/dri"))
  552. ;; However, we can't write to mesa's store directory, so override the
  553. ;; following make variable to install the dummy driver to libva's
  554. ;; $prefix/lib/dri directory.
  555. #:make-flags
  556. (list (string-append "dummy_drv_video_ladir="
  557. (assoc-ref %outputs "out") "/lib/dri"))))
  558. (home-page "https://www.freedesktop.org/wiki/Software/vaapi/")
  559. (synopsis "Video acceleration library")
  560. (description "The main motivation for VA-API (Video Acceleration API) is
  561. to enable hardware accelerated video decode/encode at various
  562. entry-points (VLD, IDCT, Motion Compensation etc.) for prevailing coding
  563. standards (MPEG-2, MPEG-4 ASP/H.263, MPEG-4 AVC/H.264, and VC-1/VMW3).")
  564. (license license:expat)))
  565. (define-public ffmpeg
  566. (package
  567. (name "ffmpeg")
  568. (version "3.3.4")
  569. (source (origin
  570. (method url-fetch)
  571. (uri (string-append "https://ffmpeg.org/releases/ffmpeg-"
  572. version ".tar.xz"))
  573. (sha256
  574. (base32
  575. "0mx9dvad3lkyhvsrblf280x2bz6dxajya1ylnspbdzldj0dpxfcq"))))
  576. (build-system gnu-build-system)
  577. (inputs
  578. `(("fontconfig" ,fontconfig)
  579. ("freetype" ,freetype)
  580. ("gnutls" ,gnutls)
  581. ("opus" ,opus)
  582. ("ladspa" ,ladspa)
  583. ("lame" ,lame)
  584. ("libass" ,libass)
  585. ("libbluray" ,libbluray)
  586. ("libcaca" ,libcaca)
  587. ("libcdio-paranoia" ,libcdio-paranoia)
  588. ("libtheora" ,libtheora)
  589. ("libva" ,libva)
  590. ("libvdpau" ,libvdpau)
  591. ("libvorbis" ,libvorbis)
  592. ("libvpx" ,libvpx)
  593. ("libx11" ,libx11)
  594. ("libx264" ,libx264)
  595. ("mesa" ,mesa)
  596. ("openal" ,openal)
  597. ("pulseaudio" ,pulseaudio)
  598. ("sdl" ,sdl2)
  599. ("soxr" ,soxr)
  600. ("speex" ,speex)
  601. ("twolame" ,twolame)
  602. ("x265" ,x265)
  603. ("xvid" ,xvid)
  604. ("zlib" ,zlib)))
  605. (native-inputs
  606. `(("bc" ,bc)
  607. ("perl" ,perl)
  608. ("pkg-config" ,pkg-config)
  609. ("texinfo" ,texinfo)
  610. ("python" ,python-2) ; scripts use interpreter python2
  611. ("speex" ,speex)
  612. ("yasm" ,yasm)))
  613. (arguments
  614. `(#:test-target "fate"
  615. #:configure-flags
  616. ;; possible additional inputs:
  617. ;; --enable-avisynth enable reading of AviSynth script
  618. ;; files [no]
  619. ;; --enable-frei0r enable frei0r video filtering
  620. ;; --enable-libaacplus enable AAC+ encoding via libaacplus [no]
  621. ;; --enable-libcelt enable CELT decoding via libcelt [no]
  622. ;; --enable-libdc1394 enable IIDC-1394 grabbing using libdc1394
  623. ;; and libraw1394 [no]
  624. ;; --enable-libfaac enable AAC encoding via libfaac [no]
  625. ;; --enable-libfdk-aac enable AAC de/encoding via libfdk-aac [no]
  626. ;; --enable-libflite enable flite (voice synthesis) support via
  627. ;; libflite [no]
  628. ;; --enable-libgme enable Game Music Emu via libgme [no]
  629. ;; --enable-libgsm enable GSM de/encoding via libgsm [no]
  630. ;; --enable-libiec61883 enable iec61883 via libiec61883 [no]
  631. ;; --enable-libilbc enable iLBC de/encoding via libilbc [no]
  632. ;; --enable-libmodplug enable ModPlug via libmodplug [no]
  633. ;; --enable-libnut enable NUT (de)muxing via libnut,
  634. ;; native (de)muxer exists [no]
  635. ;; --enable-libopencore-amrnb enable AMR-NB de/encoding via
  636. ;; libopencore-amrnb [no]
  637. ;; --enable-libopencore-amrwb enable AMR-WB decoding via
  638. ;; libopencore-amrwb [no]
  639. ;; --enable-libopencv enable video filtering via libopencv [no]
  640. ;; --enable-libopenjpeg enable JPEG 2000 de/encoding via
  641. ;; OpenJPEG [no]
  642. ;; --enable-librtmp enable RTMP[E] support via librtmp [no]
  643. ;; --enable-libschroedinger enable Dirac de/encoding via
  644. ;; libschroedinger [no]
  645. ;; --enable-libshine enable fixed-point MP3 encoding via
  646. ;; libshine [no]
  647. ;; --enable-libssh enable SFTP protocol via libssh [no]
  648. ;; (libssh2 does not work)
  649. ;; --enable-libstagefright-h264 enable H.264 decoding via
  650. ;; libstagefright [no]
  651. ;; --enable-libutvideo enable Ut Video encoding and decoding via
  652. ;; libutvideo [no]
  653. ;; --enable-libv4l2 enable libv4l2/v4l-utils [no]
  654. ;; --enable-libvidstab enable video stabilization using
  655. ;; vid.stab [no]
  656. ;; --enable-libvo-aacenc enable AAC encoding via libvo-aacenc [no]
  657. ;; --enable-libvo-amrwbenc enable AMR-WB encoding via
  658. ;; libvo-amrwbenc [no]
  659. ;; --enable-libwavpack enable wavpack encoding via libwavpack [no]
  660. ;; --enable-libxavs enable AVS encoding via xavs [no]
  661. ;; --enable-libzmq enable message passing via libzmq [no]
  662. ;; --enable-libzvbi enable teletext support via libzvbi [no]
  663. ;; --enable-opencl enable OpenCL code
  664. '("--enable-avresample"
  665. "--enable-gpl" ; enable optional gpl licensed parts
  666. "--enable-shared"
  667. "--enable-fontconfig"
  668. "--enable-gnutls"
  669. "--enable-ladspa"
  670. "--enable-libass"
  671. "--enable-libbluray"
  672. "--enable-libcaca"
  673. "--enable-libcdio"
  674. "--enable-libfreetype"
  675. "--enable-libmp3lame"
  676. "--enable-libopus"
  677. "--enable-libpulse"
  678. "--enable-libsoxr"
  679. "--enable-libspeex"
  680. "--enable-libtheora"
  681. "--enable-libtwolame"
  682. "--enable-libvorbis"
  683. "--enable-libvpx"
  684. "--enable-libxvid"
  685. "--enable-libx264"
  686. "--enable-libx265"
  687. "--enable-openal"
  688. "--enable-opengl"
  689. "--enable-runtime-cpudetect"
  690. ;; Runtime cpu detection is not implemented on
  691. ;; MIPS, so we disable some features.
  692. "--disable-mips32r2"
  693. "--disable-mipsdsp"
  694. "--disable-mipsdspr2"
  695. "--disable-mipsfpu")
  696. #:phases
  697. (modify-phases %standard-phases
  698. (replace
  699. 'configure
  700. ;; configure does not work followed by "SHELL=..." and
  701. ;; "CONFIG_SHELL=..."; set environment variables instead
  702. (lambda* (#:key outputs configure-flags #:allow-other-keys)
  703. (let ((out (assoc-ref outputs "out")))
  704. (substitute* "configure"
  705. (("#! /bin/sh") (string-append "#!" (which "sh"))))
  706. (setenv "SHELL" (which "bash"))
  707. (setenv "CONFIG_SHELL" (which "bash"))
  708. (zero? (apply system*
  709. "./configure"
  710. (string-append "--prefix=" out)
  711. ;; Add $libdir to the RUNPATH of all the binaries.
  712. (string-append "--extra-ldflags=-Wl,-rpath="
  713. out "/lib")
  714. configure-flags)))))
  715. (add-before
  716. 'check 'set-ld-library-path
  717. (lambda _
  718. ;; Allow $(top_builddir)/ffmpeg to find its dependencies when
  719. ;; running tests.
  720. (let* ((dso (find-files "." "\\.so$"))
  721. (path (string-join (map dirname dso) ":")))
  722. (format #t "setting LD_LIBRARY_PATH to ~s~%" path)
  723. (setenv "LD_LIBRARY_PATH" path)
  724. #t))))))
  725. (home-page "https://www.ffmpeg.org/")
  726. (synopsis "Audio and video framework")
  727. (description "FFmpeg is a complete, cross-platform solution to record,
  728. convert and stream audio and video. It includes the libavcodec
  729. audio/video codec library.")
  730. (license license:gpl2+)))
  731. (define-public ffmpeg-2.8
  732. (package
  733. (inherit ffmpeg)
  734. (version "2.8.13")
  735. (source (origin
  736. (method url-fetch)
  737. (uri (string-append "https://ffmpeg.org/releases/ffmpeg-"
  738. version ".tar.xz"))
  739. (sha256
  740. (base32
  741. "0hyqr391pika4vgynv90bacz11wdpqcqfgj5h7g5jrmgvz6hgj68"))))
  742. (arguments
  743. (substitute-keyword-arguments (package-arguments ffmpeg)
  744. ((#:configure-flags flags)
  745. `(map (lambda (flag)
  746. (if (string=? flag "--disable-mipsdsp")
  747. "--disable-mipsdspr1"
  748. flag))
  749. ,flags))))))
  750. (define-public vlc
  751. (package
  752. (name "vlc")
  753. (version "2.2.6")
  754. (source (origin
  755. (method url-fetch)
  756. (uri (string-append
  757. "https://download.videolan.org/pub/videolan/vlc/"
  758. version "/vlc-" version ".tar.xz"))
  759. (sha256
  760. (base32
  761. "1a22b913p2227ljz89c4fgjlyln5gcz8z58w32r0wh4srnnd60y4"))))
  762. (build-system gnu-build-system)
  763. (native-inputs
  764. `(("git" ,git) ; needed for a test
  765. ("pkg-config" ,pkg-config)))
  766. ;; FIXME: Add optional inputs once available.
  767. (inputs
  768. `(("alsa-lib" ,alsa-lib)
  769. ("avahi" ,avahi)
  770. ("dbus" ,dbus)
  771. ("flac" ,flac)
  772. ("ffmpeg" ,ffmpeg-2.8) ;fails to build against ffmpeg 3.0
  773. ("fontconfig" ,fontconfig)
  774. ("freetype" ,freetype)
  775. ("gnutls" ,gnutls)
  776. ("liba52" ,liba52)
  777. ("libcddb" ,libcddb)
  778. ("libdvbpsi" ,libdvbpsi)
  779. ("libgcrypt" ,libgcrypt)
  780. ("libkate" ,libkate)
  781. ("libmad" ,libmad)
  782. ("libogg" ,libogg)
  783. ("libpng" ,libpng)
  784. ("libsamplerate" ,libsamplerate)
  785. ("libssh2" ,libssh2)
  786. ("libvorbis" ,libvorbis)
  787. ("libtheora" ,libtheora)
  788. ("libxext" ,libxext)
  789. ("libxi" ,libxi)
  790. ("libxinerama" ,libxinerama)
  791. ("libxml2" ,libxml2)
  792. ("libxpm" ,libxpm)
  793. ("livemedia-utils" ,livemedia-utils)
  794. ("lua" ,lua-5.1)
  795. ("mesa" ,mesa)
  796. ("opus" ,opus)
  797. ("perl" ,perl)
  798. ("pulseaudio" ,pulseaudio)
  799. ("python" ,python-wrapper)
  800. ("qtbase" ,qtbase)
  801. ("qtx11extras" ,qtx11extras)
  802. ("sdl" ,sdl)
  803. ("sdl-image" ,sdl-image)
  804. ("speex" ,speex)
  805. ("x265" ,x265)
  806. ("xcb-util-keysyms" ,xcb-util-keysyms)))
  807. (arguments
  808. `(#:configure-flags
  809. `("CXXFLAGS=-std=gnu++11"
  810. ,(string-append "LDFLAGS=-Wl,-rpath -Wl,"
  811. (assoc-ref %build-inputs "ffmpeg")
  812. "/lib")) ;needed for the tests
  813. #:phases
  814. (modify-phases %standard-phases
  815. (add-after 'unpack 'patch-source
  816. (lambda* (#:key inputs #:allow-other-keys)
  817. (let ((livemedia-utils (assoc-ref inputs "livemedia-utils")))
  818. (substitute* "configure"
  819. (("LIVE555_PREFIX=\\$\\{LIVE555_PREFIX-\"/usr\"\\}")
  820. (string-append "LIVE555_PREFIX=" livemedia-utils)))
  821. ;; Some of the tests require using the display to test out VLC,
  822. ;; which fails in our sandboxed build system
  823. (substitute* "test/run_vlc.sh"
  824. (("./vlc --ignore-config") "echo"))
  825. ;; XXX Likely not needed for >2.2.6.
  826. (substitute* "modules/gui/qt4/components/interface_widgets.cpp"
  827. (("<qx11info_x11.h>") "<QtX11Extras/qx11info_x11.h>"))
  828. #t)))
  829. (add-after 'install 'regenerate-plugin-cache
  830. (lambda* (#:key outputs #:allow-other-keys)
  831. ;; The 'install-exec-hook' rule in the top-level Makefile.am
  832. ;; generates 'lib/vlc/plugins/plugins.dat', a plugin cache, using
  833. ;; 'vlc-cache-gen'. This file includes the mtime of the plugins
  834. ;; it references. Thus, we first reset the timestamps of all
  835. ;; these files, and then regenerate the cache such that the
  836. ;; mtimes it includes are always zero instead of being dependent
  837. ;; on the build time.
  838. (let* ((out (assoc-ref outputs "out"))
  839. (pkglibdir (string-append out "/lib/vlc"))
  840. (plugindir (string-append pkglibdir "/plugins"))
  841. (cachegen (string-append pkglibdir "/vlc-cache-gen")))
  842. ;; TODO: Factorize 'reset-timestamps'.
  843. (for-each (lambda (file)
  844. (let ((s (lstat file)))
  845. (unless (eq? (stat:type s) 'symlink)
  846. (utime file 0 0 0 0))))
  847. (find-files plugindir))
  848. (zero? (system* cachegen plugindir))))))))
  849. (home-page "https://www.videolan.org/")
  850. (synopsis "Audio and video framework")
  851. (description "VLC is a cross-platform multimedia player and framework
  852. that plays most multimedia files as well as DVD, Audio CD, VCD, and various
  853. treaming protocols.")
  854. (license license:gpl2+)))
  855. (define-public mplayer
  856. (package
  857. (name "mplayer")
  858. (version "1.3.0")
  859. (source (origin
  860. (method url-fetch)
  861. (uri (string-append
  862. "https://www.mplayerhq.hu/MPlayer/releases/MPlayer-"
  863. version ".tar.xz"))
  864. (sha256
  865. (base32
  866. "0hwqn04bdknb2ic88xd75smffxx63scvz0zvwvjb56nqj9n89l1s"))))
  867. (build-system gnu-build-system)
  868. ;; FIXME: Add additional inputs once available.
  869. (native-inputs
  870. `(("pkg-config" ,pkg-config)))
  871. (inputs
  872. `(("alsa-lib" ,alsa-lib)
  873. ("cdparanoia" ,cdparanoia)
  874. ("ffmpeg" ,ffmpeg)
  875. ("fontconfig" ,fontconfig)
  876. ("freetype" ,freetype)
  877. ;; ("giflib" ,giflib) ; uses QuantizeBuffer, requires version >= 5
  878. ("lame" ,lame)
  879. ("libass" ,libass)
  880. ("libdvdcss" ,libdvdcss)
  881. ("libdvdnav" ,libdvdnav)
  882. ("libjpeg" ,libjpeg)
  883. ("libmpeg2" ,libmpeg2)
  884. ("libmpg123" ,mpg123) ; audio codec for MP3
  885. ("libpng" ,libpng)
  886. ("libtheora" ,libtheora)
  887. ("libvdpau" ,libvdpau)
  888. ("libvorbis" ,libvorbis)
  889. ("libx11" ,libx11)
  890. ("libx264" ,libx264)
  891. ("libxinerama" ,libxinerama)
  892. ("libxv" ,libxv)
  893. ("libxxf86dga" ,libxxf86dga)
  894. ("mesa" ,mesa)
  895. ("opus" ,opus)
  896. ("perl" ,perl)
  897. ("pulseaudio" ,pulseaudio)
  898. ("python" ,python-wrapper)
  899. ("sdl" ,sdl)
  900. ("speex" ,speex)
  901. ("yasm" ,yasm)
  902. ("zlib" ,zlib)))
  903. (arguments
  904. `(#:tests? #f ; no test target
  905. #:phases
  906. (modify-phases %standard-phases
  907. (replace 'configure
  908. ;; configure does not work followed by "SHELL=..." and
  909. ;; "CONFIG_SHELL=..."; set environment variables instead
  910. (lambda* (#:key inputs outputs #:allow-other-keys)
  911. (let ((out (assoc-ref outputs "out"))
  912. (libx11 (assoc-ref inputs "libx11")))
  913. (substitute* "configure"
  914. (("#! /bin/sh") (string-append "#!" (which "sh"))))
  915. (setenv "SHELL" (which "bash"))
  916. (setenv "CONFIG_SHELL" (which "bash"))
  917. (zero? (system*
  918. "./configure"
  919. (string-append "--extra-cflags=-I"
  920. libx11 "/include") ; to detect libx11
  921. "--disable-ffmpeg_a" ; disables bundled ffmpeg
  922. (string-append "--prefix=" out)
  923. ;; Enable runtime cpu detection where supported,
  924. ;; and choose a suitable target.
  925. ,@(match (or (%current-target-system)
  926. (%current-system))
  927. ("x86_64-linux"
  928. '("--enable-runtime-cpudetection"
  929. "--target=x86_64-linux"))
  930. ("i686-linux"
  931. '("--enable-runtime-cpudetection"
  932. "--target=i686-linux"))
  933. ("mips64el-linux"
  934. '("--target=mips3-linux"))
  935. (_ (list (string-append
  936. "--target="
  937. (or (%current-target-system)
  938. (nix-system->gnu-triplet
  939. (%current-system)))))))
  940. "--disable-iwmmxt"))))))))
  941. (home-page "https://www.mplayerhq.hu/design7/news.html")
  942. (synopsis "Audio and video player")
  943. (description "MPlayer is a movie player. It plays most MPEG/VOB, AVI,
  944. Ogg/OGM, VIVO, ASF/WMA/WMV, QT/MOV/MP4, RealMedia, Matroska, NUT,
  945. NuppelVideo, FLI, YUV4MPEG, FILM, RoQ, PVA files. One can watch VideoCD,
  946. SVCD, DVD, 3ivx, DivX 3/4/5, WMV and H.264 movies.")
  947. (license license:gpl2)))
  948. (define-public mpv
  949. (package
  950. (name "mpv")
  951. (version "0.27.0")
  952. (source (origin
  953. (method url-fetch)
  954. (uri (string-append
  955. "https://github.com/mpv-player/mpv/archive/v" version
  956. ".tar.gz"))
  957. (sha256
  958. (base32
  959. "1754371fkva8aqxgbm50jxyvij7mnysq0538bf6zghbmigqqn79l"))
  960. (file-name (string-append name "-" version ".tar.gz"))))
  961. (build-system waf-build-system)
  962. (native-inputs
  963. `(("perl" ,perl) ; for zsh completion file
  964. ("pkg-config" ,pkg-config)
  965. ("python-docutils" ,python-docutils)))
  966. ;; Missing features: libguess, Wayland, V4L2
  967. (inputs
  968. `(("alsa-lib" ,alsa-lib)
  969. ("enca" ,enca)
  970. ("ffmpeg" ,ffmpeg)
  971. ("jack" ,jack-1)
  972. ("ladspa" ,ladspa)
  973. ("lcms" ,lcms)
  974. ("libass" ,libass)
  975. ("libbluray" ,libbluray)
  976. ("libcaca" ,libcaca)
  977. ("libbs2b" ,libbs2b)
  978. ("libcdio-paranoia" ,libcdio-paranoia)
  979. ("libdvdread" ,libdvdread)
  980. ("libdvdnav" ,libdvdnav)
  981. ("libjpeg" ,libjpeg)
  982. ("libva" ,libva)
  983. ("libvdpau" ,libvdpau)
  984. ("libx11" ,libx11)
  985. ("libxext" ,libxext)
  986. ("libxinerama" ,libxinerama)
  987. ("libxrandr" ,libxrandr)
  988. ("libxscrnsaver" ,libxscrnsaver)
  989. ("libxv" ,libxv)
  990. ;; XXX: lua > 5.2 is not currently supported; see
  991. ;; waftools/checks/custom.py
  992. ("lua" ,lua-5.2)
  993. ("mesa" ,mesa)
  994. ("mpg123" ,mpg123)
  995. ("pulseaudio" ,pulseaudio)
  996. ("rsound" ,rsound)
  997. ("waf" ,python-waf)
  998. ("youtube-dl" ,youtube-dl)
  999. ("zlib" ,zlib)))
  1000. (arguments
  1001. '(#:phases
  1002. (modify-phases %standard-phases
  1003. (add-before
  1004. 'configure 'setup-waf
  1005. (lambda* (#:key inputs #:allow-other-keys)
  1006. (copy-file (assoc-ref inputs "waf") "waf")
  1007. (setenv "CC" "gcc"))))
  1008. #:configure-flags (list "--enable-libmpv-shared"
  1009. "--enable-cdda"
  1010. "--enable-dvdread"
  1011. "--enable-dvdnav"
  1012. "--enable-zsh-comp"
  1013. "--disable-build-date")
  1014. ;; No check function defined.
  1015. #:tests? #f))
  1016. (home-page "https://mpv.io/")
  1017. (synopsis "Audio and video player")
  1018. (description "mpv is a general-purpose audio and video player. It is a
  1019. fork of mplayer2 and MPlayer. It shares some features with the former
  1020. projects while introducing many more.")
  1021. (license license:gpl2+)))
  1022. (define-public gnome-mpv
  1023. (package
  1024. (name "gnome-mpv")
  1025. (version "0.12")
  1026. (source
  1027. (origin
  1028. (method url-fetch)
  1029. (uri (string-append "https://github.com/gnome-mpv/gnome-mpv/releases"
  1030. "/download/v" version "/gnome-mpv-" version
  1031. ".tar.xz"))
  1032. (sha256
  1033. (base32
  1034. "0dcnz9vlf791v8d15j7hpymv87h6nb15alww6xjq0zpal5hi44kc"))))
  1035. (native-inputs
  1036. `(("intltool" ,intltool)
  1037. ("pkg-config" ,pkg-config)))
  1038. (inputs
  1039. `(("gtk+" ,gtk+)
  1040. ("libepoxy" ,libepoxy)
  1041. ("mpv" ,mpv)))
  1042. (build-system glib-or-gtk-build-system)
  1043. (home-page "https://github.com/gnome-mpv/gnome-mpv")
  1044. (synopsis "GTK+ frontend for the mpv media player")
  1045. (description "GNOME MPV is a simple GTK+ frontend for the mpv media player.
  1046. GNOME MPV interacts with mpv via the client API exported by libmpv, allowing
  1047. access to mpv's powerful playback capabilities.")
  1048. (license license:gpl3+)))
  1049. (define-public libvpx
  1050. (package
  1051. (name "libvpx")
  1052. (version "1.6.1")
  1053. (source (origin
  1054. (method url-fetch)
  1055. (uri (string-append "http://storage.googleapis.com/"
  1056. "downloads.webmproject.org/releases/webm/"
  1057. name "-" version ".tar.bz2"))
  1058. (sha256
  1059. (base32
  1060. "06d8hqjkfs6wl45qf4pwh1kpbvkx6cwywd5y8d4lgagvjwm0qb0w"))
  1061. (patches (search-patches "libvpx-CVE-2016-2818.patch"))))
  1062. (build-system gnu-build-system)
  1063. (arguments
  1064. `(#:phases
  1065. (modify-phases %standard-phases
  1066. (replace 'configure
  1067. (lambda* (#:key outputs #:allow-other-keys)
  1068. (setenv "CONFIG_SHELL" (which "bash"))
  1069. (let ((out (assoc-ref outputs "out")))
  1070. (setenv "LDFLAGS"
  1071. (string-append "-Wl,-rpath=" out "/lib"))
  1072. (zero? (system* "./configure"
  1073. "--enable-shared"
  1074. "--as=yasm"
  1075. ;; Limit size to avoid CVE-2015-1258
  1076. "--size-limit=16384x16384"
  1077. (string-append "--prefix=" out)))))))
  1078. #:tests? #f)) ; no check target
  1079. (native-inputs
  1080. `(("perl" ,perl)
  1081. ("yasm" ,yasm)))
  1082. (synopsis "VP8/VP9 video codec")
  1083. (description "libvpx is a codec for the VP8/VP9 video compression format.")
  1084. (license license:bsd-3)
  1085. (home-page "http://www.webmproject.org/")))
  1086. (define-public youtube-dl
  1087. (package
  1088. (name "youtube-dl")
  1089. (version "2017.10.07")
  1090. (source (origin
  1091. (method url-fetch)
  1092. (uri (string-append "https://yt-dl.org/downloads/"
  1093. version "/youtube-dl-"
  1094. version ".tar.gz"))
  1095. (sha256
  1096. (base32
  1097. "10xs3d3ksfhalmvacpw2drkzi84y3rgy2jjr0wrzmqn1hx897a6r"))))
  1098. (build-system python-build-system)
  1099. (arguments
  1100. ;; The problem here is that the directory for the man page and completion
  1101. ;; files is relative, and for some reason, setup.py uses the
  1102. ;; auto-detected sys.prefix instead of the user-defined "--prefix=FOO".
  1103. ;; So, we need pass the prefix directly. In addition, make sure the Bash
  1104. ;; completion file is called 'youtube-dl' rather than
  1105. ;; 'youtube-dl.bash-completion'.
  1106. `(#:tests? #f ; Many tests fail. The test suite can be run with pytest.
  1107. #:phases (modify-phases %standard-phases
  1108. (add-before 'install 'fix-the-data-directories
  1109. (lambda* (#:key outputs #:allow-other-keys)
  1110. (let ((prefix (assoc-ref outputs "out")))
  1111. (mkdir "bash-completion")
  1112. (rename-file "youtube-dl.bash-completion"
  1113. "bash-completion/youtube-dl")
  1114. (substitute* "setup.py"
  1115. (("youtube-dl\\.bash-completion")
  1116. "bash-completion/youtube-dl")
  1117. (("'etc/")
  1118. (string-append "'" prefix "/etc/"))
  1119. (("'share/")
  1120. (string-append "'" prefix "/share/")))))))))
  1121. (synopsis "Download videos from YouTube.com and other sites")
  1122. (description
  1123. "Youtube-dl is a small command-line program to download videos from
  1124. YouTube.com and a few more sites.")
  1125. (home-page "https://yt-dl.org")
  1126. (license license:public-domain)))
  1127. (define-public youtube-dl-gui
  1128. (package
  1129. (name "youtube-dl-gui")
  1130. (version "0.3.8")
  1131. (source
  1132. (origin
  1133. (method url-fetch)
  1134. (uri (pypi-uri "Youtube-DLG" version))
  1135. (sha256
  1136. (base32
  1137. "0napxwzgls5ik1bxbp99vly32l23xpc4ng5kr24hfhf21ypjyadb"))))
  1138. (build-system python-build-system)
  1139. (arguments
  1140. ;; In Guix, wxpython has not yet been packaged for Python 3.
  1141. `(#:python ,python-2
  1142. ;; This package has no tests.
  1143. #:tests? #f
  1144. #:phases
  1145. (modify-phases %standard-phases
  1146. (add-before 'build 'patch-source
  1147. (lambda* (#:key inputs #:allow-other-keys)
  1148. ;; The youtube-dl-gui program lets you configure options. Some of
  1149. ;; them are problematic, so we change their defaults.
  1150. (substitute* "youtube_dl_gui/optionsmanager.py"
  1151. ;; When this is true, the builder process will try (and fail) to
  1152. ;; write logs to the builder user's home directory.
  1153. (("'enable_log': True") "'enable_log': False")
  1154. ;; This determines which youtube-dl program youtube-dl-gui will
  1155. ;; run. If we don't set this, then youtube-dl-gui might download
  1156. ;; an arbitrary copy from the Internet into the user's home
  1157. ;; directory and run it, so let's make sure youtube-dl-gui uses
  1158. ;; the youtube-dl from the inputs by default.
  1159. (("'youtubedl_path': self.config_path")
  1160. (string-append "'youtubedl_path': '"
  1161. (assoc-ref inputs "youtube-dl")
  1162. "/bin'"))
  1163. ;; When this is True, when youtube-dl-gui is finished downloading
  1164. ;; a file, it will try (and possibly fail) to open the directory
  1165. ;; containing the downloaded file. This can fail because it
  1166. ;; assumes that xdg-open is in PATH. Unfortunately, simply
  1167. ;; adding xdg-utils to the propagated inputs is not enough to
  1168. ;; make this work, so for now we set the default to False.
  1169. (("'open_dl_dir': True") "'open_dl_dir': False"))
  1170. ;; The youtube-dl program from the inputs is actually a wrapper
  1171. ;; script written in bash, so attempting to invoke it as a python
  1172. ;; script will fail.
  1173. (substitute* "youtube_dl_gui/downloaders.py"
  1174. (("cmd = \\['python', self\\.youtubedl_path\\]")
  1175. "cmd = [self.youtubedl_path]"))
  1176. ;; Use relative paths for installing data files so youtube-dl-gui
  1177. ;; installs the files relative to its prefix in the store, rather
  1178. ;; than relative to /. Also, instead of installing data files into
  1179. ;; $prefix/usr/share, install them into $prefix/share for
  1180. ;; consistency (see: (standards) Directory Variables).
  1181. (substitute* "setup.py"
  1182. (("= '/usr/share") "= 'share"))
  1183. ;; Update get_locale_file() so it finds the installed localization
  1184. ;; files.
  1185. (substitute* "youtube_dl_gui/utils.py"
  1186. (("os\\.path\\.join\\('/usr', 'share'")
  1187. (string-append "os.path.join('"
  1188. (assoc-ref %outputs "out")
  1189. "', 'share'"))))))))
  1190. (inputs
  1191. `(("python2-wxpython" ,python2-wxpython)
  1192. ("youtube-dl" ,youtube-dl)))
  1193. (home-page "https://github.com/MrS0m30n3/youtube-dl-gui")
  1194. (synopsis
  1195. "GUI (Graphical User Interface) for @command{youtube-dl}")
  1196. (description
  1197. "Youtube-dlG is a GUI (Graphical User Interface) for
  1198. @command{youtube-dl}. You can use it to download videos from YouTube and any
  1199. other site that youtube-dl supports.")
  1200. (license license:unlicense)))
  1201. (define-public you-get
  1202. (package
  1203. (name "you-get")
  1204. (version "0.4.915")
  1205. (source (origin
  1206. (method url-fetch)
  1207. (uri (string-append
  1208. "https://github.com/soimort/you-get/archive/v"
  1209. version ".tar.gz"))
  1210. (file-name (string-append name "-" version ".tar.gz"))
  1211. (sha256
  1212. (base32
  1213. "147qf8kdxjv9003fgx50ws0rmjjq98sv11q6c3sdwd29zylaj1ql"))))
  1214. (build-system python-build-system)
  1215. (arguments
  1216. ;; no tests
  1217. '(#:tests? #f))
  1218. (inputs
  1219. `(("ffmpeg" ,ffmpeg)))
  1220. (synopsis "Download videos, audios, or images from Web sites")
  1221. (description
  1222. "You-Get is a command-line utility to download media contents (videos,
  1223. audio, images) from the Web. It can use either mpv or vlc for playback.")
  1224. (home-page "https://you-get.org/")
  1225. (license license:expat)))
  1226. (define-public libbluray
  1227. (package
  1228. (name "libbluray")
  1229. (version "1.0.1")
  1230. (source (origin
  1231. (method url-fetch)
  1232. (uri (string-append "https://download.videolan.org/videolan/"
  1233. name "/" version "/"
  1234. name "-" version ".tar.bz2"))
  1235. (sha256
  1236. (base32
  1237. "0fl5cxfj870rwqmmz3s04wh7wnabb7rnynfj1v3sz37ln8frm7qg"))))
  1238. (build-system gnu-build-system)
  1239. (arguments
  1240. `(#:configure-flags '("--disable-bdjava-jar")
  1241. #:phases
  1242. (modify-phases %standard-phases
  1243. (add-before 'build 'fix-dlopen-paths
  1244. (lambda* (#:key inputs #:allow-other-keys)
  1245. (let ((libaacs (assoc-ref inputs "libaacs"))
  1246. (libbdplus (assoc-ref inputs "libbdplus")))
  1247. (substitute* "src/libbluray/disc/aacs.c"
  1248. (("\"libaacs\"")
  1249. (string-append "\"" libaacs "/lib/libaacs\"")))
  1250. (substitute* "src/libbluray/disc/bdplus.c"
  1251. (("\"libbdplus\"")
  1252. (string-append "\"" libbdplus "/lib/libbdplus\"")))
  1253. #t))))))
  1254. (native-inputs `(("pkg-config" ,pkg-config)))
  1255. (inputs
  1256. `(("fontconfig" ,fontconfig)
  1257. ("freetype" ,freetype)
  1258. ("libaacs" ,libaacs)
  1259. ("libbdplus" ,libbdplus)
  1260. ("libxml2" ,libxml2)))
  1261. (home-page "https://www.videolan.org/developers/libbluray.html")
  1262. (synopsis "Blu-Ray Disc playback library")
  1263. (description
  1264. "libbluray is a library designed for Blu-Ray Disc playback for media
  1265. players, like VLC or MPlayer.")
  1266. (license license:lgpl2.1+)))
  1267. (define-public libdvdread
  1268. (package
  1269. (name "libdvdread")
  1270. (version "5.0.3")
  1271. (source (origin
  1272. (method url-fetch)
  1273. (uri (string-append "https://download.videolan.org/videolan/"
  1274. name "/" version "/"
  1275. name "-" version ".tar.bz2"))
  1276. (sha256
  1277. (base32
  1278. "0ayqiq0psq18rcp6f5pz82sxsq66v0kwv0y55dbrcg68plnxy71j"))))
  1279. (build-system gnu-build-system)
  1280. (home-page "http://dvdnav.mplayerhq.hu/")
  1281. (synopsis "Library for reading video DVDs")
  1282. (description
  1283. "Libdvdread provides a simple foundation for reading DVD video
  1284. disks. It provides the functionality that is required to access many
  1285. DVDs. It parses IFO files, reads NAV-blocks, and performs CSS
  1286. authentication and descrambling (if an external libdvdcss library is
  1287. installed).")
  1288. (license license:gpl2+)))
  1289. (define-public dvdauthor
  1290. (package
  1291. (name "dvdauthor")
  1292. (version "0.7.2")
  1293. (source
  1294. (origin
  1295. (method url-fetch)
  1296. (uri (string-append "mirror://sourceforge/dvdauthor/dvdauthor-"
  1297. version ".tar.gz"))
  1298. (sha256
  1299. (base32
  1300. "1drfc47hikfzc9d7hjk34rw10iqw01d2vwmn91pv73ppx4nsj81h"))))
  1301. (build-system gnu-build-system)
  1302. (inputs
  1303. `(("libdvdread" ,libdvdread)
  1304. ("libpng" ,libpng)
  1305. ("imagemagick" ,imagemagick)
  1306. ("libxml2" ,libxml2)
  1307. ("freetype" ,freetype)))
  1308. (native-inputs
  1309. `(("pkg-config" ,pkg-config)))
  1310. (synopsis "Generates a DVD-Video movie from a MPEG-2 stream")
  1311. (description "@command{dvdauthor} will generate a DVD-Video movie from a
  1312. MPEG-2 stream containing VOB packets.")
  1313. (home-page "http://dvdauthor.sourceforge.net")
  1314. (license license:gpl3+)))
  1315. (define-public libdvdnav
  1316. (package
  1317. (name "libdvdnav")
  1318. (version "5.0.3")
  1319. (source (origin
  1320. (method url-fetch)
  1321. (uri (string-append "https://download.videolan.org/videolan/"
  1322. name "/" version "/"
  1323. name "-" version ".tar.bz2"))
  1324. (sha256
  1325. (base32
  1326. "0v8byv5z598k06rqzdmj7739vc86xq3zf79zfr698dib7lz055sh"))))
  1327. (build-system gnu-build-system)
  1328. (native-inputs
  1329. `(("pkg-config" ,pkg-config)))
  1330. (inputs
  1331. `(("libdvdread" ,libdvdread)))
  1332. (home-page "http://dvdnav.mplayerhq.hu/")
  1333. (synopsis "Library for video DVD navigation features")
  1334. (description
  1335. "Libdvdnav is a library for developers of multimedia
  1336. applications. It allows easy use of sophisticated DVD navigation features
  1337. such as DVD menus, multiangle playback and even interactive DVD games. All
  1338. this functionality is provided through a simple API which provides the DVD
  1339. playback as a single logical stream of blocks, intermitted by special
  1340. dvdnav events to report certain conditions. The main usage of libdvdnav is
  1341. a loop regularly calling a function to get the next block, surrounded by
  1342. additional calls to tell the library of user interaction. The whole
  1343. DVD virtual machine and internal playback states are completely
  1344. encapsulated.")
  1345. (license license:gpl2+)))
  1346. (define-public libdvdnav-4
  1347. (package
  1348. (inherit libdvdnav)
  1349. (version "4.2.1")
  1350. (source (origin
  1351. (method url-fetch)
  1352. (uri
  1353. (string-append
  1354. "https://download.videolan.org/videolan/libdvdnav/libdvdnav-"
  1355. version ".tar.xz"))
  1356. (sha256
  1357. (base32
  1358. "0wi3gy408c8xj0ism0hckv5jbfh3lg4pmgxv87gbch9jrhp2gjkz"))))
  1359. (native-inputs
  1360. `(("pkg-config" ,pkg-config)
  1361. ("autoconf" ,autoconf)
  1362. ("automake" ,automake)
  1363. ("libtool" ,libtool)))
  1364. (arguments
  1365. '(#:phases
  1366. (alist-cons-after
  1367. 'unpack 'autoreconf
  1368. (lambda _
  1369. (zero? (system* "autoreconf" "-vif")))
  1370. %standard-phases)))))
  1371. (define-public libdvdcss
  1372. (package
  1373. (name "libdvdcss")
  1374. (version "1.4.0")
  1375. (source (origin
  1376. (method url-fetch)
  1377. (uri (string-append "https://download.videolan.org/pub/"
  1378. name "/" version "/"
  1379. name "-" version ".tar.bz2"))
  1380. (sha256
  1381. (base32
  1382. "0nl45ifc4xcb196snv9d6hinfw614cqpzcqp92dg43c0hickg290"))))
  1383. (build-system gnu-build-system)
  1384. (home-page "https://www.videolan.org/developers/libdvdcss.html")
  1385. (synopsis "Library for accessing DVDs as block devices")
  1386. (description
  1387. "libdvdcss is a simple library designed for accessing DVDs like a block
  1388. device without having to bother about the decryption.")
  1389. (license license:gpl2+)))
  1390. (define-public srt2vtt
  1391. (package
  1392. (name "srt2vtt")
  1393. (version "0.1")
  1394. (source (origin
  1395. (method url-fetch)
  1396. (uri (string-append
  1397. "https://files.dthompson.us/srt2vtt/srt2vtt-"
  1398. version ".tar.gz"))
  1399. (sha256
  1400. (base32
  1401. "16b377znjm6qlga5yb8aj7b7bcisa1ghcnj2lrb1d30lvxp4liif"))))
  1402. (build-system gnu-build-system)
  1403. (inputs
  1404. `(("guile" ,guile-2.0)))
  1405. (synopsis "SubRip to WebVTT subtitle converter")
  1406. (description "srt2vtt converts SubRip formatted subtitles to WebVTT format
  1407. for use with HTML5 video.")
  1408. (home-page "http://dthompson.us/pages/software/srt2vtt")
  1409. (license license:gpl3+)))
  1410. (define-public avidemux
  1411. (package
  1412. (name "avidemux")
  1413. (version "2.6.12")
  1414. (source (origin
  1415. (method url-fetch)
  1416. (uri (string-append
  1417. "mirror://sourceforge/" name "/" name "/" version "/"
  1418. name "_" version ".tar.gz"))
  1419. (sha256
  1420. (base32
  1421. "0nz52yih8sff53inndkh2dba759xjzsh4b8xjww419lcpk0qp6kn"))
  1422. (patches (search-patches "avidemux-install-to-lib.patch"))))
  1423. (build-system cmake-build-system)
  1424. (native-inputs
  1425. `(("pkg-config" ,pkg-config)))
  1426. ;; FIXME: Once packaged, add libraries not found during the build.
  1427. (inputs
  1428. `(("alsa-lib" ,alsa-lib)
  1429. ("fontconfig" ,fontconfig)
  1430. ("freetype" ,freetype)
  1431. ("fribidi" ,fribidi)
  1432. ("glu" ,glu)
  1433. ("jack" ,jack-1)
  1434. ("lame" ,lame)
  1435. ("libva" ,libva)
  1436. ("libvdpau" ,libvdpau)
  1437. ("libvorbis" ,libvorbis)
  1438. ("libvpx" ,libvpx)
  1439. ("libxv" ,libxv)
  1440. ("perl" ,perl)
  1441. ("pulseaudio" ,pulseaudio)
  1442. ("python" ,python-wrapper)
  1443. ("qt" ,qt) ; FIXME: reenable modular qt after update - requires building
  1444. ;("qtbase" ,qtbase) with -std=gnu++11.
  1445. ;("qttools" ,qttools)
  1446. ("sdl" ,sdl)
  1447. ("sqlite" ,sqlite)
  1448. ("yasm" ,yasm)
  1449. ("zlib" ,zlib)))
  1450. (arguments
  1451. `(#:tests? #f ; no check target
  1452. #:phases
  1453. ;; Make sure files inside the included ffmpeg tarball are
  1454. ;; patch-shebanged.
  1455. (modify-phases %standard-phases
  1456. (add-before 'patch-source-shebangs 'unpack-ffmpeg
  1457. (lambda _
  1458. (with-directory-excursion "avidemux_core/ffmpeg_package"
  1459. (system* "tar" "xf" "ffmpeg-2.7.6.tar.bz2")
  1460. (delete-file "ffmpeg-2.7.6.tar.bz2"))))
  1461. (add-after 'patch-source-shebangs 'repack-ffmpeg
  1462. (lambda _
  1463. (with-directory-excursion "avidemux_core/ffmpeg_package"
  1464. (substitute* "ffmpeg-2.7.6/configure"
  1465. (("#! /bin/sh") (string-append "#!" (which "sh"))))
  1466. (system* "tar" "cjf" "ffmpeg-2.7.6.tar.bz2" "ffmpeg-2.7.6"
  1467. ;; avoid non-determinism in the archive
  1468. "--sort=name" "--mtime=@0"
  1469. "--owner=root:0" "--group=root:0")
  1470. (delete-file-recursively "ffmpeg-2.7.6"))))
  1471. (replace 'configure
  1472. (lambda _
  1473. ;; Copy-paste settings from the cmake build system.
  1474. (setenv "CMAKE_LIBRARY_PATH" (getenv "LIBRARY_PATH"))
  1475. (setenv "CMAKE_INCLUDE_PATH" (getenv "C_INCLUDE_PATH"))))
  1476. (replace 'build
  1477. (lambda* (#:key inputs outputs #:allow-other-keys)
  1478. (let*
  1479. ((out (assoc-ref outputs "out"))
  1480. (lib (string-append out "/lib"))
  1481. (top (getcwd))
  1482. (sdl (assoc-ref inputs "sdl"))
  1483. (build_component
  1484. (lambda* (component srcdir #:optional (args '()))
  1485. (let ((builddir (string-append "build_" component)))
  1486. (mkdir builddir)
  1487. (with-directory-excursion builddir
  1488. (zero?
  1489. (and
  1490. (apply system* "cmake"
  1491. "-DCMAKE_INSTALL_RPATH_USE_LINK_PATH=TRUE"
  1492. (string-append "-DCMAKE_INSTALL_PREFIX=" out)
  1493. (string-append "-DCMAKE_INSTALL_RPATH=" lib)
  1494. (string-append "-DCMAKE_SHARED_LINKER_FLAGS="
  1495. "\"-Wl,-rpath=" lib "\"")
  1496. (string-append "-DAVIDEMUX_SOURCE_DIR=" top)
  1497. (string-append "-DSDL_INCLUDE_DIR="
  1498. sdl "/include/SDL")
  1499. (string-append "../" srcdir)
  1500. "-DENABLE_QT5=True"
  1501. args)
  1502. (system* "make" "-j"
  1503. (number->string (parallel-job-count)))
  1504. (system* "make" "install"))))))))
  1505. (mkdir out)
  1506. (and (build_component "core" "avidemux_core")
  1507. (build_component "cli" "avidemux/cli")
  1508. (build_component "qt4" "avidemux/qt4")
  1509. (build_component "plugins_common" "avidemux_plugins"
  1510. '("-DPLUGIN_UI=COMMON"))
  1511. (build_component "plugins_cli" "avidemux_plugins"
  1512. '("-DPLUGIN_UI=CLI"))
  1513. (build_component "plugins_qt4" "avidemux_plugins"
  1514. '("-DPLUGIN_UI=QT4"))
  1515. (build_component "plugins_settings" "avidemux_plugins"
  1516. '("-DPLUGIN_UI=SETTINGS")))
  1517. ;; Remove .exe and .dll file.
  1518. (delete-file-recursively
  1519. (string-append out "/share/ADM6_addons")))))
  1520. (delete 'install))))
  1521. (home-page "http://fixounet.free.fr/avidemux/")
  1522. (synopsis "Video editor")
  1523. (description "Avidemux is a video editor designed for simple cutting,
  1524. filtering and encoding tasks. It supports many file types, including AVI,
  1525. DVD compatible MPEG files, MP4 and ASF, using a variety of codecs. Tasks
  1526. can be automated using projects, job queue and powerful scripting
  1527. capabilities.")
  1528. (supported-systems '("x86_64-linux" "i686-linux" "armhf-linux"))
  1529. ;; Software with various licenses is included, see License.txt.
  1530. (license license:gpl2+)))
  1531. (define-public vapoursynth
  1532. (package
  1533. (name "vapoursynth")
  1534. (version "37")
  1535. (source (origin
  1536. (method url-fetch)
  1537. (uri (string-append
  1538. "https://github.com/vapoursynth/vapoursynth/archive/R"
  1539. version ".tar.gz"))
  1540. (file-name (string-append name "-" version ".tar.gz"))
  1541. (sha256
  1542. (base32
  1543. "1g3hc079jw4mz1cmkv2y28pdb556wqc8ql7iravgh1rg8j3f1zi5"))))
  1544. (build-system gnu-build-system)
  1545. (native-inputs
  1546. `(("autoconf" ,autoconf)
  1547. ("automake" ,automake)
  1548. ("cython" ,python-cython)
  1549. ("libtool" ,libtool)
  1550. ("pkg-config" ,pkg-config)
  1551. ("python" ,python)
  1552. ("yasm" ,yasm)))
  1553. (inputs
  1554. `(("ffmpeg" ,ffmpeg)
  1555. ("libass" ,libass)
  1556. ("tesseract-ocr" ,tesseract-ocr)
  1557. ("zimg" ,zimg)))
  1558. (arguments
  1559. '(#:phases
  1560. (modify-phases %standard-phases
  1561. (add-after
  1562. 'unpack 'autogen
  1563. (lambda _
  1564. (zero? (system* "sh" "autogen.sh")))))))
  1565. (home-page "http://www.vapoursynth.com/")
  1566. (synopsis "Video processing framework")
  1567. (description "VapourSynth is a C++ library and Python module for video
  1568. manipulation. It aims to be a modern rewrite of Avisynth, supporting
  1569. multithreading, generalized colorspaces, per frame properties, and videos with
  1570. format changes.")
  1571. ;; src/core/cpufeatures only allows x86, ARM or PPC
  1572. (supported-systems (fold delete %supported-systems
  1573. '("mips64el-linux" "aarch64-linux")))
  1574. ;; As seen from the source files.
  1575. (license license:lgpl2.1+)))
  1576. (define-public xvid
  1577. (package
  1578. (name "xvid")
  1579. (version "1.3.4")
  1580. (source (origin
  1581. (method url-fetch)
  1582. (uri (string-append
  1583. "http://downloads.xvid.org/downloads/xvidcore-"
  1584. version ".tar.bz2"))
  1585. (sha256
  1586. (base32
  1587. "1xwbmp9wqshc0ckm970zdpi0yvgqxlqg0s8bkz98mnr8p2067bsz"))))
  1588. (build-system gnu-build-system)
  1589. (native-inputs `(("yasm" ,yasm)))
  1590. (arguments
  1591. '(#:phases
  1592. (modify-phases %standard-phases
  1593. (add-before
  1594. 'configure 'pre-configure
  1595. (lambda _
  1596. (chdir "build/generic")
  1597. (substitute* "configure"
  1598. (("#! /bin/sh") (string-append "#!" (which "sh")))))))
  1599. ;; No 'check' target.
  1600. #:tests? #f))
  1601. (home-page "https://www.xvid.com/")
  1602. (synopsis "MPEG-4 Part 2 Advanced Simple Profile video codec")
  1603. (description "Xvid is an MPEG-4 Part 2 Advanced Simple Profile (ASP) video
  1604. codec library. It uses ASP features such as b-frames, global and quarter
  1605. pixel motion compensation, lumi masking, trellis quantization, and H.263, MPEG
  1606. and custom quantization matrices.")
  1607. (license license:gpl2+)))
  1608. (define-public livestreamer
  1609. (package
  1610. (name "livestreamer")
  1611. (version "1.12.2")
  1612. (source (origin
  1613. (method url-fetch)
  1614. (uri (string-append
  1615. "https://github.com/chrippa/livestreamer/archive/v"
  1616. version ".tar.gz"))
  1617. (file-name (string-append "livestreamer-" version ".tar.gz"))
  1618. (sha256
  1619. (base32
  1620. "1fp3d3z2grb1ls97smjkraazpxnvajda2d1g1378s6gzmda2jvjd"))))
  1621. (build-system python-build-system)
  1622. (arguments
  1623. '(#:tests? #f)) ; tests rely on external web servers
  1624. (propagated-inputs
  1625. `(("python-requests" ,python-requests)))
  1626. (synopsis "Internet video stream viewer")
  1627. (description "Livestreamer is a command-line utility that extracts streams
  1628. from various services and pipes them into a video playing application.")
  1629. (home-page "http://livestreamer.io/")
  1630. (license license:bsd-2)))
  1631. (define-public mlt
  1632. (package
  1633. (name "mlt")
  1634. (version "6.4.1")
  1635. (source (origin
  1636. (method url-fetch)
  1637. (uri (string-append "https://github.com/mltframework/mlt/"
  1638. "archive/v" version ".tar.gz"))
  1639. (file-name (string-append name "-" version ".tar.gz"))
  1640. (sha256
  1641. (base32
  1642. "10m3ry0b2pvqx3bk34qh5dq337nn8pkc2gzfyhsj4nv9abskln47"))))
  1643. (build-system gnu-build-system)
  1644. (arguments
  1645. `(#:tests? #f ; no tests
  1646. #:make-flags '("CC=gcc")
  1647. #:configure-flags
  1648. (list "--enable-gpl3"
  1649. "--enable-gpl")
  1650. #:phases
  1651. (modify-phases %standard-phases
  1652. (add-after
  1653. 'configure 'override-LDFLAGS
  1654. (lambda* (#:key outputs #:allow-other-keys)
  1655. (substitute* "config.mak"
  1656. (("LDFLAGS\\+=")
  1657. (string-append "LDFLAGS+=-Wl,-rpath="
  1658. (assoc-ref outputs "out")
  1659. "/lib ")))
  1660. #t)))))
  1661. (inputs
  1662. `(("alsa-lib" ,alsa-lib)
  1663. ("fftw" ,fftw)
  1664. ("libxml2" ,libxml2)
  1665. ("jack" ,jack-1)
  1666. ("ladspa" ,ladspa)
  1667. ("libsamplerate" ,libsamplerate)
  1668. ("pulseaudio" ,pulseaudio)
  1669. ("sdl" ,sdl)
  1670. ("sox" ,sox)))
  1671. (native-inputs
  1672. `(("pkg-config" ,pkg-config)))
  1673. (home-page "https://www.mltframework.org/")
  1674. (synopsis "Author, manage, and run multitrack audio/video compositions")
  1675. (description
  1676. "MLT is a multimedia framework, designed and developed for television
  1677. broadcasting. It provides a toolkit for broadcasters, video editors, media
  1678. players, transcoders, web streamers and many more types of applications. The
  1679. functionality of the system is provided via an assortment of ready to use
  1680. tools, XML authoring components, and an extensible plug-in based API.")
  1681. (license license:lgpl2.1+)))
  1682. (define-public v4l-utils
  1683. (package
  1684. (name "v4l-utils")
  1685. (version "1.12.5")
  1686. (source (origin
  1687. (method url-fetch)
  1688. (uri (string-append "https://linuxtv.org/downloads/v4l-utils"
  1689. "/v4l-utils-" version ".tar.bz2"))
  1690. (sha256
  1691. (base32
  1692. "03g2b4rivrilimcp57mwrlsa3qvrxmk4sza08mygwmqbvcnic606"))))
  1693. (build-system gnu-build-system)
  1694. (arguments
  1695. '(#:configure-flags
  1696. (list (string-append "--with-udevdir="
  1697. (assoc-ref %outputs "out")
  1698. "/lib/udev")
  1699. "CXXFLAGS=-std=gnu++11")))
  1700. (native-inputs
  1701. `(("perl" ,perl)
  1702. ("pkg-config" ,pkg-config)))
  1703. (inputs
  1704. `(("alsa-lib" ,alsa-lib)
  1705. ("glu" ,glu)
  1706. ("libjpeg" ,libjpeg)
  1707. ("libx11" ,libx11)
  1708. ("qtbase" ,qtbase)
  1709. ("eudev" ,eudev)))
  1710. (synopsis "Realtime video capture utilities for Linux")
  1711. (description "The v4l-utils provide a series of libraries and utilities to
  1712. be used for realtime video capture via Linux-specific APIs.")
  1713. (home-page "https://linuxtv.org/wiki/index.php/V4l-utils")
  1714. ;; libv4l2 is LGPL2.1+, while utilities are GPL2 only.
  1715. (license (list license:lgpl2.1+ license:gpl2))))
  1716. (define-public obs
  1717. (package
  1718. (name "obs")
  1719. (version "18.0.2")
  1720. (source (origin
  1721. (method url-fetch)
  1722. (uri (string-append "https://github.com/jp9000/obs-studio"
  1723. "/archive/" version ".tar.gz"))
  1724. (file-name (string-append name "-" version ".tar.gz"))
  1725. (sha256
  1726. (base32
  1727. "02pbiyvf5x0zh448h5rpmyn33qnsqk694xxlyns83mdi74savyqw"))))
  1728. (build-system cmake-build-system)
  1729. (arguments
  1730. `(#:tests? #f)) ; no tests
  1731. (native-inputs
  1732. `(("pkg-config" ,pkg-config)))
  1733. (inputs
  1734. `(("alsa-lib" ,alsa-lib)
  1735. ("curl" ,curl)
  1736. ("eudev" ,eudev)
  1737. ("ffmpeg" ,ffmpeg)
  1738. ("fontconfig" ,fontconfig)
  1739. ("freetype" ,freetype)
  1740. ("jack" ,jack-1)
  1741. ("jansson" ,jansson)
  1742. ("libx264" ,libx264)
  1743. ("libxcomposite" ,libxcomposite)
  1744. ("mesa" ,mesa)
  1745. ("pulseaudio" ,pulseaudio)
  1746. ("qtbase" ,qtbase)
  1747. ("qtx11extras" ,qtx11extras)
  1748. ("speex" ,speex)
  1749. ("v4l-utils" ,v4l-utils)
  1750. ("zlib" ,zlib)))
  1751. (synopsis "Live streaming software")
  1752. (description "Open Broadcaster Software provides a graphical interface for
  1753. video recording and live streaming. OBS supports capturing audio and video
  1754. from many input sources such as webcams, X11 (for screencasting), PulseAudio,
  1755. and JACK.")
  1756. (home-page "https://obsproject.com")
  1757. (supported-systems '("x86_64-linux" "i686-linux"))
  1758. (license license:gpl2+)))
  1759. (define-public libvdpau
  1760. (package
  1761. (name "libvdpau")
  1762. (version "1.1.1")
  1763. (source
  1764. (origin
  1765. (method url-fetch)
  1766. (uri (string-append "https://secure.freedesktop.org/~aplattner/vdpau/"
  1767. name "-" version ".tar.bz2"))
  1768. (sha256
  1769. (base32
  1770. "0dnpb0yh7v6rvckx82kxg045rd9rbsw25wjv7ad5n8h94s9h2yl5"))))
  1771. (build-system gnu-build-system)
  1772. (native-inputs
  1773. `(("pkg-config" ,pkg-config)))
  1774. (inputs
  1775. `(("dri2proto" ,dri2proto)
  1776. ("libx11" ,libx11 "out")
  1777. ("libxext" ,libxext)))
  1778. (home-page "https://wiki.freedesktop.org/www/Software/VDPAU/")
  1779. (synopsis "Video Decode and Presentation API")
  1780. (description "VDPAU is the Video Decode and Presentation API for UNIX. It
  1781. provides an interface to video decode acceleration and presentation hardware
  1782. present in modern GPUs.")
  1783. (license (license:x11-style "file://COPYING"))))
  1784. (define-public vdpauinfo
  1785. (package
  1786. (name "vdpauinfo")
  1787. (version "1.0")
  1788. (source
  1789. (origin
  1790. (method url-fetch)
  1791. (uri (string-append "https://secure.freedesktop.org/~aplattner/vdpau/"
  1792. name "-" version ".tar.gz"))
  1793. (sha256
  1794. (base32
  1795. "1i2b0k9h8r0lnxlrkgqzmrjakgaw3f1ygqqwzx8w6676g85rcm20"))))
  1796. (build-system gnu-build-system)
  1797. (native-inputs
  1798. `(("pkg-config" ,pkg-config)
  1799. ("libx11" ,libx11)))
  1800. (propagated-inputs
  1801. `(("libvdpau" ,libvdpau)))
  1802. (home-page "https://wiki.freedesktop.org/www/Software/VDPAU/")
  1803. (synopsis "Tool to query the capabilities of a VDPAU implementation")
  1804. (description "Vdpauinfo is a tool to query the capabilities of a VDPAU
  1805. implementation.")
  1806. (license (license:x11-style "file://COPYING"))))
  1807. (define-public recordmydesktop
  1808. (package
  1809. (name "recordmydesktop")
  1810. (version "0.3.8.1")
  1811. (source (origin
  1812. (method url-fetch)
  1813. (uri (string-append "mirror://sourceforge/" name "/" name "/"
  1814. version "/recordmydesktop-" version ".tar.gz"))
  1815. (sha256
  1816. (base32
  1817. "133kkl5j0r877d41bzj7kj0vf3xm8x80yyx2n8nqxrva304f58ik"))))
  1818. (build-system gnu-build-system)
  1819. (inputs `(("popt" ,popt)
  1820. ("zlib" ,zlib)
  1821. ("libx11" ,libx11)
  1822. ("libice" ,libice)
  1823. ("libsm" ,libsm)
  1824. ("libxfixes" ,libxfixes)
  1825. ("libxdamage" ,libxdamage)
  1826. ("libxext" ,libxext)
  1827. ("alsa-lib" ,alsa-lib)
  1828. ("libvorbis" ,libvorbis)
  1829. ("libtheora" ,libtheora)))
  1830. (home-page "http://recordmydesktop.sourceforge.net/")
  1831. (synopsis "Desktop session video recorder")
  1832. (description
  1833. "recordMyDesktop is a command-line tool that captures the activity in
  1834. your graphical desktop and encodes it as a video. This is a useful tool for
  1835. making @dfn{screencasts}.")
  1836. (license license:gpl2+)))
  1837. (define-public simplescreenrecorder
  1838. (package
  1839. (name "simplescreenrecorder")
  1840. (version "0.3.8")
  1841. (source
  1842. (origin
  1843. (method url-fetch)
  1844. (uri (string-append "https://github.com/MaartenBaert/ssr/archive/"
  1845. version ".tar.gz"))
  1846. (file-name (string-append name "-" version ".tar.gz"))
  1847. (sha256
  1848. (base32
  1849. "0v8w35n8w772s08w7k0icynqdsdakbrcanbgx6j847bfqfsg21gg"))))
  1850. (build-system gnu-build-system)
  1851. ;; Although libx11, libxfixes, libxext are listed as build dependencies in
  1852. ;; README.md, the program builds and functions properly without them.
  1853. ;; As a result, they are omitted. Please add them back if problems appear.
  1854. (inputs
  1855. `(("alsa-lib" ,alsa-lib)
  1856. ("ffmpeg" ,ffmpeg)
  1857. ("glu" ,glu)
  1858. ("jack" ,jack-1)
  1859. ("libxi" ,libxi)
  1860. ("pulseaudio" ,pulseaudio)
  1861. ("qt" ,qt-4))) ; README.md: using Qt 5 causes some stability issues
  1862. (native-inputs `(("pkg-config" ,pkg-config)))
  1863. ;; Using HTTPS causes part of the page to be displayed improperly.
  1864. (home-page "http://www.maartenbaert.be/simplescreenrecorder/")
  1865. (synopsis "Screen recorder")
  1866. (description "SimpleScreenRecorder is an easy to use screen recorder with
  1867. a graphical user interface. It supports recording the entire screen, or a
  1868. part of it, and allows encoding in many different codecs and file formats.
  1869. Other features include a live preview and live streaming.")
  1870. (license (list license:gpl3+ ; most files
  1871. license:zlib ; glinject/elfhacks.*
  1872. license:isc ; glinject/*
  1873. license:x11)))) ; build-aux/install-sh
  1874. (define-public libsmpeg
  1875. (package
  1876. (name "libsmpeg")
  1877. (version "0.4.5")
  1878. (source (origin
  1879. (method svn-fetch)
  1880. (uri (svn-reference
  1881. (url "svn://svn.icculus.org/smpeg/trunk/")
  1882. (revision 401))) ; last revision before smpeg2 (for SDL 2.0)
  1883. (file-name (string-append name "-" version "-checkout"))
  1884. (sha256
  1885. (base32
  1886. "18yfkr70lr1x1hc8snn2ldnbzdcc7b64xmkqrfk8w59gpg7sl1xn"))))
  1887. (build-system gnu-build-system)
  1888. (arguments
  1889. `(#:phases (modify-phases %standard-phases
  1890. (add-after 'unpack 'autogen.sh
  1891. (lambda _
  1892. (zero? (system* "sh" "autogen.sh")))))))
  1893. (native-inputs
  1894. `(("autoconf" ,autoconf)
  1895. ("automake" ,automake)))
  1896. (inputs
  1897. `(("sdl" ,sdl2)))
  1898. (home-page "http://icculus.org/smpeg/")
  1899. (synopsis "SDL MPEG decoding library")
  1900. (description
  1901. "SMPEG (SDL MPEG Player Library) is a free MPEG1 video player library
  1902. with sound support. Video playback is based on the ubiquitous Berkeley MPEG
  1903. player, mpeg_play v2.2. Audio is played through a slightly modified mpegsound
  1904. library, part of splay v0.8.2. SMPEG supports MPEG audio (MP3), MPEG-1 video,
  1905. and MPEG system streams.")
  1906. (license (list license:expat
  1907. license:lgpl2.1
  1908. license:lgpl2.1+
  1909. license:gpl2))))
  1910. (define-public libbdplus
  1911. (package
  1912. (name "libbdplus")
  1913. (version "0.1.2")
  1914. (source
  1915. (origin
  1916. (method url-fetch)
  1917. (uri (string-append "https://ftp.videolan.org/pub/videolan/libbdplus/"
  1918. version "/" name "-" version ".tar.bz2"))
  1919. (sha256
  1920. (base32 "02n87lysqn4kg2qk7d1ffrp96c44zkdlxdj0n16hbgrlrpiwlcd6"))))
  1921. (inputs
  1922. `(("libgcrypt" ,libgcrypt)))
  1923. (build-system gnu-build-system)
  1924. (home-page "https://www.videolan.org/developers/libbdplus.html")
  1925. (synopsis "Library for decrypting certain Blu-Ray discs")
  1926. (description "libbdplus is a library which implements the BD+ System
  1927. specifications.")
  1928. (license license:lgpl2.1+)))
  1929. (define-public libaacs
  1930. (package
  1931. (name "libaacs")
  1932. (version "0.9.0")
  1933. (source
  1934. (origin
  1935. (method url-fetch)
  1936. (uri (string-append "https://ftp.videolan.org/pub/videolan/libaacs/"
  1937. version "/" name "-" version ".tar.bz2"))
  1938. (sha256
  1939. (base32 "1kms92i0c7i1yl659kqjf19lm8172pnpik5lsxp19xphr74vvq27"))))
  1940. (inputs
  1941. `(("libgcrypt" ,libgcrypt)))
  1942. (native-inputs
  1943. `(("bison" ,bison)
  1944. ("flex" ,flex)))
  1945. (build-system gnu-build-system)
  1946. (home-page "https://www.videolan.org/developers/libaacs.html")
  1947. (synopsis "Library for decrypting certain Blu-Ray discs")
  1948. (description "libaacs is a library which implements the Advanced Access
  1949. Content System specification.")
  1950. (license license:lgpl2.1+)))
  1951. (define-public mps-youtube
  1952. (package
  1953. (name "mps-youtube")
  1954. (version "0.2.7.1")
  1955. (source
  1956. (origin
  1957. (method url-fetch)
  1958. (uri (string-append "https://github.com/mps-youtube/mps-youtube/"
  1959. "archive/v" version ".tar.gz"))
  1960. (file-name (string-append name "-" version ".tar.gz"))
  1961. (sha256
  1962. (base32
  1963. "1s7h35yx6f0szf8mm8612ic913w3v05m2kwphjfcxnpq0ammhyci"))))
  1964. (build-system python-build-system)
  1965. (arguments
  1966. ;; Tests need to be disabled until #556 upstream is fixed. It reads as if the
  1967. ;; test suite results differ depending on the country and also introduce
  1968. ;; non-determinism in the tests.
  1969. ;; https://github.com/mps-youtube/mps-youtube/issues/556
  1970. `(#:tests? #f))
  1971. (propagated-inputs
  1972. `(("python-pafy" ,python-pafy)
  1973. ("python-pygobject" ,python-pygobject))) ; For mpris2 support
  1974. (home-page "https://github.com/mps-youtube/mps-youtube")
  1975. (synopsis "Terminal based YouTube player and downloader")
  1976. (description
  1977. "@code{mps-youtube} is based on mps, a terminal based program to
  1978. search, stream and download music. This implementation uses YouTube as
  1979. a source of content and can play and download video as well as audio.
  1980. It can use either mpv or mplayer for playback, and for conversion of
  1981. formats ffmpeg or libav is used. Users should install one of the
  1982. supported players in addition to this package.")
  1983. (license license:gpl3+)))
  1984. (define-public handbrake
  1985. (package
  1986. (name "handbrake")
  1987. (version "0.10.5")
  1988. (source (origin
  1989. (method url-fetch)
  1990. (uri (string-append "https://handbrake.fr/rotation.php?file="
  1991. "HandBrake-" version ".tar.bz2"))
  1992. (file-name (string-append "handbrake-" version ".tar.bz2"))
  1993. (sha256
  1994. (base32
  1995. "1w720y3bplkz187wgvy4a4xm0vpppg45mlni55l6yi8v2bfk14pv"))
  1996. (patches (search-patches "handbrake-pkg-config-path.patch"))
  1997. (modules '((guix build utils)))
  1998. (snippet
  1999. ;; Remove bundled libraries and source not necessary for
  2000. ;; running under a GNU environment.
  2001. '(begin
  2002. (for-each delete-file-recursively '("contrib" "macosx" "win"))
  2003. #t))))
  2004. (build-system glib-or-gtk-build-system)
  2005. (native-inputs
  2006. `(("automake" ,automake) ;gui subpackage must be bootstrapped
  2007. ("autoconf" ,autoconf)
  2008. ("curl" ,curl) ;not actually used, but tested for
  2009. ("intltool" ,intltool)
  2010. ("libtool" ,libtool)
  2011. ("pkg-config" ,pkg-config)
  2012. ("python" ,python-2))) ;for configuration
  2013. (inputs
  2014. `(("bzip2" ,bzip2)
  2015. ("dbus-glib" ,dbus-glib)
  2016. ("ffmpeg" ,ffmpeg)
  2017. ("fontconfig" ,fontconfig)
  2018. ("freetype" ,freetype)
  2019. ("glib" ,glib)
  2020. ("gstreamer" ,gstreamer)
  2021. ("gst-plugins-base" ,gst-plugins-base)
  2022. ("gtk+" ,gtk+)
  2023. ("lame" ,lame)
  2024. ("libass" ,libass)
  2025. ("libbluray" ,libbluray)
  2026. ("libdvdnav" ,libdvdnav)
  2027. ("libdvdread" ,libdvdread)
  2028. ("libgudev" ,libgudev)
  2029. ("libmpeg2" ,libmpeg2)
  2030. ("libnotify" ,libnotify)
  2031. ("libogg" ,libogg)
  2032. ("libsamplerate" ,libsamplerate)
  2033. ("libtheora" ,libtheora)
  2034. ("libvorbis" ,libvorbis)
  2035. ("libvpx" ,libvpx)
  2036. ("libxml2" ,libxml2)
  2037. ("libx264" ,libx264)
  2038. ("x265" ,x265)
  2039. ("zlib" ,zlib)))
  2040. (arguments
  2041. `(#:tests? #f ;tests require Ruby and claim to be unsupported
  2042. #:phases
  2043. (modify-phases %standard-phases
  2044. (add-before 'patch-source-shebangs 'bootstrap-gtk
  2045. ;; Run bootstrap ahead of time so that shebangs get patched.
  2046. (lambda _
  2047. (setenv "CONFIG_SHELL" (which "sh"))
  2048. (setenv "NOCONFIGURE" "1")
  2049. ;; Patch the Makefile so that it doesn't bootstrap again.
  2050. (substitute* "gtk/module.rules"
  2051. ((".*autogen\\.sh.*") ""))
  2052. (zero? (system* "sh" "./gtk/autogen.sh"))))
  2053. (add-before 'configure 'disable-contrib
  2054. (lambda _
  2055. (substitute* "make/include/main.defs"
  2056. ;; Disable unconditional inclusion of some "contrib"
  2057. ;; libraries (ffmpeg, libvpx, libdvdread, libdvdnav,
  2058. ;; and libbluray), which would lead to fetching and
  2059. ;; building of these libraries. Use our own instead.
  2060. (("MODULES \\+= contrib") "# MODULES += contrib"))
  2061. #t))
  2062. (add-before 'configure 'fix-x265-linking
  2063. (lambda _
  2064. (substitute* "test/module.defs"
  2065. ;; Fix missing library during linking error
  2066. (("TEST.GCC.l =") "TEST.GCC.l = x265"))
  2067. #t))
  2068. (replace 'configure
  2069. (lambda* (#:key outputs configure-flags #:allow-other-keys)
  2070. ;; 'configure' is not an autoconf-generated script, and
  2071. ;; errors on unrecognized arguments,
  2072. ;; e.g. --enable-fast-install
  2073. (let ((out (assoc-ref outputs "out")))
  2074. (zero? (apply system* "./configure"
  2075. (string-append "--prefix=" out)
  2076. (or configure-flags '()))))))
  2077. (add-after 'configure 'chdir-build
  2078. (lambda _ (chdir "./build") #t)))))
  2079. (home-page "https://handbrake.fr")
  2080. (synopsis "Video transcoder")
  2081. (description
  2082. "HandBrake is a tool for converting video from any format to a selection
  2083. of modern, widely supported codecs.")
  2084. ;; Most under GPL version 2 or later, and portions under BSD 3 Clause
  2085. (license (list license:gpl2+ license:bsd-3))))
  2086. (define-public openh264
  2087. (package
  2088. (name "openh264")
  2089. (version "1.7.0")
  2090. (source (origin
  2091. (method url-fetch)
  2092. (uri (string-append "https://github.com/cisco/"
  2093. name "/archive/v" version ".tar.gz"))
  2094. (file-name (string-append name "-" version ".tar.gz"))
  2095. (sha256
  2096. (base32
  2097. "0gv571bqkxk7ic64dmavs1q8nr7p59mcf4ibqp4lc070gn6w61ww"))))
  2098. (build-system gnu-build-system)
  2099. (native-inputs
  2100. `(("nasm" ,nasm)
  2101. ("python" ,python)))
  2102. (arguments
  2103. '(#:make-flags (list (string-append "PREFIX=" (assoc-ref %outputs "out"))
  2104. "CC=gcc")
  2105. #:test-target "test"
  2106. #:phases (modify-phases %standard-phases
  2107. ;; no configure script
  2108. (delete 'configure))))
  2109. (home-page "http://www.openh264.org/")
  2110. (synopsis "H264 decoder library")
  2111. (description
  2112. "Openh264 is a library which can decode H264 video streams.")
  2113. (license license:bsd-2)))
  2114. (define-public libmp4v2
  2115. (package
  2116. (name "libmp4v2")
  2117. (version "2.0.0")
  2118. (source
  2119. (origin
  2120. (method url-fetch)
  2121. ;; XXX: The new location of upstream is uncertain and will become relevant the
  2122. ;; moment when the googlecode archive shuts down. It is past the date it
  2123. ;; should've been turned off. I tried to communicate with upstream, but this
  2124. ;; wasn't very responsive and not very helpful. The short summary is, it is
  2125. ;; chaos when it comes to the amount of forks and only time will tell where
  2126. ;; the new upstream location is.
  2127. (uri (string-append "https://storage.googleapis.com/google-"
  2128. "code-archive-downloads/v2/"
  2129. "code.google.com/mp4v2/mp4v2-" version ".tar.bz2"))
  2130. (file-name (string-append name "-" version ".tar.bz2"))
  2131. (sha256
  2132. (base32
  2133. "0f438bimimsvxjbdp4vsr8hjw2nwggmhaxgcw07g2z361fkbj683"))))
  2134. (build-system gnu-build-system)
  2135. (outputs '("out"
  2136. "static")) ; 3.7MiB .a file
  2137. (arguments
  2138. `(#:phases
  2139. (modify-phases %standard-phases
  2140. (add-after 'unpack 'remove-dates
  2141. (lambda _
  2142. ;; Make the build reproducible.
  2143. (substitute* "configure"
  2144. (("PROJECT_build=\"`date`\"") "PROJECT_build=\"\"")
  2145. (("ac_abs_top_builddir=$ac_pwd") "ac_abs_top_builddir=\"\""))
  2146. #t))
  2147. (add-after 'install 'move-static-libraries
  2148. (lambda* (#:key outputs #:allow-other-keys)
  2149. ;; Move static libraries to the "static" output.
  2150. (let* ((out (assoc-ref outputs "out"))
  2151. (lib (string-append out "/lib"))
  2152. (static (assoc-ref outputs "static"))
  2153. (slib (string-append static "/lib")))
  2154. (mkdir-p slib)
  2155. (for-each (lambda (file)
  2156. (install-file file slib)
  2157. (delete-file file))
  2158. (find-files lib "\\.a$"))
  2159. #t))))))
  2160. (native-inputs
  2161. `(("help2man" ,help2man)
  2162. ("dejagnu" ,dejagnu)))
  2163. (home-page "https://code.google.com/archive/p/mp4v2/")
  2164. (synopsis "API to create and modify mp4 files")
  2165. (description
  2166. "The MP4v2 library provides an API to create and modify mp4 files as defined by
  2167. ISO-IEC:14496-1:2001 MPEG-4 Systems. This file format is derived from Apple's QuickTime
  2168. file format that has been used as a multimedia file format in a variety of platforms and
  2169. applications. It is a very powerful and extensible format that can accommodate
  2170. practically any type of media.")
  2171. (license license:mpl1.1)))
  2172. (define-public libmediainfo
  2173. (package
  2174. (name "libmediainfo")
  2175. (version "0.7.95")
  2176. (source (origin
  2177. (method url-fetch)
  2178. (uri (string-append "https://mediaarea.net/download/source/"
  2179. name "/" version"/"
  2180. name "_" version ".tar.bz2"))
  2181. (sha256
  2182. (base32
  2183. "1kchh6285b07z5nixv619hc9gml2ysdayicdiv30frrlqiyxqw4b"))))
  2184. ;; TODO add a Big Buck Bunny webm for tests.
  2185. (native-inputs
  2186. `(("autoconf" ,autoconf)
  2187. ("automake" ,automake)
  2188. ("libtool" ,libtool)
  2189. ("pkg-config" ,pkg-config)
  2190. ("zlib" ,zlib)
  2191. ("tinyxml2" ,tinyxml2)
  2192. ("curl" ,curl)
  2193. ("libzen" ,libzen)))
  2194. (build-system gnu-build-system)
  2195. (arguments
  2196. '(#:tests? #f ; see above TODO
  2197. #:phases
  2198. ;; build scripts not in root of archive
  2199. (modify-phases %standard-phases
  2200. (add-after 'unpack 'change-to-build-dir
  2201. (lambda _
  2202. (chdir "Project/GNU/Library")
  2203. #t))
  2204. (add-after 'change-to-build-dir 'autogen
  2205. (lambda _
  2206. (zero? (system* "sh" "autogen.sh")))))))
  2207. (home-page "https://mediaarea.net/en/MediaInfo")
  2208. (synopsis "Library for retrieving media metadata")
  2209. (description "MediaInfo is a library used for retrieving technical
  2210. information and other metadata about audio or video files. A non-exhaustive
  2211. list of the information MediaInfo can retrieve from media files include:
  2212. @itemize
  2213. @item General: title, author, director, album, track number, date, duration...
  2214. @item Video: codec, aspect, fps, bitrate...
  2215. @item Audio: codec, sample rate, channels, language, bitrate...
  2216. @item Text: language of subtitle
  2217. @item Chapters: number of chapters, list of chapters
  2218. @end itemize
  2219. MediaInfo supports the following formats:
  2220. @itemize
  2221. @item Video: MKV, OGM, AVI, DivX, WMV, QuickTime, Real, MPEG-1,
  2222. MPEG-2, MPEG-4, DVD (VOB)...
  2223. @item Video Codecs: DivX, XviD, MSMPEG4, ASP, H.264, AVC...)
  2224. @item Audio: OGG, MP3, WAV, RA, AC3, DTS, AAC, M4A, AU, AIFF...
  2225. @item Subtitles: SRT, SSA, ASS, SAMI...
  2226. @end itemize\n")
  2227. (license license:bsd-2)))
  2228. ;; TODO also have a GUI version available
  2229. (define-public mediainfo
  2230. (package
  2231. (name "mediainfo")
  2232. (version "0.7.95")
  2233. (source (origin
  2234. (method url-fetch)
  2235. (uri (string-append "https://mediaarea.net/download/source/"
  2236. name "/" version "/"
  2237. name "_" version ".tar.bz2"))
  2238. (sha256
  2239. (base32
  2240. "0dy51a3i79jppmg1gi4f6h7jx4hcgnkmfim4d7d3gmnlbkjh8anv"))))
  2241. (native-inputs
  2242. `(("autoconf" ,autoconf)
  2243. ("automake" ,automake)
  2244. ("libtool" ,libtool)
  2245. ("pkg-config" ,pkg-config)
  2246. ("zlib" ,zlib)
  2247. ("libmediainfo", libmediainfo)
  2248. ("libzen" ,libzen)))
  2249. (build-system gnu-build-system)
  2250. (arguments
  2251. '(#:tests? #f ; lacks tests
  2252. #:phases
  2253. ;; build scripts not in root of archive
  2254. (modify-phases %standard-phases
  2255. (add-before 'configure 'pre-configure
  2256. (lambda _
  2257. (chdir "Project/GNU/CLI")))
  2258. (add-after 'unpack 'autogen
  2259. (lambda _
  2260. (zero? (system* "sh" "autogen.sh")))))))
  2261. (home-page "https://mediaarea.net/en/MediaInfo")
  2262. (synopsis "Utility for reading media metadata")
  2263. (description "MediaInfo is a utility used for retrieving technical
  2264. information and other metadata about audio or video files. It supports the
  2265. many codecs and formats supported by libmediainfo.")
  2266. (license license:bsd-2)))
  2267. (define-public livemedia-utils
  2268. (package
  2269. (name "livemedia-utils")
  2270. (version "2017.06.04")
  2271. (source (origin
  2272. (method url-fetch)
  2273. (uri (string-append
  2274. "https://download.videolan.org/contrib/live555/live."
  2275. version ".tar.gz"))
  2276. (sha256
  2277. (base32
  2278. "0xf3vynxqpxpd762zni0jkblnjlgbqxjx99m83m7gqx6zriph271"))))
  2279. (build-system gnu-build-system)
  2280. (arguments
  2281. '(#:tests? #f ; no tests
  2282. #:make-flags (list "CC=gcc"
  2283. (string-append "LDFLAGS=-Wl,-rpath="
  2284. (assoc-ref %outputs "out") "/lib")
  2285. (string-append "PREFIX="
  2286. (assoc-ref %outputs "out")))
  2287. #:phases (modify-phases %standard-phases
  2288. (add-before 'configure 'fix-makefiles-generation
  2289. (lambda _
  2290. (substitute* "genMakefiles"
  2291. (("/bin/rm") "rm"))
  2292. #t))
  2293. (replace 'configure
  2294. (lambda _
  2295. (zero? (system* "./genMakefiles"
  2296. "linux-with-shared-libraries")))))))
  2297. (home-page "http://www.live555.com/liveMedia/")
  2298. (synopsis "Set of C++ libraries for multimedia streaming")
  2299. (description "This code forms a set of C++ libraries for multimedia
  2300. streaming, using open standard protocols (RTP/RTCP, RTSP, SIP). The libraries
  2301. can be used to stream, receive, and process MPEG, H.265, H.264, H.263+, DV or
  2302. JPEG video, and several audio codecs. They can easily be extended to support
  2303. additional (audio and/or video) codecs, and can also be used to build basic
  2304. RTSP or SIP clients and servers.")
  2305. (license license:lgpl3+)))
  2306. (define-public libdvbpsi
  2307. (package
  2308. (name "libdvbpsi")
  2309. (version "1.3.1")
  2310. (source (origin
  2311. (method url-fetch)
  2312. (uri (string-append
  2313. "https://download.videolan.org/pub/libdvbpsi/"
  2314. version "/libdvbpsi-" version ".tar.bz2"))
  2315. (sha256
  2316. (base32
  2317. "0824r08kaspbrrg2dd5d46s475zb7j59brqkm2y6x3mdsnpng0yn"))))
  2318. (build-system gnu-build-system)
  2319. (home-page "https://www.videolan.org/developers/libdvbpsi.html")
  2320. (synopsis "Library for decoding and generation of MPEG TS and DVB PSI
  2321. tables")
  2322. (description "libdvbpsi is a simple library designed for decoding and
  2323. generation of MPEG TS and DVB PSI tables according to standards ISO/IEC 13818s
  2324. and ITU-T H.222.0.")
  2325. (license license:lgpl2.1)))