From: Carl Hetherington Date: Tue, 21 May 2013 20:07:35 +0000 (+0100) Subject: Merge master. X-Git-Tag: v2.0.48~1337^2~367 X-Git-Url: https://git.carlh.net/gitweb/?p=dcpomatic.git;a=commitdiff_plain;h=237a0052c60af768f4d62b00321932918b7ba4d9;hp=b650eba5103a5b924774d3db947cb704ea9d1879 Merge master. --- diff --git a/.gitignore b/.gitignore index cc3351558..70738a18f 100644 --- a/.gitignore +++ b/.gitignore @@ -15,6 +15,9 @@ sync doc/manual/html doc/manual/pdf doc/manual/extensions.ent +doc/design/*.pdf +doc/design/*.log +doc/design/*.aux .be/id-cache *.pyc GPATH diff --git a/Doxyfile b/Doxyfile index 56f7e1d3c..4ed65e4f1 100644 --- a/Doxyfile +++ b/Doxyfile @@ -26,7 +26,7 @@ DOXYFILE_ENCODING = UTF-8 # identify the project. Note that if you do not use Doxywizard you need # to put quotes around the project name if it contains spaces. -PROJECT_NAME = DVD-o-matic +PROJECT_NAME = DCP-o-matic # The PROJECT_NUMBER tag can be used to enter a project or revision number. # This could be handy for archiving the generated documentation or diff --git a/README b/README index fd3983c29..c218ed1a5 100644 --- a/README +++ b/README @@ -1,4 +1,4 @@ -dvd-o-matic +DCP-o-matic ----------- Hello! @@ -33,27 +33,22 @@ You will need these libraries: libsndfile libssh -and also the command line tool: - - vobcopy (if you want to rip DVDs straight into DVD-o-matic) - Documentation ------------- -There is a manual available at http://carlh.net/software/dvdomatic +There is a manual available at http://carlh.net/software/dcpomatic The DocBook source for this is in doc/manual. In a nutshell ------------- -The `dvdomatic' program is a GTK front-end which is probably easiest +The `dcpomatic' program is a GTK front-end which is probably easiest to use. It will create a directory for a particular project, and write its data to that directory. The basic approach is: "File->New"; specify a directory. -Choose "Jobs->Copy from DVD" to read a DVD from your drive, if you have one. Fill in the fields in the window (most importantly the `content' field: specify your video, and the `Name' field: give your project [and hence DCP] a name.) @@ -76,7 +71,7 @@ Server/client ------------- Running the `servomatic' program on a remote machine will make it -listen on port 6192 (by default) and process requests from a dvdomatic +listen on port 6192 (by default) and process requests from a dcpomatic instance. This has been written with no thought to security, so don't do it over the public internet! The connection will probably need to be 1 Gb/s to make it worthwhile. diff --git a/TODO b/TODO deleted file mode 100644 index 17f02e429..000000000 --- a/TODO +++ /dev/null @@ -1,137 +0,0 @@ -Make a DCP with subs using subtitle edit. - -Look at http://liblqr.wikidot.com/en:manual - -EC2 - -Small instance $0.085 ph -Sintel Trailer 1080p @ 200000 Mbps -1247 frames @ 24fps ie 51.96s -Took 1h20 to encode - -High-CPU medium $0.186 ph -Sintel Trailer 1080p @ 200000 Mbps -1247 frames @ 24fps ie 51.96s -Took 23m to encode - -High-CPU extra-large $0.744 ph -Sintel Trailer 1080p @ 200000 Mbps -1247 frames @ 24fps ie 51.96s - - -Transfer in free -Transfer out $0.120 per GB - - -Port DVD rip - -Write still j2ks straight to a MXF. -md5_data to use openssl -Write all j2ks straight to a MXF? Possible? - -Standardise j2c/j2k -Format name in ~/.dvdomatic screws up with spaces; use ID or something -Thumbnails are poorly named -x-thread signaller -Restartable jobs somehow -More logging -Nice error when trying to thumbnail with no content. -Destroy _buffer_src_context / _buffer_sink_context -Don't start later jobs when one breaks. -Compute time remaining based on more recent information. -Use lexical_cast more -Do deps better - -options summary - -1: L -2: R -3: C -4: Lfe -5: Ls -6: Rs - -City Screen - -Screen 1: "1.37" masking preset, projector only has DCI 133 preset. - -With 1480x1080 alignment in DCI 133: bottom you see purple, yellow; top purple; left and right no lines -With 1480x1080 alignment in DCI Flat: outside masks, but you see bottom purple, yellow; left/right all; top purple - - -Screen 2: no real masking preset, projector has DCI 133 and DCI 137 - -1480x1080, DCI 133 -L yellow purple -R none -B purple -T none -1480x1080, DCI 137 -L all -R all but blue -T purple -B purple - - -Screen 3: projector has DCI 1.38 - -1480x1080 -L, R, T none -B purple + yellow - - -films-0.6: Dolby Countdown looks as though it's 3D. THX Terminator 2 fucked -(these on default settings) -fq/gradfun --- no obvious effect -hqdn3d --- pretty good denoising -ow --- no obvious effect -tn --- interesting; much noise reduction, bad artefacts on movement, colour tint even in black -unsharp --- worse - -Benchmark SWS options: lanczos ? -hqdn3d=0:0:6 ? (turn off chroma/luma blurring) - -Lanczos; no visible effect on Ghostbusters. - - -THX_Monster with master Intel Core 2 Duo E4600 (2.4GHz), slave Intel Core i3 M350 (2.27GHz) -1920 x 1080 original -> DCI Flat -240 frames - -[Gbit: gigabit ethernet rather than 100Mbit] -[im-mod: after modification to memcpy RGB data then to RGB -> XYZ in the encode thread -[hack1]: after modification to pass YUV and to swscale in the encode thread (includes im-mod) -[hack2]: modified hack1 - Time Seconds FPS Speedup relative to 1 local -1 local: 20m57 1257 0.19 x 1 -2 local: 11m24 684 0.35 x 1.84 -2 local [im-mod]: 13m13 -2 local + 1 slave: 6m34 394 0.61 x 3.19 -2 local + 2 slave: 5m13 313 0.77 x 4.02 -2 local + 4 slave: 5m05 303 0.79 x 4.15 -2 local + 4 slave [Gbit]: 2m50 170 1.41 x 7.39 -2 local + 4 slave [Gbit,im-mod]:2m33 -2 local + 4 slave [Gbit,hack1]: 3m20 -2 local + 4 slave [Gbit,hack2]: 2m22 -1 local + 8 slave [Gbit]: 2m28 148 1.62 x 8.49 -2 local + 8 slave [Gbit]: 2m41 161 1.49 x 7.81 -2 local + 8 slave [Gbit,im-mod]:2m35 - - - -Just encode 52s -Encode + Image create 1m27 -Encode + Image create (memcpy, not convert) 53s. - -THX_Monster with master Intel Core i3 M350 (2.27GHz), slave Intel Core 2 Duo E4600 (2.4GHz) -1920 x 1080 original -> DCI Flat -240 frames - - -4 local: 2m45 -4 local [im-mod]: 2m53 -4 local + 2 slave [Gbit]: 2m22 -4 local + 4 slave [Gbit]: 2m21 -4 local + 4 slave [Gbit,in-mod]:2m21 - - diff --git a/branch-notes b/branch-notes new file mode 100644 index 000000000..0ed4dbb6a --- /dev/null +++ b/branch-notes @@ -0,0 +1,3 @@ +ffmpeg content selected stream is really a playlist thing. + + diff --git a/builds/control-12.04-32 b/builds/control-12.04-32 index 0f52d03ae..dc104958a 100644 --- a/builds/control-12.04-32 +++ b/builds/control-12.04-32 @@ -1,24 +1,24 @@ -Source: dvdomatic +Source: dcpomatic Section: video Priority: extra Maintainer: Carl Hetherington Build-Depends: debhelper (>= 8.0.0), python (>= 2.7.3), g++ (>= 4:4.6.3), pkg-config (>= 0.26), libwxgtk2.8-dev (>= 2.8.12.1), libssh-dev (>= 0.5.2), libboost-filesystem-dev (>= 1.46.0), libboost-thread-dev (>= 1.46.0), libsndfile1-dev (>= 1.0.25), libmagick++-dev (>= 8:6.6.9.7) Standards-Version: 3.9.3 -Homepage: http://carlh.net/software/dvdomatic +Homepage: http://carlh.net/software/dcpomatic -Package: dvdomatic +Package: dcpomatic Architecture: i386 Depends: libc6 (>= 2.15), libwxgtk2.8-0 (>= 2.8.12.1), libssh-4 (>= 0.5.2), libboost-filesystem1.46.1 (>= 1.46.1), libboost-thread1.46.1 (>= 1.46.1), libsndfile1 (>= 1.0.25), libmagick++4 (>= 8:6.6.9.7), libxml++2.6-2 (>= 2.34.1) Description: Generator of Digital Cinema Packages (DCPs) - DVD-o-matic generates Digital Cinema Packages (DCPs) from video and audio + DCP-o-matic generates Digital Cinema Packages (DCPs) from video and audio files (such as those from DVDs or Blu-Rays) for presentation on DCI-compliant digital projectors. -Package: dvdomatic-dbg +Package: dcpomatic-dbg Architecture: i386 Section: debug Priority: extra -Depends: ${dvdomatic:Depends}, ${misc:Depends} -Description: debugging symbols for dvdomatic - This package contains the debugging symbols for dvdomatic. +Depends: ${dcpomatic:Depends}, ${misc:Depends} +Description: debugging symbols for dcpomatic + This package contains the debugging symbols for dcpomatic. diff --git a/builds/control-12.04-64 b/builds/control-12.04-64 index fa4b4476e..09c636e4a 100644 --- a/builds/control-12.04-64 +++ b/builds/control-12.04-64 @@ -1,24 +1,24 @@ -Source: dvdomatic +Source: dcpomatic Section: video Priority: extra Maintainer: Carl Hetherington Build-Depends: debhelper (>= 8.0.0), python (>= 2.7.3), g++ (>= 4:4.6.3), pkg-config (>= 0.26), libwxgtk2.8-dev (>= 2.8.12.1), libssh-dev (>= 0.5.2), libboost-filesystem-dev (>= 1.46.0), libboost-thread-dev (>= 1.46.0), libsndfile1-dev (>= 1.0.25), libmagick++-dev (>= 8:6.6.9.7) Standards-Version: 3.9.3 -Homepage: http://carlh.net/software/dvdomatic +Homepage: http://carlh.net/software/dcpomatic -Package: dvdomatic +Package: dcpomatic Architecture: amd64 Depends: libc6 (>= 2.15), libwxgtk2.8-0 (>= 2.8.12.1), libssh-4 (>= 0.5.2), libboost-filesystem1.46.1 (>= 1.46.1), libboost-thread1.46.1 (>= 1.46.1), libsndfile1 (>= 1.0.25), libmagick++4 (>= 8:6.6.9.7), libxml++2.6-2 (>= 2.34.1) Description: Generator of Digital Cinema Packages (DCPs) - DVD-o-matic generates Digital Cinema Packages (DCPs) from video and audio + DCP-o-matic generates Digital Cinema Packages (DCPs) from video and audio files (such as those from DVDs or Blu-Rays) for presentation on DCI-compliant digital projectors. -Package: dvdomatic-dbg +Package: dcpomatic-dbg Architecture: amd64 Section: debug Priority: extra -Depends: ${dvdomatic:Depends}, ${misc:Depends} -Description: debugging symbols for dvdomatic - This package contains the debugging symbols for dvdomatic. +Depends: ${dcpomatic:Depends}, ${misc:Depends} +Description: debugging symbols for dcpomatic + This package contains the debugging symbols for dcpomatic. diff --git a/builds/control-12.10-32 b/builds/control-12.10-32 index 0e5fc1f46..1330b3e5f 100644 --- a/builds/control-12.10-32 +++ b/builds/control-12.10-32 @@ -1,23 +1,23 @@ -Source: dvdomatic +Source: dcpomatic Section: video Priority: extra Maintainer: Carl Hetherington Build-Depends: debhelper (>= 8.0.0), python (>= 2.7.3), g++ (>= 4:4.6.3), pkg-config (>= 0.26), libwxgtk2.8-dev (>= 2.8.12.1), libssh-dev (>= 0.5.2), libboost-filesystem-dev (>= 1.46.0), libboost-thread-dev (>= 1.46.0), libsndfile1-dev (>= 1.0.25), libmagick++-dev (>= 8:6.6.9.7) Standards-Version: 3.9.3 -Homepage: http://carlh.net/software/dvdomatic +Homepage: http://carlh.net/software/dcpomatic -Package: dvdomatic +Package: dcpomatic Architecture: i386 Depends: libc6 (>= 2.15), libwxgtk2.8-0 (>= 2.8.12.1), libssh-4 (>= 0.5.2), libboost-filesystem1.49.0 (>= 1.49.0), libboost-thread1.49.0 (>= 1.49.0), libsndfile1 (>= 1.0.25), libmagick++5 (>= 8:6.7.7.10), libxml++2.6-2 (>= 2.34.2) Description: Generator of Digital Cinema Packages (DCPs) - DVD-o-matic generates Digital Cinema Packages (DCPs) from video and audio + DCP-o-matic generates Digital Cinema Packages (DCPs) from video and audio files (such as those from DVDs or Blu-Rays) for presentation on DCI-compliant digital projectors. -Package: dvdomatic-dbg +Package: dcpomatic-dbg Architecture: i386 Section: debug Priority: extra -Depends: ${dvdomatic:Depends}, ${misc:Depends} -Description: debugging symbols for dvdomatic - This package contains the debugging symbols for dvdomatic. +Depends: ${dcpomatic:Depends}, ${misc:Depends} +Description: debugging symbols for dcpomatic + This package contains the debugging symbols for dcpomatic. diff --git a/builds/control-12.10-64 b/builds/control-12.10-64 index 24e16b4b5..ea1c491ed 100644 --- a/builds/control-12.10-64 +++ b/builds/control-12.10-64 @@ -1,24 +1,24 @@ -Source: dvdomatic +Source: dcpomatic Section: video Priority: extra Maintainer: Carl Hetherington Build-Depends: debhelper (>= 8.0.0), python (>= 2.7.3), g++ (>= 4:4.6.3), pkg-config (>= 0.26), libwxgtk2.8-dev (>= 2.8.12.1), libssh-dev (>= 0.5.2), libboost-filesystem-dev (>= 1.46.0), libboost-thread-dev (>= 1.46.0), libsndfile1-dev (>= 1.0.25), libmagick++-dev (>= 8:6.6.9.7) Standards-Version: 3.9.3 -Homepage: http://carlh.net/software/dvdomatic +Homepage: http://carlh.net/software/dcpomatic -Package: dvdomatic +Package: dcpomatic Architecture: amd64 Depends: libc6 (>= 2.15), libwxgtk2.8-0 (>= 2.8.12.1), libssh-4 (>= 0.5.2), libboost-filesystem1.49.0 (>= 1.49.0), libboost-thread1.49.0 (>= 1.49.0), libsndfile1 (>= 1.0.25), libmagick++5 (>= 8:6.7.7.10), libxml++2.6-2 (>= 2.34.2) Description: Generator of Digital Cinema Packages (DCPs) - DVD-o-matic generates Digital Cinema Packages (DCPs) from video and audio + DCP-o-matic generates Digital Cinema Packages (DCPs) from video and audio files (such as those from DVDs or Blu-Rays) for presentation on DCI-compliant digital projectors. -Package: dvdomatic-dbg +Package: dcpomatic-dbg Architecture: amd64 Section: debug Priority: extra -Depends: ${dvdomatic:Depends}, ${misc:Depends} -Description: debugging symbols for dvdomatic - This package contains the debugging symbols for dvdomatic. +Depends: ${dcpomatic:Depends}, ${misc:Depends} +Description: debugging symbols for dcpomatic + This package contains the debugging symbols for dcpomatic. diff --git a/cscript b/cscript index 4c54b0377..17f267628 100644 --- a/cscript +++ b/cscript @@ -7,8 +7,9 @@ def dependencies(target): return () else: return (('openjpeg-cdist', None), + ('libcxml', None), ('ffmpeg-cdist', '488d5d4496af5e3a3b9d31d6b221e8eeada6b77e'), - ('libdcp', 'v0.49')) + ('libdcp', None)) def build(env, target): cmd = './waf configure --prefix=%s' % env.work_dir_cscript() @@ -42,14 +43,14 @@ def package(env, target, version): shutil.copyfile('builds/control-%s-%d' % (target.version, target.bits), 'debian/control') env.command('./waf dist') f = open('debian/files', 'w') - print >>f,'dvdomatic_%s-1_%s.deb video extra' % (version, cpu) + print >>f,'dcpomatic_%s-1_%s.deb video extra' % (version, cpu) shutil.rmtree('build/deb', ignore_errors=True) os.makedirs('build/deb') os.chdir('build/deb') - shutil.move('../../dvdomatic-%s.tar.bz2' % version, 'dvdomatic_%s.orig.tar.bz2' % version) - env.command('tar xjf dvdomatic_%s.orig.tar.bz2' % version) - os.chdir('dvdomatic-%s' % version) + shutil.move('../../dcpomatic-%s.tar.bz2' % version, 'dcpomatic_%s.orig.tar.bz2' % version) + env.command('tar xjf dcpomatic_%s.orig.tar.bz2' % version) + os.chdir('dcpomatic-%s' % version) env.command('dch -b -v %s-1 "New upstream release."' % version) env.set('CDIST_LINKFLAGS', env.get('LINKFLAGS')) env.set('CDIST_CXXFLAGS', env.get('CXXFLAGS')) @@ -64,9 +65,9 @@ def package(env, target, version): def make_pot(env): env.command('./waf pot') - return [os.path.abspath('build/src/lib/libdvdomatic.pot'), - os.path.abspath('build/src/wx/libdvdomatic-wx.pot'), - os.path.abspath('build/src/tools/dvdomatic.pot')] + return [os.path.abspath('build/src/lib/libdcpomatic.pot'), + os.path.abspath('build/src/wx/libdcpomatic-wx.pot'), + os.path.abspath('build/src/tools/dcpomatic.pot')] def make_manual(env): os.chdir('doc/manual') diff --git a/dcpomatic.desktop.in b/dcpomatic.desktop.in new file mode 100644 index 000000000..aabd992f5 --- /dev/null +++ b/dcpomatic.desktop.in @@ -0,0 +1,10 @@ +[Desktop Entry] +Encoding=UTF-8 +Version=1.0 +Type=Application +Terminal=false +Exec=@PREFIX@/bin/dcpomatic +Name=DCP-o-matic +Icon=dcpomatic +Comment=DCP generator +Categories=AudioVideo;Video diff --git a/dcpomatic_batch.desktop.in b/dcpomatic_batch.desktop.in new file mode 100644 index 000000000..bab136e8a --- /dev/null +++ b/dcpomatic_batch.desktop.in @@ -0,0 +1,10 @@ +[Desktop Entry] +Encoding=UTF-8 +Version=1.0 +Type=Application +Terminal=false +Exec=@PREFIX@/bin/dcpomatic_batch +Name=DCP-o-matic Batch Converter +Icon=dcpomatic +Comment=DCP generator +Categories=AudioVideo;Video diff --git a/debian/changelog b/debian/changelog index 9035ca116..1cb0a7d31 100644 --- a/debian/changelog +++ b/debian/changelog @@ -1,388 +1,358 @@ -dvdomatic (0.92-1) UNRELEASED; urgency=low - - * New upstream release. - - -- Carl Hetherington Sun, 19 May 2013 12:35:52 +0100 - -dvdomatic (0.91-1) UNRELEASED; urgency=low - - * New upstream release. - - -- Carl Hetherington Sun, 19 May 2013 00:11:52 +0100 - -dvdomatic (0.90-1) UNRELEASED; urgency=low - - * New upstream release. - - -- Carl Hetherington Fri, 17 May 2013 16:29:58 +0100 - -dvdomatic (0.89-1) UNRELEASED; urgency=low - - * New upstream release. - - -- Carl Hetherington Mon, 06 May 2013 02:03:25 +0100 - -dvdomatic (0.89beta1-1) UNRELEASED; urgency=low - - * New upstream release. - - -- Carl Hetherington Sat, 04 May 2013 21:15:34 +0100 - -dvdomatic (0.88-1) UNRELEASED; urgency=low +dcpomatic (0.88-1) UNRELEASED; urgency=low * New upstream release. -- Carl Hetherington Sun, 28 Apr 2013 16:28:17 +0100 -dvdomatic (0.87-1) UNRELEASED; urgency=low +dcpomatic (0.87-1) UNRELEASED; urgency=low * New upstream release. -- Carl Hetherington Fri, 26 Apr 2013 09:53:27 +0100 -dvdomatic (0.86-1) UNRELEASED; urgency=low +dcpomatic (0.86-1) UNRELEASED; urgency=low * New upstream release. -- Carl Hetherington Tue, 23 Apr 2013 08:13:13 +0100 -dvdomatic (0.85-1) UNRELEASED; urgency=low +dcpomatic (0.85-1) UNRELEASED; urgency=low * New upstream release. -- Carl Hetherington Tue, 23 Apr 2013 00:08:20 +0100 -dvdomatic (0.84-1) UNRELEASED; urgency=low +dcpomatic (0.84-1) UNRELEASED; urgency=low * New upstream release. -- Carl Hetherington Sun, 21 Apr 2013 17:49:54 +0100 -dvdomatic (0.84beta5-1) UNRELEASED; urgency=low +dcpomatic (0.84beta5-1) UNRELEASED; urgency=low * New upstream release. -- Carl Hetherington Sun, 21 Apr 2013 00:06:12 +0100 -dvdomatic (0.84beta4-1) UNRELEASED; urgency=low +dcpomatic (0.84beta4-1) UNRELEASED; urgency=low * New upstream release. -- Carl Hetherington Fri, 19 Apr 2013 17:41:58 +0100 -dvdomatic (0.84beta3-1) UNRELEASED; urgency=low +dcpomatic (0.84beta3-1) UNRELEASED; urgency=low * New upstream release. -- Carl Hetherington Fri, 19 Apr 2013 11:36:37 +0100 -dvdomatic (0.84beta2-1) UNRELEASED; urgency=low +dcpomatic (0.84beta2-1) UNRELEASED; urgency=low * New upstream release. -- Carl Hetherington Fri, 19 Apr 2013 11:12:09 +0100 -dvdomatic (0.84beta1-1) UNRELEASED; urgency=low +dcpomatic (0.84beta1-1) UNRELEASED; urgency=low * New upstream release. -- Carl Hetherington Thu, 18 Apr 2013 23:32:17 +0100 -dvdomatic (0.83-1) UNRELEASED; urgency=low +dcpomatic (0.83-1) UNRELEASED; urgency=low * New upstream release. -- Carl Hetherington Wed, 10 Apr 2013 12:48:25 +0100 -dvdomatic (0.82-1) UNRELEASED; urgency=low +dcpomatic (0.82-1) UNRELEASED; urgency=low * New upstream release. -- Carl Hetherington Tue, 09 Apr 2013 23:43:35 +0100 -dvdomatic (0.82beta1-1) UNRELEASED; urgency=low +dcpomatic (0.82beta1-1) UNRELEASED; urgency=low * New upstream release. -- Carl Hetherington Tue, 09 Apr 2013 21:48:56 +0100 -dvdomatic (0.81-1) UNRELEASED; urgency=low +dcpomatic (0.81-1) UNRELEASED; urgency=low * New upstream release. -- Carl Hetherington Tue, 09 Apr 2013 19:48:04 +0100 -dvdomatic (0.81beta1-1) UNRELEASED; urgency=low +dcpomatic (0.81beta1-1) UNRELEASED; urgency=low * New upstream release. -- Carl Hetherington Tue, 09 Apr 2013 15:37:32 +0100 -dvdomatic (0.80-1) UNRELEASED; urgency=low +dcpomatic (0.80-1) UNRELEASED; urgency=low * New upstream release. -- Carl Hetherington Sun, 07 Apr 2013 23:48:12 +0100 -dvdomatic (0.80beta4-1) UNRELEASED; urgency=low +dcpomatic (0.80beta4-1) UNRELEASED; urgency=low * New upstream release. -- Carl Hetherington Sun, 07 Apr 2013 23:08:49 +0100 -dvdomatic (0.80beta3-1) UNRELEASED; urgency=low +dcpomatic (0.80beta3-1) UNRELEASED; urgency=low * New upstream release. -- Carl Hetherington Sun, 07 Apr 2013 22:44:29 +0100 -dvdomatic (0.80beta2-1) UNRELEASED; urgency=low +dcpomatic (0.80beta2-1) UNRELEASED; urgency=low * New upstream release. -- Carl Hetherington Sun, 07 Apr 2013 22:19:34 +0100 -dvdomatic (0.80beta1-1) UNRELEASED; urgency=low +dcpomatic (0.80beta1-1) UNRELEASED; urgency=low * New upstream release. -- Carl Hetherington Sun, 07 Apr 2013 18:21:33 +0100 -dvdomatic (0.79-1) UNRELEASED; urgency=low +dcpomatic (0.79-1) UNRELEASED; urgency=low * New upstream release. -- Carl Hetherington Mon, 01 Apr 2013 22:37:03 +0100 -dvdomatic (0.78-1) UNRELEASED; urgency=low +dcpomatic (0.78-1) UNRELEASED; urgency=low * New upstream release. -- Carl Hetherington Sun, 31 Mar 2013 02:43:03 +0100 -dvdomatic (0.78beta16-1) UNRELEASED; urgency=low +dcpomatic (0.78beta16-1) UNRELEASED; urgency=low * New upstream release. -- Carl Hetherington Thu, 28 Mar 2013 16:28:05 +0000 -dvdomatic (0.78beta15-1) UNRELEASED; urgency=low +dcpomatic (0.78beta15-1) UNRELEASED; urgency=low * New upstream release. -- Carl Hetherington Thu, 28 Mar 2013 14:25:56 +0000 -dvdomatic (0.78beta14-1) UNRELEASED; urgency=low +dcpomatic (0.78beta14-1) UNRELEASED; urgency=low * New upstream release. -- Carl Hetherington Thu, 28 Mar 2013 10:38:07 +0000 -dvdomatic (0.78beta13-1) UNRELEASED; urgency=low +dcpomatic (0.78beta13-1) UNRELEASED; urgency=low * New upstream release. -- Carl Hetherington Wed, 27 Mar 2013 12:26:55 +0000 -dvdomatic (0.78beta12-1) UNRELEASED; urgency=low +dcpomatic (0.78beta12-1) UNRELEASED; urgency=low * New upstream release. -- Carl Hetherington Tue, 26 Mar 2013 21:13:54 +0000 -dvdomatic (0.78beta11-1) UNRELEASED; urgency=low +dcpomatic (0.78beta11-1) UNRELEASED; urgency=low * New upstream release. -- Carl Hetherington Tue, 26 Mar 2013 17:34:49 +0000 -dvdomatic (0.78beta10-1) UNRELEASED; urgency=low +dcpomatic (0.78beta10-1) UNRELEASED; urgency=low * New upstream release. -- Carl Hetherington Tue, 26 Mar 2013 11:35:15 +0000 -dvdomatic (0.78beta9-1) UNRELEASED; urgency=low +dcpomatic (0.78beta9-1) UNRELEASED; urgency=low * New upstream release. -- Carl Hetherington Tue, 26 Mar 2013 10:36:05 +0000 -dvdomatic (0.78beta8-1) UNRELEASED; urgency=low +dcpomatic (0.78beta8-1) UNRELEASED; urgency=low * New upstream release. -- Carl Hetherington Tue, 26 Mar 2013 00:59:36 +0000 -dvdomatic (0.78beta7-1) UNRELEASED; urgency=low +dcpomatic (0.78beta7-1) UNRELEASED; urgency=low * New upstream release. -- Carl Hetherington Tue, 26 Mar 2013 00:19:21 +0000 -dvdomatic (0.78beta6-1) UNRELEASED; urgency=low +dcpomatic (0.78beta6-1) UNRELEASED; urgency=low * New upstream release. -- Carl Hetherington Mon, 25 Mar 2013 00:08:10 +0000 -dvdomatic (0.78beta5-1) UNRELEASED; urgency=low +dcpomatic (0.78beta5-1) UNRELEASED; urgency=low * New upstream release. -- Carl Hetherington Thu, 21 Mar 2013 16:32:21 +0000 -dvdomatic (0.78beta4-1) UNRELEASED; urgency=low +dcpomatic (0.78beta4-1) UNRELEASED; urgency=low * New upstream release. -- Carl Hetherington Wed, 20 Mar 2013 15:01:10 +0000 -dvdomatic (0.78beta3-1) UNRELEASED; urgency=low +dcpomatic (0.78beta3-1) UNRELEASED; urgency=low * New upstream release. -- Carl Hetherington Wed, 20 Mar 2013 10:49:17 +0000 -dvdomatic (0.78beta2-1) UNRELEASED; urgency=low +dcpomatic (0.78beta2-1) UNRELEASED; urgency=low * New upstream release. -- Carl Hetherington Tue, 19 Mar 2013 21:35:50 +0000 -dvdomatic (0.78beta1-1) UNRELEASED; urgency=low +dcpomatic (0.78beta1-1) UNRELEASED; urgency=low * New upstream release. -- Carl Hetherington Tue, 19 Mar 2013 20:50:54 +0000 -dvdomatic (0.77-1) UNRELEASED; urgency=low +dcpomatic (0.77-1) UNRELEASED; urgency=low * New upstream release. -- Carl Hetherington Thu, 14 Mar 2013 17:12:03 +0000 -dvdomatic (0.77beta2-1) UNRELEASED; urgency=low +dcpomatic (0.77beta2-1) UNRELEASED; urgency=low * New upstream release. -- Carl Hetherington Thu, 14 Mar 2013 15:50:43 +0000 -dvdomatic (0.77beta1-1) UNRELEASED; urgency=low +dcpomatic (0.77beta1-1) UNRELEASED; urgency=low * New upstream release. -- Carl Hetherington Thu, 14 Mar 2013 15:14:01 +0000 -dvdomatic (0.76-1) UNRELEASED; urgency=low +dcpomatic (0.76-1) UNRELEASED; urgency=low * New upstream release. -- Carl Hetherington Tue, 05 Mar 2013 13:30:28 +0000 -dvdomatic (0.76beta3-1) UNRELEASED; urgency=low +dcpomatic (0.76beta3-1) UNRELEASED; urgency=low * New upstream release. -- Carl Hetherington Tue, 05 Mar 2013 12:47:20 +0000 -dvdomatic (0.76beta2-1) UNRELEASED; urgency=low +dcpomatic (0.76beta2-1) UNRELEASED; urgency=low * New upstream release. -- Carl Hetherington Fri, 01 Mar 2013 18:32:16 +0000 -dvdomatic (0.76beta1-1) UNRELEASED; urgency=low +dcpomatic (0.76beta1-1) UNRELEASED; urgency=low * New upstream release. -- Carl Hetherington Fri, 01 Mar 2013 17:36:55 +0000 -dvdomatic (0.75-1) UNRELEASED; urgency=low +dcpomatic (0.75-1) UNRELEASED; urgency=low * New upstream release. -- Carl Hetherington Wed, 27 Feb 2013 11:03:07 +0000 -dvdomatic (0.75beta1-1) UNRELEASED; urgency=low +dcpomatic (0.75beta1-1) UNRELEASED; urgency=low * New upstream release. -- Carl Hetherington Wed, 27 Feb 2013 08:20:42 +0000 -dvdomatic (0.74-1) UNRELEASED; urgency=low +dcpomatic (0.74-1) UNRELEASED; urgency=low * New upstream release. -- Carl Hetherington Sat, 23 Feb 2013 22:57:20 +0000 -dvdomatic (0.74beta1-1) UNRELEASED; urgency=low +dcpomatic (0.74beta1-1) UNRELEASED; urgency=low * New upstream release. -- Carl Hetherington Sat, 23 Feb 2013 21:44:22 +0000 -dvdomatic (0.73-1) UNRELEASED; urgency=low +dcpomatic (0.73-1) UNRELEASED; urgency=low * New upstream release. -- Carl Hetherington Thu, 21 Feb 2013 00:43:40 +0000 -dvdomatic (0.73beta9-1) UNRELEASED; urgency=low +dcpomatic (0.73beta9-1) UNRELEASED; urgency=low * New upstream release. -- Carl Hetherington Wed, 20 Feb 2013 23:40:24 +0000 -dvdomatic (0.73beta8-1) UNRELEASED; urgency=low +dcpomatic (0.73beta8-1) UNRELEASED; urgency=low * New upstream release. -- Carl Hetherington Mon, 18 Feb 2013 22:35:51 +0000 -dvdomatic (0.73beta7-1) UNRELEASED; urgency=low +dcpomatic (0.73beta7-1) UNRELEASED; urgency=low * New upstream release. -- Carl Hetherington Mon, 18 Feb 2013 20:38:51 +0000 -dvdomatic (0.73beta6-1) UNRELEASED; urgency=low +dcpomatic (0.73beta6-1) UNRELEASED; urgency=low * New upstream release. -- Carl Hetherington Sun, 17 Feb 2013 23:05:56 +0000 -dvdomatic (0.73beta3-1) UNRELEASED; urgency=low +dcpomatic (0.73beta3-1) UNRELEASED; urgency=low * New upstream release. -- Carl Hetherington Sun, 17 Feb 2013 23:05:05 +0000 -dvdomatic (0.73beta2-1) UNRELEASED; urgency=low +dcpomatic (0.73beta2-1) UNRELEASED; urgency=low * New upstream release. -- Carl Hetherington Sat, 16 Feb 2013 22:42:32 +0000 -dvdomatic (0.73beta1-1) UNRELEASED; urgency=low +dcpomatic (0.73beta1-1) UNRELEASED; urgency=low * New upstream release. -- Carl Hetherington Sat, 16 Feb 2013 21:19:24 +0000 -dvdomatic (0.72-1) UNRELEASED; urgency=low +dcpomatic (0.72-1) UNRELEASED; urgency=low * New upstream release. -- Carl Hetherington Thu, 24 Jan 2013 15:31:57 +0000 -dvdomatic (0.71-1) UNRELEASED; urgency=low +dcpomatic (0.71-1) UNRELEASED; urgency=low * New upstream release. -- Carl Hetherington Thu, 24 Jan 2013 11:36:04 +0000 -dvdomatic (0.70-1) UNRELEASED; urgency=low +dcpomatic (0.70-1) UNRELEASED; urgency=low * New upstream release. * New upstream release. @@ -390,7 +360,7 @@ dvdomatic (0.70-1) UNRELEASED; urgency=low -- Carl Hetherington Sat, 12 Jan 2013 23:07:15 +0000 -dvdomatic (0.70beta3-1) UNRELEASED; urgency=low +dcpomatic (0.70beta3-1) UNRELEASED; urgency=low * New upstream release. * New upstream release. @@ -399,13 +369,13 @@ dvdomatic (0.70beta3-1) UNRELEASED; urgency=low -- Carl Hetherington Sun, 06 Jan 2013 23:44:24 +0000 -dvdomatic (0.68-1) UNRELEASED; urgency=low +dcpomatic (0.68-1) UNRELEASED; urgency=low * New upstream release. -- Carl Hetherington Sun, 23 Dec 2012 01:43:44 +0000 -dvdomatic (0.68beta10-1) UNRELEASED; urgency=low +dcpomatic (0.68beta10-1) UNRELEASED; urgency=low * New upstream release. * New upstream release. @@ -415,91 +385,91 @@ dvdomatic (0.68beta10-1) UNRELEASED; urgency=low -- Carl Hetherington Sat, 22 Dec 2012 13:27:27 +0000 -dvdomatic (0.68beta5-1) unstable; urgency=low +dcpomatic (0.68beta5-1) unstable; urgency=low * New upstream release. -- Carl Hetherington Thu, 20 Dec 2012 07:53:46 +0000 -dvdomatic (0.68beta4-1) unstable; urgency=low +dcpomatic (0.68beta4-1) unstable; urgency=low * New upstream release. -- Carl Hetherington Thu, 20 Dec 2012 07:48:45 +0000 -dvdomatic (0.68beta3-1) unstable; urgency=low +dcpomatic (0.68beta3-1) unstable; urgency=low * New upstream release. -- Carl Hetherington Thu, 20 Dec 2012 00:35:45 +0000 -dvdomatic (0.68beta2-1) unstable; urgency=low +dcpomatic (0.68beta2-1) unstable; urgency=low * New upstream release. -- Carl Hetherington Wed, 19 Dec 2012 11:22:58 +0000 -dvdomatic (0.68beta1-1) unstable; urgency=low +dcpomatic (0.68beta1-1) unstable; urgency=low * New upstream release. -- Carl Hetherington Wed, 19 Dec 2012 10:11:13 +0000 -dvdomatic (0.67-1) unstable; urgency=low +dcpomatic (0.67-1) unstable; urgency=low * New upstream release. -- Carl Hetherington Tue, 18 Dec 2012 23:49:27 +0000 -dvdomatic (0.66-1) unstable; urgency=low +dcpomatic (0.66-1) unstable; urgency=low * New upstream release. -- Carl Hetherington Tue, 18 Dec 2012 11:29:04 +0000 -dvdomatic (0.65-1) unstable; urgency=low +dcpomatic (0.65-1) unstable; urgency=low * New upstream release. -- Carl Hetherington Tue, 18 Dec 2012 09:24:56 +0000 -dvdomatic (0.64-1) unstable; urgency=low +dcpomatic (0.64-1) unstable; urgency=low * New upstream release. -- Carl Hetherington Thu, 13 Dec 2012 21:52:09 +0000 -dvdomatic (0.63pre-1) unstable; urgency=low +dcpomatic (0.63pre-1) unstable; urgency=low * New upstream release. -- Carl Hetherington Tue, 11 Dec 2012 23:15:52 +0000 -dvdomatic (0.60-1) unstable; urgency=low +dcpomatic (0.60-1) unstable; urgency=low * New upstream release. -- Carl Hetherington Tue, 11 Dec 2012 22:46:04 +0000 -dvdomatic (0.59-1) unstable; urgency=low +dcpomatic (0.59-1) unstable; urgency=low * New upstream release. -- Carl Hetherington Mon, 10 Dec 2012 20:58:19 +0000 -dvdomatic (0.59beta5-1) unstable; urgency=low +dcpomatic (0.59beta5-1) unstable; urgency=low * New upstream release. -- Carl Hetherington Sun, 09 Dec 2012 23:51:55 +0000 -dvdomatic (0.59beta4-1) unstable; urgency=low +dcpomatic (0.59beta4-1) unstable; urgency=low * New upstream release. -- Carl Hetherington Sun, 09 Dec 2012 21:38:00 +0000 -dvdomatic (0.59beta1-1) unstable; urgency=low +dcpomatic (0.59beta1-1) unstable; urgency=low * Initial release. diff --git a/debian/copyright b/debian/copyright index 2579947e4..0cf23aacd 100644 --- a/debian/copyright +++ b/debian/copyright @@ -1,6 +1,6 @@ Format: http://www.debian.org/doc/packaging-manuals/copyright-format/1.0/ -Upstream-Name: dvdomatic -Source: +Upstream-Name: dcpomatic +Source: Files: * Copyright: 2012 Carl Hetherington diff --git a/debian/files b/debian/files index 7639f05ac..ca46cf438 100644 --- a/debian/files +++ b/debian/files @@ -1 +1 @@ -dvdomatic_0.59beta1-1_i386.deb video extra +dcpomatic_0.59beta1-1_i386.deb video extra diff --git a/debian/rules b/debian/rules index f2b2219be..29f926c31 100755 --- a/debian/rules +++ b/debian/rules @@ -20,8 +20,8 @@ override_dh_auto_build: ./waf --nocache build override_dh_auto_install: - ./waf --nocache install --destdir=debian/dvdomatic + ./waf --nocache install --destdir=debian/dcpomatic .PHONY: override_dh_strip override_dh_strip: - dh_strip --dbg-package=dvdomatic-dbg + dh_strip --dbg-package=dcpomatic-dbg diff --git a/doc/design/content.tex b/doc/design/content.tex new file mode 100644 index 000000000..0f5f17025 --- /dev/null +++ b/doc/design/content.tex @@ -0,0 +1,195 @@ +\documentclass{article} +\begin{document} + +\section{Status quo} + +As at 0.78 there is an unfortunate mish-mash of code to handle the +input `content' the goes into a DCP. + +The Film has a `content' file name. This is guessed to be either a +movie (for FFmpeg) or a still-image (for ImageMagick) based on its +extension. We also have `external audio', which is a set of WAV files +for libsndfile, and a flag to enable that. + +The `content' file is badly named and limiting. We can't have +multiple content files, and it's not really the `content' as such (it +used to be, but increasingly it's only a part of the content, on equal +footing with `external' audio). + +The choice of sources for sound is expressed clumsily by the +AudioStream class hierarchy. + + +\section{Targets} + +We want to be able to implement the following: + +\begin{itemize} +\item Immediately: +\begin{itemize} +\item Multiple still images, each with their own duration, made into a `slide-show' +\item Lack of bugs in adding WAV-file audio to still images. +\item External subtitle files (either XML or SRT) to be converted to XML subtitles in the DCP. +\end{itemize} + +\item In the future: +\begin{itemize} +\item Playlist-style multiple video / audio (perhaps). +\end{itemize} +\end{itemize} + + +\section{Content hierarchy} + +One idea is to have a hierarchy of Content classes (\texttt{Content}, +\texttt{\{Video/Audio\}Content}, \texttt{FFmpegContent}, \texttt{ImageMagickContent}, +\texttt{SndfileContent}). + +Then the Film has a list of these, and decides what to put into the +DCP based on some rules. These rules would probably be fixed (for +now), with the possibility to expand later into some kind of playlist. + + +\section{Immediate questions} + +\subsection{What Film attributes are video-content specific, and which are general?} + +Questionable attributes: + +\begin{itemize} +\item Trust content header +\item Crop +\item Filters + +Post-processing (held as part of the filters description) is done in +the encoder, by which time all knowledge of the source is lost. + +\item Scaler +\item Trim start/end + +Messily tied in with the encoding side. We want to implement this +using start/end point specifications in the DCP reel, otherwise +modifying the trim points requires a complete re-encode. + +\item Audio gain +\item Audio delay +\item With subtitles +\item Subtitle offset/scale +\item Colour LUT +\end{itemize} + +Attributes that I think must remain in Film: +\begin{itemize} +\item DCP content type +\item Format +\item A/B +\item J2K bandwidth +\end{itemize} + +Part of the consideration here is that per-content attributes need to +be represented in the GUI differently to how things are represented +now. + +Bear in mind also that, as it stands, the only options for video are: + +\begin{enumerate} +\item An FFmpeg video +\item A set of stills +\end{enumerate} + +and so the need for multiple scalers, crop and filters is +questionable. Also, there is one set of audio (either from WAVs or +from the FFMpeg file), so per-content audio gain/delay is also +questionable. Trust content header is only applicable for FFmpeg +content, really. Similarly trim, with-subtitles, subtitle details, +colour LUT; basically none of it is really important right now. + +Hence it may be sensible to keep everything in Film and move it later +along YAGNI lines. + + +\subsection{Who answers questions like: ``what is the length of video?''?} + +If we have FFmpeg video, the question is easy to answer. For a set of +stills, it is less easy. Who knows that we are sticking them all +together end-to-end, with different durations for each? + +If we have one-content-object equalling one file, the content objects +will presumably know how long their file should be displayed for. +There would appear to be two options following this: + +\begin{enumerate} +\item There is one \texttt{ImageMagickDecoder} which is fed all the + files, and outputs them in order. The magic knowledge is then + within this class, really. +\item There are multiple \texttt{ImageMagickDecoder} classes, one per + \texttt{..Content}, and some controlling (`playlist') class to manage + them. The `playlist' is then itself a + \texttt{\{Video/Audio\}Source}, and has the magic knowledge. +\end{enumerate} + + +\section{Playlist approach} + +Let's try the playlist approach. We define a hierarchy of content classes: + +\begin{verbatim} + +class Content +{ +public: + boost::filesystem::path file () const; +}; + +class VideoContent : virtual public Content +{ +public: + VideoContentFrame video_length () const; + float video_frame_rate () const; + libdcp::Size size () const; + +}; + +class AudioContent : virtual public Content +{ + +}; + +class FFmpegContent : public VideoContent, public AudioContent +{ +public: + .. stream stuff .. +}; + +class ImageMagickContent : public VideoContent +{ + +}; + +class SndfileContent : public AudioContent +{ +public: + .. channel allocation for this file .. +}; +\end{verbatim} + +Then Film has a \texttt{Playlist} which has a +\texttt{vector >}. It can answer questions +about audio/video length, frame rate, audio channels and so on. + +\texttt{Playlist} can also be a source of video and audio, so clients can do: + +\begin{verbatim} +shared_ptr p = film->playlist (); +p->Video.connect (foo); +p->Audio.connect (foo); +while (!p->pass ()) { + /* carry on */ +} +\end{verbatim} + +Playlist could be created on-demand for all the difference it would +make. And perhaps it should, since it will hold Decoders which are +probably run-once. + +\end{document} diff --git a/doc/mainpage.txt b/doc/mainpage.txt index 59c578899..649c9c609 100644 --- a/doc/mainpage.txt +++ b/doc/mainpage.txt @@ -1,37 +1,37 @@ -/** @mainpage DVD-o-matic +/** @mainpage DCP-o-matic * - * DVD-o-matic is a tool to create digital cinema packages (DCPs) from + * DCP-o-matic is a tool to create digital cinema packages (DCPs) from * video files, or from sets of TIFF image files. It is written in C++ * and distributed under the GPL. * * Video files are decoded using FFmpeg (http://ffmpeg.org), so any video - * supported by FFmpeg should be usable with DVD-o-matic. DVD-o-matic's output has been + * supported by FFmpeg should be usable with DCP-o-matic. DCP-o-matic's output has been * tested on numerous digital projectors. * - * DVD-o-matic allows you to crop black borders from movies, scale them to the correct + * DCP-o-matic allows you to crop black borders from movies, scale them to the correct * aspect ratio and apply FFmpeg filters. The time-consuming encoding of JPEG2000 files * can be parallelised amongst any number of processors on the local host and any number * of servers over a network. * - * DVD-o-matic can also make DCPs from still images, for advertisements and such-like. + * DCP-o-matic can also make DCPs from still images, for advertisements and such-like. * - * Parts of DVD-o-matic are based on OpenDCP (http://code.google.com/p/opendcp), + * Parts of DCP-o-matic are based on OpenDCP (http://code.google.com/p/opendcp), * written by Terrence Meiczinger. * - * DVD-o-matic uses libopenjpeg (http://code.google.com/p/openjpeg/) for JPEG2000 encoding + * DCP-o-matic uses libopenjpeg (http://code.google.com/p/openjpeg/) for JPEG2000 encoding * and libsndfile (http://www.mega-nerd.com/libsndfile/) for WAV file manipulation. It * also makes heavy use of the boost libraries (http://www.boost.org/). ImageMagick * (http://www.imagemagick.org/) is used for still-image encoding and decoding, and the GUI is * built using wxWidgets (http://wxwidgets.org/). It also uses libmhash (http://mhash.sourceforge.net/) * for debugging purposes. * - * Thanks are due to the authors and communities of all DVD-o-matic's dependencies. + * Thanks are due to the authors and communities of all DCP-o-matic's dependencies. * - * DVD-o-matic is distributed in the hope that there are still cinemas with projectionists + * DCP-o-matic is distributed in the hope that there are still cinemas with projectionists * who might want to use it. As Mark Kermode says, "if it doesn't have a projectionist * it's not a cinema - it's a sweetshop with a video-screen." * * Email correspondance is welcome to cth@carlh.net * - * More details can be found at http://carlh.net/software/dvdomatic + * More details can be found at http://carlh.net/software/dcpomatic */ diff --git a/doc/manual/Makefile b/doc/manual/Makefile index 94abc8516..115d7c3c8 100644 --- a/doc/manual/Makefile +++ b/doc/manual/Makefile @@ -1,4 +1,4 @@ -# DVD-o-matic manual makefile +# DCP-o-matic manual makefile all: html pdf @@ -8,7 +8,7 @@ SCREENSHOTS := file-new.png video-new-film.png still-new-film.png click-content- still-select-content-file.png examine-thumbs.png \ calculate-audio-gain.png prefs.png making-dcp.png filters.png film-tab.png video-tab.png audio-tab.png subtitles-tab.png -XML := dvdomatic.xml +XML := dcpomatic.xml GRAPHICS := @@ -70,7 +70,7 @@ diagrams/%.pdf: diagrams/%.svg # HTML # -html: $(XML) dvdomatic-html.xsl extensions-html.ent dvdomatic.css \ +html: $(XML) dcpomatic-html.xsl extensions-html.ent dcpomatic.css \ $(addprefix html/screenshots/,$(SCREENSHOTS)) \ $(subst .svg,.png,$(addprefix diagrams/,$(DIAGRAMS))) \ $(subst .svg,.png,$(addprefix graphics/,$(GRAPHICS))) \ @@ -80,19 +80,19 @@ html: $(XML) dvdomatic-html.xsl extensions-html.ent dvdomatic.css \ cp extensions-html.ent extensions.ent # DocBoox -> html - xmlto html -m dvdomatic-html.xsl dvdomatic.xml --skip-validation -o html + xmlto html -m dcpomatic-html.xsl dcpomatic.xml --skip-validation -o html # Copy graphics and CSS in # mkdir -p html/diagrams html/graphics # cp diagrams/*.png html/diagrams # cp graphics/*.png html/graphics - cp dvdomatic.css html + cp dcpomatic.css html # # PDF # -pdf: $(XML) dvdomatic-pdf.xsl extensions-pdf.ent screenshots/*.png $(subst .svg,.pdf,$(addprefix diagrams/,$(DIAGRAMS))) +pdf: $(XML) dcpomatic-pdf.xsl extensions-pdf.ent screenshots/*.png $(subst .svg,.pdf,$(addprefix diagrams/,$(DIAGRAMS))) # The DocBook needs to know what file extensions to look for # for screenshots and diagrams; use the correct file to tell it. @@ -100,14 +100,14 @@ pdf: $(XML) dvdomatic-pdf.xsl extensions-pdf.ent screenshots/*.png $(subst .svg, mkdir -p pdf - dblatex -p dvdomatic-pdf.xsl -s dvdomatic.sty -r pptex.py -T native dvdomatic.xml -t pdf -o pdf/dvdomatic.pdf + dblatex -p dcpomatic-pdf.xsl -s dcpomatic.sty -r pptex.py -T native dcpomatic.xml -t pdf -o pdf/dcpomatic.pdf # # LaTeX (handy for debugging) # -tex: $(XML) dvdomatic-pdf.xsl extensions-pdf.ent +tex: $(XML) dcpomatic-pdf.xsl extensions-pdf.ent # The DocBook needs to know what file extensions to look for # for screenshots and diagrams; use the correct file to tell it. @@ -116,8 +116,8 @@ tex: $(XML) dvdomatic-pdf.xsl extensions-pdf.ent mkdir -p tex # -P removes the revhistory table - dblatex -P doc.collab.show=0 -P latex.output.revhistory=0 -p dvdomatic-pdf.xsl -s dvdomatic.sty -r pptex.py -T native dvdomatic.xml -t tex -o tex/dvdomatic.tex + dblatex -P doc.collab.show=0 -P latex.output.revhistory=0 -p dcpomatic-pdf.xsl -s dcpomatic.sty -r pptex.py -T native dcpomatic.xml -t tex -o tex/dcpomatic.tex -clean:; rm -rf html pdf diagrams/*.pdf diagrams/*.png graphics/*.png *.aux dvdomatic.cb dvdomatic.cb2 dvdomatic.glo dvdomatic.idx dvdomatic.ilg - rm -rf dvdomatic.ind dvdomatic.lof dvdomatic.log dvdomatic.tex dvdomatic.toc extensions.ent dvdomatic.out +clean:; rm -rf html pdf diagrams/*.pdf diagrams/*.png graphics/*.png *.aux dcpomatic.cb dcpomatic.cb2 dcpomatic.glo dcpomatic.idx dcpomatic.ilg + rm -rf dcpomatic.ind dcpomatic.lof dcpomatic.log dcpomatic.tex dcpomatic.toc extensions.ent dcpomatic.out diff --git a/doc/manual/dcpomatic-html.xsl b/doc/manual/dcpomatic-html.xsl new file mode 100644 index 000000000..144675d47 --- /dev/null +++ b/doc/manual/dcpomatic-html.xsl @@ -0,0 +1,12 @@ + + + + + + + + + + diff --git a/doc/manual/dcpomatic-pdf.xml b/doc/manual/dcpomatic-pdf.xml new file mode 100644 index 000000000..414fb64b8 --- /dev/null +++ b/doc/manual/dcpomatic-pdf.xml @@ -0,0 +1,17 @@ + + + + +colorlinks,linkcolor=black,urlcolor=black + + +0 +0 + + +scale=0.6 + + +3 + + diff --git a/doc/manual/dcpomatic.css b/doc/manual/dcpomatic.css new file mode 100644 index 000000000..0e4982f20 --- /dev/null +++ b/doc/manual/dcpomatic.css @@ -0,0 +1,19 @@ +body { + font-family: luxi sans, sans-serif; + margin-left: 4em; + margin-right: 4em; + margin-top: 1em; + margin-bottom: 1em; + background-color: #E2E8EE; +} + +div.sidebar { + margin-left: 1em; + margin-right: 1em; + padding-left: 1em; + padding-right: 1em; + border-color: #000000; + border-width: 2px; + border-style: solid; + background-color: #E2E8EE; +} diff --git a/doc/manual/dcpomatic.sty b/doc/manual/dcpomatic.sty new file mode 100644 index 000000000..834e581fc --- /dev/null +++ b/doc/manual/dcpomatic.sty @@ -0,0 +1,68 @@ +%% +%% This style is derivated from the docbook one +%% +\NeedsTeXFormat{LaTeX2e} +\ProvidesPackage{ardour}[2007/04/04 My DocBook Style] + +%% Just use the original package and pass the options +\RequirePackageWithOptions{docbook} + +% Use a nice font +\usepackage{lmodern} + +% Define \dbend as the dangerous bend sign +\font\manual=manfnt +\def\dbend{{\manual\char127}} + +% Redefine sidebar environment to use the dangerous bend style +% Danger, Will Robinson! +\def\sidebar{\begin{trivlist}\item[]\noindent% +\begingroup\hangindent=2pc\hangafter=-2%\clubpenalty=10000% +\def\par{\endgraf\endgroup}% +\hbox to0pt{\hskip-\hangindent\dbend\hfill}\ignorespaces} +\def\endsidebar{\par\end{trivlist}} + + +% Futz with the title page; basically a copy of +% /usr/share/texmf/tex/latex/dblatex/style/dbk_title.sty +% with authors added. + +\def\DBKcover{ +\ifthenelse{\equal{\DBKedition}{}}{\def\edhead{}}{\def\edhead{Ed. \DBKedition}} + +\pagestyle{empty} + +% interligne double +\setlength{\oldbaselineskip}{\baselineskip} +\setlength{\baselineskip}{2\oldbaselineskip} +\textsf{ +\vfill +\vspace{2.5cm} +\begin{center} + \huge{\textbf{\DBKtitle}}\\ % + \ \\ % + \ \\ % + \Large{\DBKauthor}\\ % + \ifx\DBKsubtitle\relax\else% + \underline{\ \ \ \ \ \ \ \ \ \ \ }\\ % + \ \\ % + \huge{\textbf{\DBKsubtitle}}\\ % + \fi +\end{center} +\vfill +\setlength{\baselineskip}{\oldbaselineskip} +\hspace{1cm} +\vspace{1cm} +\begin{center} +\begin{tabular}{p{7cm} p{7cm}} +\Large{\DBKreference{} \edhead} & \\ +\end{tabular} +\end{center} +} + +% Format for the other pages +\newpage +\setlength{\baselineskip}{\oldbaselineskip} +%\chead[]{\DBKcheadfront} +\lfoot[]{} +} diff --git a/doc/manual/dcpomatic.xml b/doc/manual/dcpomatic.xml new file mode 100644 index 000000000..ee7b96083 --- /dev/null +++ b/doc/manual/dcpomatic.xml @@ -0,0 +1,932 @@ + + + + +%dbcent; + +%extensions; +]> + + + +DCP-o-matic +CarlHetherington + + + +Introduction + + +Hello, and welcome to DCP-o-matic! + + +
+What is DCP-o-matic? + + +DCP-o-matic is a program to generate Digital +Cinema Packages (DCPs) from DVDs, Blu-Rays, video files such as MP4 +and AVI, or still images. The resulting DCPs will play on modern digital +cinema projectors. + + + +You might find it useful to make DVDs easier to present, to encode +independently-shot feature films, or to generate local advertising for +your cinema. + + +
+ +
+Licence + + +DCP-o-matic is licensed under the GNU GPL. + + +
+ +
+ + +Installation + +
+Windows + + +To install DCP-o-matic on Windows, simply download the installer from +http://carlh.net +and double-click it. Click through the installer wizard, and +DCP-o-matic will be installed onto your machine. + + + +If you are using a 32-bit version of Windows, you will need the 32-bit +installer. For 64-bit Windows, either installer will work, but I +suggest you used the 64-bit version as it will allow DCP-o-matic to +use more memory. You may find that DCP-o-matic crashes if you run +many parallel encoding threads (more than 4) on the 32-bit +version. + + +
+ +
+Ubuntu Linux + + +You can install DCP-o-matic on Ubuntu 12.04 (‘Precise +Pangolin’) or 12.10 (‘Quantal Quetzal’) using +.deb packages: download the appropriate package from +http://carlh.net and +double-click it. Ubuntu will install the necessary bits and pieces +and set DCP-o-matic up for you. + + +
+ +
+Other Linux distributions + + +Installation on non-Ubuntu Linux is currently a little involved, as +there are no packages available (yet); you will have to compile it +from source. If you are using a non-Ubuntu distribution, do let me +know via the mailing +list and I will see about building some packages. + + + +The following dependencies are required: + +FFmpeg +libsndfile +OpenSSL +libopenjpeg +ImageMagick +Boost +libssh +GTK +wxWidgets +libdcp + + + + +Once you have installed the development packages for the dependencies, +download the source code from http://carlh.net, +unpack it and run the following commands from inside the source +directory: + + + +./waf configure +./waf build +sudo ./waf install + + + +With any luck, this will build and install DCP-o-matic on your system. To run it, enter: + + + +dcpomatic + + + +in a shell. + + +
+
+ + +Creating a video DCP + + +In this chapter we will see how to create a video DCP using +DCP-o-matic. We will gloss over some of the finer details, which are +explained in later chapters. + + +
+Creating a new film + + +Let's make a very simple DCP to see how DCP-o-matic works. First, we +need some content. Download the low-resolution trailer for the open +movie Sintel from their +website. Generally, of course, one would want to use the +highest-resolution material available, but for this test we will use +the low-resolution version to save everyone's bandwidth bills. + + + +Now, start DCP-o-matic and its window will open. First, we will +create a new ‘film’. A ‘film’ is how DCP-o-matic refers to +a piece of content, along with some settings, which we will make into +a DCP. DCP-o-matic stores its data in a folder on your disk while it +creates the DCP. You can create a new film by selecting +New from the File menu, as +shown in . + + +
+ Creating a new film + + + + + +
+ + +This will open a dialogue box for the new film, as shown in . + + +
+ Dialogue box for creating a new film + + + + + +
+ + +In this dialogue box you can choose a name for the film. This will be +used to name the folder to store its data in, and also as the initial +name for the DCP itself. You can also choose whereabouts you want to create +the film. In the example from the figure, DCP-o-matic will create a +folder called ‘DCP Test’ inside my home folder (carl) into which it +will write its working files. + + + +If you always create your DCPs in a particular folder, you can use +DCP-o-matic's Preferences to make life a little +easier by setting the default folder that DCP-o-matic will offer in this dialogue. +See . + + +
+ +
+Selecting content + + +The next step is to set the content that you want to use. Click the +content selector, as shown in , and a file chooser will +open for you to select the content file to use, as shown in . + + +
+ Opening the content selector + + + + + +
+ +
+ Selecting a video content file + + + + + +
+ + +Select your content file and click Open. In this +case we are using the Sintel trailer that we downloaded earlier. + + + +When you do this, DCP-o-matic will take a look at your file. After a +short while (when the progress bar at the bottom right of the window +has finished), you can look through your content using the slider to +the right of the window, as shown in . + + +
+ Examining the content + + + + + +
+ + +Dragging the slider will move through your video. You can also click +the Play button to play the content back. Note +that there will be no sound, and playback might not be entirely +accurate (it may be slightly slower or faster than it should be, for +example). This player is really only intended for brief inspection of +content; if you need to check it more thoroughly, use another player +such as Totem, mplayer or VLC. + + +
+ +
+Setting up + + +Now there are a few things to set up to describe how the DCP should be +created. The settings are divided into four tabs: film, video, audio and subtitles. + + +
+Film tab + + +The ‘film’ tab contains settings that pertain to the whole film, as shown in . + + +
+ Film settings tab + + + + + +
+ + +The first thing here is the name. This is generally set to the title +of the film that is being encoded. If Use DCI +name is not ticked, the name that you specify will be used +as-is for the name of the DCP. If Use DCI name +is ticked, the name that you enter will be used as part of a +DCI-compliant name. + + + +Underneath the name field is a preview of the name that the DCP will +get. To use a DCI-compliant name, tick the Use DCI +name checkbox. The DCI name will be composed using details +of your content's soundtrack, the current date and other things that +can be specified in the DCI name details dialogue box, which you can +open by clicking on the Details button. + + + +If the DCP name is long, it may not all be visible. You can see the +full name by hovering the mouse pointer over the partial name. + + + +The Trust content's header button starts off +checked, and this means that DCP-o-matic will use the content's header +information to determine its length. If, for some reason, this header +length is wrong, uncheck the Trust content's +header button and DCP-o-matic will run through the content +to find its exact length. This may take a while for large pieces of content. + + + +Next up is the content type. This can be +‘feature’, ‘trailer’ or whatever; select the +required type from the drop-down list. + + + +The trim frames settings allow you to trim frames +from the beginning and end of the content; any trimmed frames will not +be included in the DCP. + + +
+ +
+Video tab + + +This tab contains settings related to the picture in your DCP, as shown in . + + +
+ Video settings tab + + + + + +
+ + +The first option on this tab is the format. This will govern the +shape that DCP-o-matic will make your image into. Select the aspect +ratio that your content should be presented in. The ‘4:3 within +Flat’ and ‘16:9 within Flat’ settings will put the +image at the specified ratio within a Flat (1.85:1) frame, so that you +can project the DCP using your projector's Flat preset. + + + +The remaining options can often be left alone, but may sometimes be +useful. The ‘crop’ settings can be used to crop your +content, which can be used to remove black borders from round the +edges of DVD images, for example. The specified number of pixels will +be trimmed from each edge, and the content image in the right of the +window will be updated to show the effect of the crop. + + + +The ‘filters’ settings allow you to apply various video +filters to the image. These may be useful to try to improve +poor-quality sources like DVDs. We will discuss filtering later in the manual. + + + + +The ‘scaler’ is the method that will be used to scale up +your content to the required size for the DCP, if required. We will +discuss the options in more detail later; Bicubic is a fine choice in +most situations. + + + + +The ‘colour look-up table’ specifies the colour space that +your input content will be expected to be in. If in doubt, leave it +set to ‘sRGB’. + + + +Finally, the ‘JPEG2000 bandwidth’ setting changes how big the final +image files used within the DCP will be. Larger numbers will give +better quality, but correspondingly larger DCPs. The bandwidth can be +between 50 and 250 megabits per second (MBps). + + +
+ +
+Audio tab + + +This tab contains settings related to the sound in your DCP, as shown in . + + +
+ Audio settings tab + + + + + +
+ + + +‘Audio Gain’ is used to alter the volume of the +soundtrack. The specified gain (in dB) will be applied to each sound +channel before it is written to the DCP. + + + +If you use a sound processor that DCP-o-matic knows about, it can help +you calculate changes in gain that you should apply. Say, for +example, that you make a test DCP and find that you have to run it at +volume 5 instead of volume 7 to get a good sound level in the screen. +If this is the case, click the Calculate... +button next to the audio gain entry, and the dialogue box in will open. + + +
+ Calculating audio gain + + + + + +
+ + +For our example, put 5 in the first box and 7 in the second and click +OK. DCP-o-matic will calculate the audio gain +that it should apply to make this happen. Then you can re-make the +DCP (this will be reasonably fast, as the video data will already have +been done) and it should play back at the correct volume with 7 on +your sound-rack fader. + + + +Current versions of DCP-o-matic only know about the Dolby CP750. If +you use a different sound processor, and know the gain curve of its +volume control, get in +touch. + + + +‘Audio Delay’ is used to adjust the synchronisation +between audio and video. A positive delay will move the audio later +with respect to the video, and a negative delay will move it earlier. + + + +By default the Use content‘s audio button +will be selected. This means that the DCP will use one of the +soundtracks from your content file; you can select the soundtrack that +you wish to use from the drop-down box. + + + +Note that if your content's audio is mono, DCP-o-matic will place it +in the centre channel in the DCP. + + + +Alternatively, you can supply different sound files by clicking the +Use external audio button and choosing a WAV file +for any channels that you want to appear in the DCP. These files can +be any bit depth and sampling rate, and will be re-sampled and +bit-depth converted if required. + + +
+
+Subtitles tab + + +This tab contains settings related to subtitles in your DCP, as shown in . + + +
+ Subtitle settings tab + + + + + +
+ + +DCP-o-matic will extract subtitles from the content, if present, and +they can be ‘burnt into’ the DCP (that is, they are +included in the image and not overlaid by the projector). Note that +DVD and Blu-Ray subtitles are stored as bitmaps, so it is not possible +(automatically) to use non-burnt-in subtitles with these sources. +Select the With Subtitles checkbox to enable +subtitles. The offset control moves the +subtitles up and down the image, and the scale +control changes their size. + + + +Future versions of DCP-o-matic will hopefully include the option to +use text subtitles (as is the norm with most professionally-mastered +DCPs). + + +
+
+ +
+Making the DCP + + +Now that we have set everything up, choose Make +DCP from the Jobs menu. DCP-o-matic +will encode your DCP. This may take some time (many hours in some +cases). While the job is in progress, DCP-o-matic will update you on +how it is getting on with the progress bar in the bottom of its window, as shown in . + + +
+ Making the DCP + + + + + +
+ + +When it has finished, the DCP will end up on your disk inside the +film's directory. You can then copy this to a projector via a USB +stick, hard-drive or network connection. + + + +Alternatively, if you have a projector or TMS that is accessible via +SCP across your network, you can upload the content directly from +DCP-o-matic. See . + + +
+
+ + + +Creating a still-image DCP + + +DCP-o-matic can also be used to create DCPs of a still image, perhaps +for an advertisement or an on-screen announcement. This chapter shows you +how to do it. + + + +As with video DCPs, the first step is to create a new +‘Film’; select New from the +File menu and the new film dialogue will open as +shown in . + + +
+ Dialogue box for creating a new film + + + + + +
+ + +Enter a name and click OK. Then we set up the +content; click the content selector as before, and this time we will +choose an image file, as shown in . + + +
+ Selecting a still content file + + + + + +
+ + +Setting up for a still image DCP is somewhat simpler than for a video; +the tabs are all the same, but many options are removed and a few are added. + + + +As with video, you can select a content type and the format (ratio) +that your image should be presented in. It will be scaled and padded +to fit the selected ratio, but in such a way that the pixel aspect +ratio is preserved. In other words, the image will not be stretched, +merely scaled; if you want to stretch your image, you will need to do +so in a separate program before importing it into DCP-o-matic. You +can also crop your image, if you so choose, and then set a duration +(in seconds) that the image should appear on screen. + + + +Still-image DCPs can include sound; this can be added from the +Audio tab. If your specified duration is shorter +than the audio, the audio will be cut off at the duration; if it is +longer, silence will be added after your audio. + + + +Finally, as with video, you can choose Make DCP +from the Jobs menu to create your DCP. This will +be much quicker than creating a video DCP, as DCP-o-matic only needs +to encode a single frame which it can then repeat. + + +
+ + + +Preferences + + +DCP-o-matic provides a few preferences which can be used to modify its +behaviour. This chapter explains those options. + + +
+The preferences dialogue + + +The preferences dialogue is opened by choosing +Preferences... from the Edit +menu. The dialogue is shown in . + + +
+ Preferences + + + + + +
+ +
+TMS setup + + +The first part of the dialogue gives some options for specifying +details about your TMS. If you do this, and your TMS accepts SSH +connections, you can upload DCPs directly from DCP-o-matic to the TMS. +This is discussed in . + + + +TMS IP address should be set to the IP address of +your TMS, TMS target path to the place that DCPs +should be uploaded to (which will be relative to the home directory of +the SSH user). Finally, the user name and password are the +credentials required to log into the TMS via SSH. + +
+ +
+Threads + + +When DCP-o-matic is encoding DCPs it can use multiple parallel threads +to speed things up. Set this value to the number of threads +DCP-o-matic should use. This would typically be set to the number of +processors (or processor cores) in your machine. + + +
+ +
+Default directory for new films + + +This is the directory which DCP-o-matic will suggest initially as a place to put new films. + + +
+ +
+A/B options + + +These options are for DCP-o-matic's special mode of making A/B +comparison DCPs for checking the performance of video filters. Their +use is described in . + + +
+ +
+Encoding servers + + +If you have spare machines sitting around on your network not doing +much, they can be pressed into service to speed up DCP encodes. This +is done by running a small server program on the machine, which will +encode video sent to it by the ‘master’ DCP-o-matic. This +option is described in more detail in . +Use these preferences to specify the encoding servers that should be +used. + + +
+ +
+
+ + +Advanced topics + +This chapter describes some parts of DCP-o-matic that are +probably not essential, but which you might find useful in some +circumstances. + + +
+Filtering + + +DCP-o-matic offers a variety of filters that can be applied to your +video content. You can set up the filters by clicking the +Edit button next to the filters entry in the +setup area of the DCP-o-matic window; this opens the filters selector +as shown in . + + +
+ Filters selector + + + + + +
+ + +After changing the filters setup, you will need to regenerate the DCP +to see the effect on the cinema screen. The preview in DCP-o-matic +will update itself whenever filters are changed, though of course this +image is much smaller and of lower resolution than a projected image! + + +
+ +
+Scaling + + +If your source material is not of the DCI-specified size, or if it +uses non-square pixels, DCP-o-matic will need to scale it. The +algorithm used to scale is set up by the Scaler +entry in the film setup area. We think ‘Bicubic’ is the +best all-round option, but tests are ongoing. + + +
+ +
+TMS upload + + +If you have configured details of a TMS in the preferences dialogue +() you can upload a completed DCP +straight to your TMS buy choosing Send DCP to TMS +from the Jobs menu. + + +
+ + +
+A/B comparison + + +When evaluating the effects of different filters or scalers on the +image quality, A/B mode might be useful. In this mode, DCP-o-matic +will generate a DCP where the left half of the image uses some +‘reference’ filtering and scaling, and the right half of +the image uses a different set of filters and a different scaler. +This DCP can then be played back on a projector and the image quality +evaluated. + + + +To enable A/B mode, click the A/B checkbox in the setup area of the +DCP-o-matic window. When you generate your DCP, the left half of the +screen will use the filters and scaler specified in the preferences dialogue, and the right +half will use the filters and scaler specified in the film setup. + + +
+ +
+Encoding servers + + +One way to increase the speed of DCP encoding is to use more +than one machine at the same time. An instance of DCP-o-matic can +offload some of the time-consuming JPEG2000 encoding to any number of +other machines on a network. To do this, one ‘master’ +machine runs DCP-o-matic, and the ‘server’ machines run +a small program called ‘servomatic’. + + +
+Running the servers + + +There are two options for the encoding server; +servomatic_cli, which runs on the command line, and +servomatic_gui, which has a simple GUI. The command line +version is well-suited to headless servers, especially on Linux, and +the GUI version works best on Windows where it will put an icon in the +system tray. + + + +To run the command line version, simply enter: + + + +servomatic_cli + + + +at a command prompt. If you are running the program on a machine with +a multi-core processor, you can run multiple parallel encoding threads +by doing something like: + + + +servomatic_cli -t 4 + + + +to run 4 threads in parallel. + + + +To run the GUI version on windows, run the ‘DCP-o-matic encode +server’ from the start menu. An icon will appear in the system +tray; right-click it to open a menu from whence you can quit the +server or open a window to show its status. + + +
+
+Setting up DCP-o-matic + + +Once your servers are running, you need to tell your master +DCP-o-matic instance about them. Start DCP-o-matic and open the +Preferences dialog from the +Edit menu. At the bottom of this dialog is a +section where you can add, edit and remove encoding servers. For each +encoding server you need only specify its IP address and the number of +threads that it is running, so that DCP-o-matic knows how many +parallel encode jobs to send to the server. + + + +Once this is done, any encodes that you start will split the workload +up between the master machine and the servers. + + +
+
+Some notes about encode servers + + +DCP-o-matic does not mind if servers come and go; if a server +disappears, DCP-o-matic will stop sending work to it, and will check +it every minute or so in case it has come back online. + + + +You will probably find that using a 1Gb/s or faster network will +provide a significant speed-up compared to a 100Mb/s network. + + + +Making changes to the server configuration in the master DCP-o-matic +will have no effect while an encode is running; the changes will only +be noticed when a new encode is started. + + +
+
+ +
+ + +
diff --git a/doc/manual/dvdomatic-html.xsl b/doc/manual/dvdomatic-html.xsl deleted file mode 100644 index 059d7ead7..000000000 --- a/doc/manual/dvdomatic-html.xsl +++ /dev/null @@ -1,12 +0,0 @@ - - - - - - - - - - diff --git a/doc/manual/dvdomatic-pdf.xsl b/doc/manual/dvdomatic-pdf.xsl deleted file mode 100644 index 414fb64b8..000000000 --- a/doc/manual/dvdomatic-pdf.xsl +++ /dev/null @@ -1,17 +0,0 @@ - - - - -colorlinks,linkcolor=black,urlcolor=black - - -0 -0 - - -scale=0.6 - - -3 - - diff --git a/doc/manual/dvdomatic.css b/doc/manual/dvdomatic.css deleted file mode 100644 index 0e4982f20..000000000 --- a/doc/manual/dvdomatic.css +++ /dev/null @@ -1,19 +0,0 @@ -body { - font-family: luxi sans, sans-serif; - margin-left: 4em; - margin-right: 4em; - margin-top: 1em; - margin-bottom: 1em; - background-color: #E2E8EE; -} - -div.sidebar { - margin-left: 1em; - margin-right: 1em; - padding-left: 1em; - padding-right: 1em; - border-color: #000000; - border-width: 2px; - border-style: solid; - background-color: #E2E8EE; -} diff --git a/doc/manual/dvdomatic.sty b/doc/manual/dvdomatic.sty deleted file mode 100644 index 834e581fc..000000000 --- a/doc/manual/dvdomatic.sty +++ /dev/null @@ -1,68 +0,0 @@ -%% -%% This style is derivated from the docbook one -%% -\NeedsTeXFormat{LaTeX2e} -\ProvidesPackage{ardour}[2007/04/04 My DocBook Style] - -%% Just use the original package and pass the options -\RequirePackageWithOptions{docbook} - -% Use a nice font -\usepackage{lmodern} - -% Define \dbend as the dangerous bend sign -\font\manual=manfnt -\def\dbend{{\manual\char127}} - -% Redefine sidebar environment to use the dangerous bend style -% Danger, Will Robinson! -\def\sidebar{\begin{trivlist}\item[]\noindent% -\begingroup\hangindent=2pc\hangafter=-2%\clubpenalty=10000% -\def\par{\endgraf\endgroup}% -\hbox to0pt{\hskip-\hangindent\dbend\hfill}\ignorespaces} -\def\endsidebar{\par\end{trivlist}} - - -% Futz with the title page; basically a copy of -% /usr/share/texmf/tex/latex/dblatex/style/dbk_title.sty -% with authors added. - -\def\DBKcover{ -\ifthenelse{\equal{\DBKedition}{}}{\def\edhead{}}{\def\edhead{Ed. \DBKedition}} - -\pagestyle{empty} - -% interligne double -\setlength{\oldbaselineskip}{\baselineskip} -\setlength{\baselineskip}{2\oldbaselineskip} -\textsf{ -\vfill -\vspace{2.5cm} -\begin{center} - \huge{\textbf{\DBKtitle}}\\ % - \ \\ % - \ \\ % - \Large{\DBKauthor}\\ % - \ifx\DBKsubtitle\relax\else% - \underline{\ \ \ \ \ \ \ \ \ \ \ }\\ % - \ \\ % - \huge{\textbf{\DBKsubtitle}}\\ % - \fi -\end{center} -\vfill -\setlength{\baselineskip}{\oldbaselineskip} -\hspace{1cm} -\vspace{1cm} -\begin{center} -\begin{tabular}{p{7cm} p{7cm}} -\Large{\DBKreference{} \edhead} & \\ -\end{tabular} -\end{center} -} - -% Format for the other pages -\newpage -\setlength{\baselineskip}{\oldbaselineskip} -%\chead[]{\DBKcheadfront} -\lfoot[]{} -} diff --git a/doc/manual/dvdomatic.xml b/doc/manual/dvdomatic.xml deleted file mode 100644 index 58315eca6..000000000 --- a/doc/manual/dvdomatic.xml +++ /dev/null @@ -1,932 +0,0 @@ - - - - -%dbcent; - -%extensions; -]> - - - -DVD-o-matic -CarlHetherington - - - -Introduction - - -Hello, and welcome to DVD-o-matic! - - -
-What is DVD-o-matic? - - -DVD-o-matic is a program to generate Digital -Cinema Packages (DCPs) from DVDs, Blu-Rays, video files such as MP4 -and AVI, or still images. The resulting DCPs will play on modern digital -cinema projectors. - - - -You might find it useful to make DVDs easier to present, to encode -independently-shot feature films, or to generate local advertising for -your cinema. - - -
- -
-Licence - - -DVD-o-matic is licensed under the GNU GPL. - - -
- -
- - -Installation - -
-Windows - - -To install DVD-o-matic on Windows, simply download the installer from -http://carlh.net -and double-click it. Click through the installer wizard, and -DVD-o-matic will be installed onto your machine. - - - -If you are using a 32-bit version of Windows, you will need the 32-bit -installer. For 64-bit Windows, either installer will work, but I -suggest you used the 64-bit version as it will allow DVD-o-matic to -use more memory. You may find that DVD-o-matic crashes if you run -many parallel encoding threads (more than 4) on the 32-bit -version. - - -
- -
-Ubuntu Linux - - -You can install DVD-o-matic on Ubuntu 12.04 (‘Precise -Pangolin’) or 12.10 (‘Quantal Quetzal’) using -.deb packages: download the appropriate package from -http://carlh.net and -double-click it. Ubuntu will install the necessary bits and pieces -and set DVD-o-matic up for you. - - -
- -
-Other Linux distributions - - -Installation on non-Ubuntu Linux is currently a little involved, as -there are no packages available (yet); you will have to compile it -from source. If you are using a non-Ubuntu distribution, do let me -know via the mailing -list and I will see about building some packages. - - - -The following dependencies are required: - -FFmpeg -libsndfile -OpenSSL -libopenjpeg -ImageMagick -Boost -libssh -GTK -wxWidgets -libdcp - - - - -Once you have installed the development packages for the dependencies, -download the source code from http://carlh.net, -unpack it and run the following commands from inside the source -directory: - - - -./waf configure -./waf build -sudo ./waf install - - - -With any luck, this will build and install DVD-o-matic on your system. To run it, enter: - - - -dvdomatic - - - -in a shell. - - -
-
- - -Creating a video DCP - - -In this chapter we will see how to create a video DCP using -DVD-o-matic. We will gloss over some of the finer details, which are -explained in later chapters. - - -
-Creating a new film - - -Let's make a very simple DCP to see how DVD-o-matic works. First, we -need some content. Download the low-resolution trailer for the open -movie Sintel from their -website. Generally, of course, one would want to use the -highest-resolution material available, but for this test we will use -the low-resolution version to save everyone's bandwidth bills. - - - -Now, start DVD-o-matic and its window will open. First, we will -create a new ‘film’. A ‘film’ is how DVD-o-matic refers to -a piece of content, along with some settings, which we will make into -a DCP. DVD-o-matic stores its data in a folder on your disk while it -creates the DCP. You can create a new film by selecting -New from the File menu, as -shown in . - - -
- Creating a new film - - - - - -
- - -This will open a dialogue box for the new film, as shown in . - - -
- Dialogue box for creating a new film - - - - - -
- - -In this dialogue box you can choose a name for the film. This will be -used to name the folder to store its data in, and also as the initial -name for the DCP itself. You can also choose whereabouts you want to create -the film. In the example from the figure, DVD-o-matic will create a -folder called ‘DCP Test’ inside my home folder (carl) into which it -will write its working files. - - - -If you always create your DCPs in a particular folder, you can use -DVD-o-matic's Preferences to make life a little -easier by setting the default folder that DVD-o-matic will offer in this dialogue. -See . - - -
- -
-Selecting content - - -The next step is to set the content that you want to use. Click the -content selector, as shown in , and a file chooser will -open for you to select the content file to use, as shown in . - - -
- Opening the content selector - - - - - -
- -
- Selecting a video content file - - - - - -
- - -Select your content file and click Open. In this -case we are using the Sintel trailer that we downloaded earlier. - - - -When you do this, DVD-o-matic will take a look at your file. After a -short while (when the progress bar at the bottom right of the window -has finished), you can look through your content using the slider to -the right of the window, as shown in . - - -
- Examining the content - - - - - -
- - -Dragging the slider will move through your video. You can also click -the Play button to play the content back. Note -that there will be no sound, and playback might not be entirely -accurate (it may be slightly slower or faster than it should be, for -example). This player is really only intended for brief inspection of -content; if you need to check it more thoroughly, use another player -such as Totem, mplayer or VLC. - - -
- -
-Setting up - - -Now there are a few things to set up to describe how the DCP should be -created. The settings are divided into four tabs: film, video, audio and subtitles. - - -
-Film tab - - -The ‘film’ tab contains settings that pertain to the whole film, as shown in . - - -
- Film settings tab - - - - - -
- - -The first thing here is the name. This is generally set to the title -of the film that is being encoded. If Use DCI -name is not ticked, the name that you specify will be used -as-is for the name of the DCP. If Use DCI name -is ticked, the name that you enter will be used as part of a -DCI-compliant name. - - - -Underneath the name field is a preview of the name that the DCP will -get. To use a DCI-compliant name, tick the Use DCI -name checkbox. The DCI name will be composed using details -of your content's soundtrack, the current date and other things that -can be specified in the DCI name details dialogue box, which you can -open by clicking on the Details button. - - - -If the DCP name is long, it may not all be visible. You can see the -full name by hovering the mouse pointer over the partial name. - - - -The Trust content's header button starts off -checked, and this means that DVD-o-matic will use the content's header -information to determine its length. If, for some reason, this header -length is wrong, uncheck the Trust content's -header button and DVD-o-matic will run through the content -to find its exact length. This may take a while for large pieces of content. - - - -Next up is the content type. This can be -‘feature’, ‘trailer’ or whatever; select the -required type from the drop-down list. - - - -The trim frames settings allow you to trim frames -from the beginning and end of the content; any trimmed frames will not -be included in the DCP. - - -
- -
-Video tab - - -This tab contains settings related to the picture in your DCP, as shown in . - - -
- Video settings tab - - - - - -
- - -The first option on this tab is the format. This will govern the -shape that DVD-o-matic will make your image into. Select the aspect -ratio that your content should be presented in. The ‘4:3 within -Flat’ and ‘16:9 within Flat’ settings will put the -image at the specified ratio within a Flat (1.85:1) frame, so that you -can project the DCP using your projector's Flat preset. - - - -The remaining options can often be left alone, but may sometimes be -useful. The ‘crop’ settings can be used to crop your -content, which can be used to remove black borders from round the -edges of DVD images, for example. The specified number of pixels will -be trimmed from each edge, and the content image in the right of the -window will be updated to show the effect of the crop. - - - -The ‘filters’ settings allow you to apply various video -filters to the image. These may be useful to try to improve -poor-quality sources like DVDs. We will discuss filtering later in the manual. - - - - -The ‘scaler’ is the method that will be used to scale up -your content to the required size for the DCP, if required. We will -discuss the options in more detail later; Bicubic is a fine choice in -most situations. - - - - -The ‘colour look-up table’ specifies the colour space that -your input content will be expected to be in. If in doubt, leave it -set to ‘sRGB’. - - - -Finally, the ‘JPEG2000 bandwidth’ setting changes how big the final -image files used within the DCP will be. Larger numbers will give -better quality, but correspondingly larger DCPs. The bandwidth can be -between 50 and 250 megabits per second (MBps). - - -
- -
-Audio tab - - -This tab contains settings related to the sound in your DCP, as shown in . - - -
- Audio settings tab - - - - - -
- - - -‘Audio Gain’ is used to alter the volume of the -soundtrack. The specified gain (in dB) will be applied to each sound -channel before it is written to the DCP. - - - -If you use a sound processor that DVD-o-matic knows about, it can help -you calculate changes in gain that you should apply. Say, for -example, that you make a test DCP and find that you have to run it at -volume 5 instead of volume 7 to get a good sound level in the screen. -If this is the case, click the Calculate... -button next to the audio gain entry, and the dialogue box in will open. - - -
- Calculating audio gain - - - - - -
- - -For our example, put 5 in the first box and 7 in the second and click -OK. DVD-o-matic will calculate the audio gain -that it should apply to make this happen. Then you can re-make the -DCP (this will be reasonably fast, as the video data will already have -been done) and it should play back at the correct volume with 7 on -your sound-rack fader. - - - -Current versions of DVD-o-matic only know about the Dolby CP750. If -you use a different sound processor, and know the gain curve of its -volume control, get in -touch. - - - -‘Audio Delay’ is used to adjust the synchronisation -between audio and video. A positive delay will move the audio later -with respect to the video, and a negative delay will move it earlier. - - - -By default the Use content‘s audio button -will be selected. This means that the DCP will use one of the -soundtracks from your content file; you can select the soundtrack that -you wish to use from the drop-down box. - - - -Note that if your content's audio is mono, DVD-o-matic will place it -in the centre channel in the DCP. - - - -Alternatively, you can supply different sound files by clicking the -Use external audio button and choosing a WAV file -for any channels that you want to appear in the DCP. These files can -be any bit depth and sampling rate, and will be re-sampled and -bit-depth converted if required. - - -
-
-Subtitles tab - - -This tab contains settings related to subtitles in your DCP, as shown in . - - -
- Subtitle settings tab - - - - - -
- - -DVD-o-matic will extract subtitles from the content, if present, and -they can be ‘burnt into’ the DCP (that is, they are -included in the image and not overlaid by the projector). Note that -DVD and Blu-Ray subtitles are stored as bitmaps, so it is not possible -(automatically) to use non-burnt-in subtitles with these sources. -Select the With Subtitles checkbox to enable -subtitles. The offset control moves the -subtitles up and down the image, and the scale -control changes their size. - - - -Future versions of DVD-o-matic will hopefully include the option to -use text subtitles (as is the norm with most professionally-mastered -DCPs). - - -
-
- -
-Making the DCP - - -Now that we have set everything up, choose Make -DCP from the Jobs menu. DVD-o-matic -will encode your DCP. This may take some time (many hours in some -cases). While the job is in progress, DVD-o-matic will update you on -how it is getting on with the progress bar in the bottom of its window, as shown in . - - -
- Making the DCP - - - - - -
- - -When it has finished, the DCP will end up on your disk inside the -film's directory. You can then copy this to a projector via a USB -stick, hard-drive or network connection. - - - -Alternatively, if you have a projector or TMS that is accessible via -SCP across your network, you can upload the content directly from -DVD-o-matic. See . - - -
-
- - - -Creating a still-image DCP - - -DVD-o-matic can also be used to create DCPs of a still image, perhaps -for an advertisement or an on-screen announcement. This chapter shows you -how to do it. - - - -As with video DCPs, the first step is to create a new -‘Film’; select New from the -File menu and the new film dialogue will open as -shown in . - - -
- Dialogue box for creating a new film - - - - - -
- - -Enter a name and click OK. Then we set up the -content; click the content selector as before, and this time we will -choose an image file, as shown in . - - -
- Selecting a still content file - - - - - -
- - -Setting up for a still image DCP is somewhat simpler than for a video; -the tabs are all the same, but many options are removed and a few are added. - - - -As with video, you can select a content type and the format (ratio) -that your image should be presented in. It will be scaled and padded -to fit the selected ratio, but in such a way that the pixel aspect -ratio is preserved. In other words, the image will not be stretched, -merely scaled; if you want to stretch your image, you will need to do -so in a separate program before importing it into DVD-o-matic. You -can also crop your image, if you so choose, and then set a duration -(in seconds) that the image should appear on screen. - - - -Still-image DCPs can include sound; this can be added from the -Audio tab. If your specified duration is shorter -than the audio, the audio will be cut off at the duration; if it is -longer, silence will be added after your audio. - - - -Finally, as with video, you can choose Make DCP -from the Jobs menu to create your DCP. This will -be much quicker than creating a video DCP, as DVD-o-matic only needs -to encode a single frame which it can then repeat. - - -
- - - -Preferences - - -DVD-o-matic provides a few preferences which can be used to modify its -behaviour. This chapter explains those options. - - -
-The preferences dialogue - - -The preferences dialogue is opened by choosing -Preferences... from the Edit -menu. The dialogue is shown in . - - -
- Preferences - - - - - -
- -
-TMS setup - - -The first part of the dialogue gives some options for specifying -details about your TMS. If you do this, and your TMS accepts SSH -connections, you can upload DCPs directly from DVD-o-matic to the TMS. -This is discussed in . - - - -TMS IP address should be set to the IP address of -your TMS, TMS target path to the place that DCPs -should be uploaded to (which will be relative to the home directory of -the SSH user). Finally, the user name and password are the -credentials required to log into the TMS via SSH. - -
- -
-Threads - - -When DVD-o-matic is encoding DCPs it can use multiple parallel threads -to speed things up. Set this value to the number of threads -DVD-o-matic should use. This would typically be set to the number of -processors (or processor cores) in your machine. - - -
- -
-Default directory for new films - - -This is the directory which DVD-o-matic will suggest initially as a place to put new films. - - -
- -
-A/B options - - -These options are for DVD-o-matic's special mode of making A/B -comparison DCPs for checking the performance of video filters. Their -use is described in . - - -
- -
-Encoding servers - - -If you have spare machines sitting around on your network not doing -much, they can be pressed into service to speed up DCP encodes. This -is done by running a small server program on the machine, which will -encode video sent to it by the ‘master’ DVD-o-matic. This -option is described in more detail in . -Use these preferences to specify the encoding servers that should be -used. - - -
- -
-
- - -Advanced topics - -This chapter describes some parts of DVD-o-matic that are -probably not essential, but which you might find useful in some -circumstances. - - -
-Filtering - - -DVD-o-matic offers a variety of filters that can be applied to your -video content. You can set up the filters by clicking the -Edit button next to the filters entry in the -setup area of the DVD-o-matic window; this opens the filters selector -as shown in . - - -
- Filters selector - - - - - -
- - -After changing the filters setup, you will need to regenerate the DCP -to see the effect on the cinema screen. The preview in DVD-o-matic -will update itself whenever filters are changed, though of course this -image is much smaller and of lower resolution than a projected image! - - -
- -
-Scaling - - -If your source material is not of the DCI-specified size, or if it -uses non-square pixels, DVD-o-matic will need to scale it. The -algorithm used to scale is set up by the Scaler -entry in the film setup area. We think ‘Bicubic’ is the -best all-round option, but tests are ongoing. - - -
- -
-TMS upload - - -If you have configured details of a TMS in the preferences dialogue -() you can upload a completed DCP -straight to your TMS buy choosing Send DCP to TMS -from the Jobs menu. - - -
- - -
-A/B comparison - - -When evaluating the effects of different filters or scalers on the -image quality, A/B mode might be useful. In this mode, DVD-o-matic -will generate a DCP where the left half of the image uses some -‘reference’ filtering and scaling, and the right half of -the image uses a different set of filters and a different scaler. -This DCP can then be played back on a projector and the image quality -evaluated. - - - -To enable A/B mode, click the A/B checkbox in the setup area of the -DVD-o-matic window. When you generate your DCP, the left half of the -screen will use the filters and scaler specified in the preferences dialogue, and the right -half will use the filters and scaler specified in the film setup. - - -
- -
-Encoding servers - - -One way to increase the speed of DCP encoding is to use more -than one machine at the same time. An instance of DVD-o-matic can -offload some of the time-consuming JPEG2000 encoding to any number of -other machines on a network. To do this, one ‘master’ -machine runs DVD-o-matic, and the ‘server’ machines run -a small program called ‘servomatic’. - - -
-Running the servers - - -There are two options for the encoding server; -servomatic_cli, which runs on the command line, and -servomatic_gui, which has a simple GUI. The command line -version is well-suited to headless servers, especially on Linux, and -the GUI version works best on Windows where it will put an icon in the -system tray. - - - -To run the command line version, simply enter: - - - -servomatic_cli - - - -at a command prompt. If you are running the program on a machine with -a multi-core processor, you can run multiple parallel encoding threads -by doing something like: - - - -servomatic_cli -t 4 - - - -to run 4 threads in parallel. - - - -To run the GUI version on windows, run the ‘DVD-o-matic encode -server’ from the start menu. An icon will appear in the system -tray; right-click it to open a menu from whence you can quit the -server or open a window to show its status. - - -
-
-Setting up DVD-o-matic - - -Once your servers are running, you need to tell your master -DVD-o-matic instance about them. Start DVD-o-matic and open the -Preferences dialog from the -Edit menu. At the bottom of this dialog is a -section where you can add, edit and remove encoding servers. For each -encoding server you need only specify its IP address and the number of -threads that it is running, so that DVD-o-matic knows how many -parallel encode jobs to send to the server. - - - -Once this is done, any encodes that you start will split the workload -up between the master machine and the servers. - - -
-
-Some notes about encode servers - - -DVD-o-matic does not mind if servers come and go; if a server -disappears, DVD-o-matic will stop sending work to it, and will check -it every minute or so in case it has come back online. - - - -You will probably find that using a 1Gb/s or faster network will -provide a significant speed-up compared to a 100Mb/s network. - - - -Making changes to the server configuration in the master DVD-o-matic -will have no effect while an encode is running; the changes will only -be noticed when a new encode is started. - - -
-
- -
- - -
diff --git a/dvdomatic.desktop.in b/dvdomatic.desktop.in deleted file mode 100644 index 65067eb3b..000000000 --- a/dvdomatic.desktop.in +++ /dev/null @@ -1,10 +0,0 @@ -[Desktop Entry] -Encoding=UTF-8 -Version=1.0 -Type=Application -Terminal=false -Exec=@PREFIX@/bin/dvdomatic -Name=DVD-o-matic -Icon=dvdomatic -Comment=DCP generator -Categories=AudioVideo;Video diff --git a/hacks/python-playback/config.py b/hacks/python-playback/config.py deleted file mode 100644 index fecf261f5..000000000 --- a/hacks/python-playback/config.py +++ /dev/null @@ -1,2 +0,0 @@ - -LEFT_SCREEN_WIDTH = 1366 diff --git a/hacks/python-playback/dvdomatic b/hacks/python-playback/dvdomatic deleted file mode 100755 index ce405f37e..000000000 --- a/hacks/python-playback/dvdomatic +++ /dev/null @@ -1,209 +0,0 @@ -#!/usr/bin/python - -import os -import operator -import traceback -import pygtk -pygtk.require('2.0') -import gtk -import glib -import gobject -import film -import film_view -import player -import screens -import thumbs -import ratio -import util - -FILM_DIRECTORY = '/home/carl/DVD' - -current_player = None -films = [] -inhibit_selection_update = False - -def find_films(): - global films - films = [] - for root, dirs, files in os.walk(FILM_DIRECTORY): - for name in files: - if os.path.basename(name) == 'info': - films.append(film.Film(os.path.join(root, os.path.dirname(name)))) - - films.sort(key = operator.attrgetter('name')) - -def update_film_store(): - global film_store - global films - global inhibit_selection_update - inhibit_selection_update = True - film_store.clear() - for f in films: - film_store.append([f.name]) - inhibit_selection_update = False - -def update_screen_store(screen_store, screens): - screen_store.clear() - for s in screens.screens: - screen_store.append([s.name]) - -def create_film_tree_view(film_store): - view = gtk.TreeView(film_store) - column = gtk.TreeViewColumn() - view.append_column(column) - cell = gtk.CellRendererText() - column.pack_start(cell) - column.add_attribute(cell, 'text', 0) - view.get_selection().set_mode(gtk.SELECTION_SINGLE) - return view - -def create_screen_view(screen_store): - view = gtk.TreeView(screen_store) - column = gtk.TreeViewColumn() - view.append_column(column) - cell = gtk.CellRendererText() - column.pack_start(cell) - column.add_attribute(cell, 'text', 0) - view.get_selection().set_mode(gtk.SELECTION_SINGLE) - return view - -def get_selected_film(): - (model, iter) = film_tree_view.get_selection().get_selected() - - for f in films: - if f.name == model.get(iter, 0)[0]: - return f - - return None - -# @return Selected screen name -def get_selected_screen(): - (model, iter) = screen_view.get_selection().get_selected() - return model.get(iter, 0)[0] - -def film_selected(selection): - if inhibit_selection_update: - return - - film_view.set(get_selected_film()) - check_for_playability() - -def screen_selected(selection): - check_for_playability() - -def check_for_playability(): - f = get_selected_film() - if screens.get_format(get_selected_screen(), f.ratio) is not None: - play_button.set_label("Play") - play_button.set_sensitive(True) - else: - play_button.set_label("Cannot play: no setting for %s on screen %s" % (ratio.find(f.ratio).name(), get_selected_screen())) - play_button.set_sensitive(False) - -def update_status(s): - global current_player - if current_player is None: - s.set_text("Not playing") - return True - - position = current_player.time_pos - if position is None: - return True - position_hms = util.s_to_hms(position) - - length = current_player.length - if length is None: - return True - - remaining = length - position - remaining_hms = util.s_to_hms(remaining) - s.set_text("Playing: %d:%02d:%02d, %d:%02d:%02d remaining" % (position_hms[0], position_hms[1], position_hms[2], remaining_hms[0], remaining_hms[1], remaining_hms[2])) - return True - -def play_clicked(b): - global current_player - f = get_selected_film() - current_player = player.get_player(f, screens.get_format(get_selected_screen(), f.ratio)) - print current_player.args - -def stop_clicked(b): - global current_player - if current_player is not None: - current_player.stop() - current_player = None - -def add_film_clicked(b): - global films - c = gtk.FileChooserDialog("New Film", main_window, gtk.FILE_CHOOSER_ACTION_CREATE_FOLDER, (("Add", gtk.RESPONSE_OK))) - c.set_current_folder(FILM_DIRECTORY) - if c.run() == gtk.RESPONSE_OK: - f = film.Film() - f.data = c.get_filename() - f.name = os.path.basename(c.get_filename()) - f.write() - find_films() - update_film_store() - c.hide() - - for i in range(0, len(films)): - if films[i].name == f.name: - film_tree_view.get_selection().select_path((i, )) - -main_window = gtk.Window(gtk.WINDOW_TOPLEVEL) -main_window.set_title("DVD-o-matic") -main_window.maximize() - -main_hbox = gtk.HBox() -main_hbox.set_spacing(12) -main_hbox.set_border_width(12) -main_window.add(main_hbox) - -find_films() -film_view = film_view.FilmView(main_window) -screens = screens.Screens("screens") - -left_vbox = gtk.VBox() -left_vbox.set_spacing(12) -main_hbox.pack_start(left_vbox, False, False) -right_vbox = gtk.VBox() -right_vbox.set_spacing(12) -main_hbox.pack_start(right_vbox) - -film_store = gtk.ListStore(gobject.TYPE_STRING) -update_film_store() - -film_tree_view = create_film_tree_view(film_store) -left_vbox.pack_start(film_tree_view, True, True) -film_tree_view.get_selection().select_path((0, )) -film_tree_view.get_selection().connect("changed", film_selected) - -add_film_button = gtk.Button(stock = gtk.STOCK_ADD) -left_vbox.pack_start(add_film_button, False, False) -add_film_button.connect("clicked", add_film_clicked) - -screen_store = gtk.ListStore(gobject.TYPE_STRING) -update_screen_store(screen_store, screens) - -screen_view = create_screen_view(screen_store) -left_vbox.pack_start(screen_view, False, False) -screen_view.get_selection().select_path((0, )) -screen_view.get_selection().connect("changed", screen_selected) - -right_vbox.pack_start(film_view, False, False) -film_view.set(films[0]) - -play_button = gtk.Button("Play") -right_vbox.pack_start(play_button) -play_button.connect("clicked", play_clicked) - -stop_button = gtk.Button("Stop") -right_vbox.pack_start(stop_button) -stop_button.connect("clicked", stop_clicked) - -status = gtk.Label() -right_vbox.pack_start(status, False, False) -glib.timeout_add_seconds(1, update_status, status) - -check_for_playability() -main_window.show_all() -gtk.main() diff --git a/hacks/python-playback/film.py b/hacks/python-playback/film.py deleted file mode 100644 index 3ad128027..000000000 --- a/hacks/python-playback/film.py +++ /dev/null @@ -1,188 +0,0 @@ -import os -import subprocess -import shlex -import shutil -import player - -class Film: - def __init__(self, data = None): - # File or directory containing content - self.content = None - # True if content is in DVD format - self.dvd = False - # DVD title number - self.dvd_title = 1 - # Directory containing metadata - self.data = None - # Film name - self.name = None - # Number of pixels by which to crop the content from each edge - self.left_crop = 0 - self.top_crop = 0 - self.right_crop = 0 - self.bottom_crop = 0 - # Use deinterlacing filter - self.deinterlace = False - # Target ratio - self.ratio = 1.85 - # Audio stream ID to play - self.aid = None - - self.width = None - self.height = None - self.fps = None - self.length = None - - if data is not None: - self.data = data - f = open(os.path.join(self.data, 'info'), 'r') - while 1: - l = f.readline() - if l == '': - break - - d = l.strip() - - s = d.find(' ') - if s != -1: - key = d[:s] - value = d[s+1:] - - if key == 'name': - self.name = value - elif key == 'content': - self.content = value - elif key == 'dvd': - self.dvd = int(value) == 1 - elif key == 'dvd_title': - self.dvd_title = int(value) - elif key == 'left_crop': - self.left_crop = int(value) - elif key == 'top_crop': - self.top_crop = int(value) - elif key == 'right_crop': - self.right_crop = int(value) - elif key == 'bottom_crop': - self.bottom_crop = int(value) - elif key == 'deinterlace': - self.deinterlace = int(value) == 1 - elif key == 'ratio': - self.ratio = float(value) - elif key == 'aid': - self.aid = int(value) - elif key == 'width': - self.width = int(value) - elif key == 'height': - self.height = int(value) - elif key == 'fps': - self.fps = float(value) - elif key == 'length': - self.length = float(value) - - if self.width is None or self.height is None or self.fps is None or self.length is None: - self.update_content_metadata() - - def write(self): - try: - os.mkdir(self.data) - except OSError: - pass - - f = open(os.path.join(self.data, 'info'), 'w') - self.write_datum(f, 'name', self.name) - self.write_datum(f, 'content', self.content) - self.write_datum(f, 'dvd', int(self.dvd)) - self.write_datum(f, 'dvd_title', self.dvd_title) - self.write_datum(f, 'left_crop', self.left_crop) - self.write_datum(f, 'top_crop', self.top_crop) - self.write_datum(f, 'right_crop', self.right_crop) - self.write_datum(f, 'bottom_crop', self.bottom_crop) - self.write_datum(f, 'deinterlace', int(self.deinterlace)) - self.write_datum(f, 'ratio', self.ratio) - self.write_datum(f, 'aid', self.aid) - self.write_datum(f, 'width', self.width) - self.write_datum(f, 'height', self.height) - self.write_datum(f, 'fps', self.fps) - self.write_datum(f, 'length', self.length) - - def write_datum(self, f, key, value): - if value is not None: - print >>f,'%s %s' % (key, str(value)) - - def thumbs_dir(self): - t = os.path.join(self.data, 'thumbs') - - try: - os.mkdir(t) - except OSError: - pass - - return t - - def thumb(self, n): - return os.path.join(self.thumbs_dir(), str('%08d.png' % (n + 1))) - - def thumbs(self): - return len(os.listdir(self.thumbs_dir())) - - def remove_thumbs(self): - shutil.rmtree(self.thumbs_dir()) - - def make_thumbs(self): - num_thumbs = 128 - cl = self.player_command_line() - if self.length is not None: - sstep = self.length / num_thumbs - else: - sstep = 100 - cl.extra = '-vo png -frames %d -sstep %d -nosound' % (num_thumbs, sstep) - os.chdir(self.thumbs_dir()) - os.system(cl.get(True)) - - def set_dvd(self, d): - self.dvd = d - self.remove_thumbs() - - def set_dvd_title(self, t): - self.dvd_title = t - self.remove_thumbs() - - def set_content(self, c): - if c == self.content: - return - - self.content = c - self.update_content_metadata() - - def player_command_line(self): - cl = player.CommandLine() - cl.dvd = self.dvd - cl.dvd_title = self.dvd_title - cl.content = self.content - return cl - - def update_content_metadata(self): - if self.content is None: - return - - self.width = None - self.height = None - self.fps = None - self.length = None - - cl = self.player_command_line() - cl.extra = '-identify -vo null -ao null -frames 0' - text = subprocess.check_output(shlex.split(cl.get(True))).decode('utf-8') - lines = text.split('\n') - for l in lines: - s = l.strip() - b = s.split('=') - if len(b) == 2: - if b[0] == 'ID_VIDEO_WIDTH': - self.width = int(b[1]) - elif b[0] == 'ID_VIDEO_HEIGHT': - self.height = int(b[1]) - elif b[0] == 'ID_VIDEO_FPS': - self.fps = float(b[1]) - elif b[0] == 'ID_LENGTH': - self.length = float(b[1]) diff --git a/hacks/python-playback/film_view.py b/hacks/python-playback/film_view.py deleted file mode 100644 index c11b2e657..000000000 --- a/hacks/python-playback/film_view.py +++ /dev/null @@ -1,212 +0,0 @@ -import os -import pygtk -pygtk.require('2.0') -import gtk -import ratio -import util -import thumbs - -class FilmView(gtk.HBox): - def __init__(self, parent): - gtk.HBox.__init__(self) - - self.parent_window = parent - - self.inhibit_save = True - - self.table = gtk.Table() - self.pack_start(self.table, True, True) - - self.table.set_row_spacings(4) - self.table.set_col_spacings(12) - self.film_name = gtk.Entry() - self.ratio = gtk.combo_box_new_text() - for r in ratio.ratios: - self.ratio.append_text(r.name()) - self.content_file_radio = gtk.RadioButton() - self.content_file_radio.set_label("File") - self.content_file_chooser = gtk.FileChooserDialog("Content", self.parent_window, gtk.FILE_CHOOSER_ACTION_OPEN, (("Select", gtk.RESPONSE_OK))) - self.content_file_button = gtk.FileChooserButton(self.content_file_chooser) - self.content_folder_radio = gtk.RadioButton() - self.content_folder_radio.set_label("Folder") - self.content_folder_radio.set_group(self.content_file_radio) - self.content_folder_chooser = gtk.FileChooserDialog("Content", self.parent_window, gtk.FILE_CHOOSER_ACTION_SELECT_FOLDER, (("Select", gtk.RESPONSE_OK))) - self.content_folder_button = gtk.FileChooserButton(self.content_folder_chooser) - self.dvd = gtk.CheckButton("DVD") - self.dvd_title = gtk.SpinButton() - self.dvd_title.set_range(0, 32) - self.dvd_title.set_increments(1, 4) - self.deinterlace = gtk.CheckButton("Deinterlace") - self.left_crop = self.crop_spinbutton() - self.right_crop = self.crop_spinbutton() - self.top_crop = self.crop_spinbutton() - self.bottom_crop = self.crop_spinbutton() - - # Information about the content (immutable) - self.source_size = self.label() - self.fps = self.label() - self.length = self.label() - - # Buttons - self.thumbs_button = gtk.Button("Show Thumbnails") - - self.film_name.connect("changed", self.changed, self) - self.ratio.connect("changed", self.changed, self) - self.deinterlace.connect("toggled", self.changed, self) - self.thumbs_button.connect("clicked", self.thumbs_clicked, self) - self.content_file_radio.connect("toggled", self.content_radio_toggled, self) - self.content_folder_radio.connect("toggled", self.content_radio_toggled, self) - self.content_file_button.connect("file-set", self.content_file_chooser_file_set, self) - self.content_folder_button.connect("file-set", self.content_folder_chooser_file_set, self) - self.dvd.connect("toggled", self.changed, self) - self.dvd_title.connect("value-changed", self.changed, self) - - n = 0 - self.table.attach(self.label("Film"), 0, 1, n, n + 1) - self.table.attach(self.film_name, 1, 2, n, n + 1) - n += 1 - self.table.attach(self.label("Ratio"), 0, 1, n, n + 1) - self.table.attach(self.ratio, 1, 2, n, n + 1) - n += 1 - self.table.attach(self.label("Content"), 0, 1, n, n + 1) - b = gtk.HBox() - b.set_spacing(4) - b.pack_start(self.content_file_radio, False, False) - b.pack_start(self.content_file_button, True, True) - b.pack_start(self.content_folder_radio, False, False) - b.pack_start(self.content_folder_button, True, True) - self.table.attach(b, 1, 2, n, n + 1) - n += 1 - self.table.attach(self.dvd, 0, 2, n, n + 1) - n += 1 - self.table.attach(self.label("DVD title"), 0, 1, n, n + 1) - self.table.attach(self.dvd_title, 1, 2, n, n + 1) - n += 1 - self.table.attach(self.deinterlace, 0, 2, n, n + 1) - n += 1 - self.table.attach(self.label("Left Crop"), 0, 1, n, n + 1) - self.table.attach(self.left_crop, 1, 2, n, n + 1) - n += 1 - self.table.attach(self.label("Right Crop"), 0, 1, n, n + 1) - self.table.attach(self.right_crop, 1, 2, n, n + 1) - n += 1 - self.table.attach(self.label("Top Crop"), 0, 1, n, n + 1) - self.table.attach(self.top_crop, 1, 2, n, n + 1) - n += 1 - self.table.attach(self.label("Bottom Crop"), 0, 1, n, n + 1) - self.table.attach(self.bottom_crop, 1, 2, n, n + 1) - n += 1 - self.table.attach(self.label("Source size"), 0, 1, n, n + 1) - self.table.attach(self.source_size, 1, 2, n, n + 1) - n += 1 - self.table.attach(self.label("Frames per second"), 0, 1, n, n + 1) - self.table.attach(self.fps, 1, 2, n, n + 1) - n += 1 - self.table.attach(self.label("Length"), 0, 1, n, n + 1) - self.table.attach(self.length, 1, 2, n, n + 1) - - self.right_vbox = gtk.VBox() - self.pack_start(self.right_vbox, False, False) - - self.right_vbox.pack_start(self.thumbs_button, False, False) - - self.inhibit_save = False - - def set(self, film): - self.inhibit_save = True - - self.film = film - self.film_name.set_text(film.name) - self.ratio.set_active(ratio.ratio_to_index(film.ratio)) - if film.content is not None: - if os.path.isfile(film.content): - self.set_content_is_file(True) - self.content_file_button.set_filename(film.content) - else: - self.set_content_is_file(False) - self.content_folder_button.set_filename(film.content) - self.dvd.set_active(film.dvd) - self.dvd_title.set_value(film.dvd_title) - self.dvd_title.set_sensitive(film.dvd) - self.deinterlace.set_active(film.deinterlace) - self.left_crop.set_value(film.left_crop) - self.right_crop.set_value(film.right_crop) - self.top_crop.set_value(film.top_crop) - self.bottom_crop.set_value(film.bottom_crop) - - # Content information - if film.width is not None and film.height is not None: - self.source_size.set_text("%dx%d" % (film.width, film.height)) - else: - self.source_size.set_text("Unknown") - if film.fps is not None: - self.fps.set_text(str(film.fps)) - if film.length is not None: - self.length.set_text("%d:%02d:%02d" % util.s_to_hms(film.length)) - - self.inhibit_save = False - - def set_content_is_file(self, f): - self.content_file_button.set_sensitive(f) - self.content_folder_button.set_sensitive(not f) - self.content_file_radio.set_active(f) - self.content_folder_radio.set_active(not f) - - def label(self, text = ""): - l = gtk.Label(text) - l.set_alignment(0, 0.5) - return l - - def changed(self, a, b): - self.dvd_title.set_sensitive(self.dvd.get_active()) - self.save_film() - - def crop_spinbutton(self): - s = gtk.SpinButton() - s.set_range(0, 1024) - s.set_increments(1, 16) - s.connect("value-changed", self.changed, self) - return s - - def save_film(self): - if self.inhibit_save: - return - - self.film.name = self.film_name.get_text() - self.film.ratio = ratio.index_to_ratio(self.ratio.get_active()).ratio - - if self.content_file_radio.get_active(): - self.film.set_content(self.content_file_button.get_filename()) - else: - self.film.set_content(self.content_folder_button.get_filename()) - self.film.set_dvd(self.dvd.get_active()) - self.film.set_dvd_title(self.dvd_title.get_value_as_int()) - self.film.deinterlace = self.deinterlace.get_active() - self.film.left_crop = self.left_crop.get_value_as_int() - self.film.right_crop = self.right_crop.get_value_as_int() - self.film.top_crop = self.top_crop.get_value_as_int() - self.film.bottom_crop = self.bottom_crop.get_value_as_int() - self.film.write() - - def thumbs_clicked(self, a, b): - if self.film.thumbs() == 0: - self.film.make_thumbs() - - t = thumbs.Thumbs(self.film) - t.run() - t.hide() - self.left_crop.set_value(t.left_crop()) - self.right_crop.set_value(t.right_crop()) - self.top_crop.set_value(t.top_crop()) - self.bottom_crop.set_value(t.bottom_crop()) - - def content_file_chooser_file_set(self, a, b): - self.changed(a, b) - - def content_folder_chooser_file_set(self, a, b): - self.changed(a, b) - - def content_radio_toggled(self, a, b): - self.set_content_is_file(self.content_file_radio.get_active()) - self.changed(a, b) - diff --git a/hacks/python-playback/player.py b/hacks/python-playback/player.py deleted file mode 100644 index 5cc8da711..000000000 --- a/hacks/python-playback/player.py +++ /dev/null @@ -1,112 +0,0 @@ -import os -import threading -import subprocess -import shlex -import select -import film -import config -import mplayer - -class CommandLine: - def __init__(self): - self.position_x = 0 - self.position_y = 0 - self.output_width = None - self.output_height = None - self.mov = False - self.delay = None - self.dvd = False - self.dvd_title = 1 - self.content = None - self.extra = '' - self.crop_x = None - self.crop_y = None - self.crop_w = None - self.crop_h = None - self.deinterlace = False - self.aid = None - - def get(self, with_binary): - # hqdn3d? - # nr, unsharp? - # -vo x11 appears to be necessary to prevent unwanted hardware scaling - # -noaspect stops mplayer rescaling to the movie's specified aspect ratio - args = '-vo x11 -noaspect -ao pulse -noborder -noautosub -nosub -sws 10 ' - args += '-geometry %d:%d ' % (self.position_x, self.position_y) - - # Video filters (passed to -vf) - - filters = [] - - if self.crop_x is not None or self.crop_y is not None or self.crop_w is not None or self.crop_h is not None: - crop = 'crop=' - if self.crop_w is not None and self.crop_h is not None: - crop += '%d:%d' % (self.crop_w, self.crop_h) - if self.crop_x is not None and self.crop_x is not None: - crop += ':%d:%d' % (self.crop_x, self.crop_y) - filters.append(crop) - - if self.output_width is not None or self.output_height is not None: - filters.append('scale=%d:%d' % (self.output_width, self.output_height)) - - # Post processing - pp = [] - if self.deinterlace: - pp.append('lb') - - # Deringing filter - pp.append('dr') - - if len(pp) > 0: - pp_string = 'pp=' - for i in range(0, len(pp)): - pp_string += pp[i] - if i < len(pp) - 1: - pp += ',' - - filters.append(pp_string) - - if len(filters) > 0: - args += '-vf ' - for i in range(0, len(filters)): - args += filters[i] - if i < len(filters) - 1: - args += ',' - args += ' ' - - if self.mov: - args += '-demuxer mov ' - if self.delay is not None: - args += '-delay %f ' % float(args.delay) - if self.aid is not None: - args += '-aid %s ' % self.aid - - args += self.extra - - if self.dvd: - data_specifier = 'dvd://%d -dvd-device \"%s\"' % (self.dvd_title, self.content) - else: - data_specifier = '\"%s\"' % self.content - - if with_binary: - return 'mplayer %s %s' % (args, data_specifier) - - return '%s %s' % (args, data_specifier) - -def get_player(film, format): - cl = CommandLine() - cl.dvd = film.dvd - cl.dvd_title = film.dvd_title - cl.content = film.content - cl.crop_w = film.width - film.left_crop - film.right_crop - cl.crop_h = film.height - film.top_crop - film.bottom_crop - cl.position_x = format.x - if format.external: - cl.position_x = format.x + config.LEFT_SCREEN_WIDTH - cl.position_y = format.y - cl.output_width = format.width - cl.output_height = format.height - cl.deinterlace = film.deinterlace - cl.aid = film.aid - return mplayer.Player(cl.get(False)) - diff --git a/hacks/python-playback/ratio.py b/hacks/python-playback/ratio.py deleted file mode 100644 index 62320dc8a..000000000 --- a/hacks/python-playback/ratio.py +++ /dev/null @@ -1,56 +0,0 @@ -# Class to describe a Ratio, and a collection of common -# (and not-so-common) film ratios collected from Wikipedia. - -class Ratio: - def __init__(self, ratio, nickname = None): - self.nickname = nickname - self.ratio = ratio - - # @return presentation name of this ratio - def name(self): - if self.nickname is not None: - return "%.2f (%s)" % (self.ratio, self.nickname) - - return "%.2f" % self.ratio - -ratios = [] -ratios.append(Ratio(1.33, '4:3')) -ratios.append(Ratio(1.37, 'Academy')) -ratios.append(Ratio(1.78, '16:9')) -ratios.append(Ratio(1.85, 'Flat / widescreen')) -ratios.append(Ratio(2.39, 'CinemaScope / Panavision')) -ratios.append(Ratio(1.15, 'Movietone')) -ratios.append(Ratio(1.43, 'IMAX')) -ratios.append(Ratio(1.5)) -ratios.append(Ratio(1.56, '14:9')) -ratios.append(Ratio(1.6, '16:10')) -ratios.append(Ratio(1.67)) -ratios.append(Ratio(2, 'SuperScope')) -ratios.append(Ratio(2.2, 'Todd-AO')) -ratios.append(Ratio(2.35, 'Early CinemaScope / Panavision')) -ratios.append(Ratio(2.37, '21:9')) -ratios.append(Ratio(2.55, 'CinemaScope 55')) -ratios.append(Ratio(2.59, 'Cinerama')) -ratios.append(Ratio(2.76, 'Ultra Panavision')) -ratios.append(Ratio(2.93, 'MGM Camera 65')) -ratios.append(Ratio(4, 'Polyvision')) - -# Find a Ratio object from a fractional ratio -def find(ratio): - for r in ratios: - if r.ratio == ratio: - return r - - return None - -# @return the ith ratio -def index_to_ratio(i): - return ratios[i] - -# @return the index within the ratios list of a given fractional ratio -def ratio_to_index(r): - for i in range(0, len(ratios)): - if ratios[i].ratio == r: - return i - - return None diff --git a/hacks/python-playback/screens b/hacks/python-playback/screens deleted file mode 100644 index f389cb1c4..000000000 --- a/hacks/python-playback/screens +++ /dev/null @@ -1,62 +0,0 @@ -# Screen 1 (untested) -screen 1 -ratio 1.85 -x 175 -y 100 -width 1550 -height 950 -external 1 -ratio 2.39 -x 0 -y 200 -width 2000 -height 860 -external 1 - -# Screen 2 -screen 2 -ratio 1.85 -x 175 -y 100 -width 1550 -height 950 -external 1 -ratio 2.39 -x 0 -y 200 -width 2000 -height 860 -external 1 - -# Screen 3 (untested) -screen 3 -ratio 1.85 -x 175 -y 100 -width 1550 -height 950 -external 1 -ratio 2.39 -x 0 -y 200 -width 2000 -height 860 -external 1 - -# Carl's Laptop -screen laptop -ratio 1.85 -x 0 -y 0 -width 1366 -height 738 -ratio 2.39 -x 0 -y 0 -width 1366 -height 572 -ratio 1.78 -x 0 -y 0 -width 1366 -height 767 diff --git a/hacks/python-playback/screens.py b/hacks/python-playback/screens.py deleted file mode 100644 index 4230a4cf8..000000000 --- a/hacks/python-playback/screens.py +++ /dev/null @@ -1,85 +0,0 @@ -#!/usr/bin/python - -class Screen: - def __init__(self): - self.name = None - self.formats = [] - -class Format: - def __init__(self): - self.ratio = None - self.x = None - self.y = None - self.width = None - self.height = None - self.external = False - -class Screens: - def __init__(self, file): - - self.screens = [] - - f = open(file, 'r') - current_screen = None - current_format = None - while 1: - l = f.readline() - if l == '': - break - if len(l) > 0 and l[0] == '#': - continue - - s = l.strip() - - if len(s) == 0: - continue - - b = s.split() - - if len(b) != 2: - print "WARNING: ignored line `%s' in screens file" % (s) - continue - - if b[0] == 'screen': - if current_format is not None: - current_screen.formats.append(current_format) - current_format = None - - if current_screen is not None: - self.screens.append(current_screen) - current_screen = None - - current_screen = Screen() - current_screen.name = b[1] - elif b[0] == 'ratio': - if current_format is not None: - current_screen.formats.append(current_format) - current_format = None - - current_format = Format() - current_format.ratio = float(b[1]) - elif b[0] == 'x': - current_format.x = int(b[1]) - elif b[0] == 'y': - current_format.y = int(b[1]) - elif b[0] == 'width': - current_format.width = int(b[1]) - elif b[0] == 'height': - current_format.height = int(b[1]) - elif b[0] == 'external': - current_format.external = int(b[1]) == 1 - - if current_format is not None: - current_screen.formats.append(current_format) - - if current_screen is not None: - self.screens.append(current_screen) - - def get_format(self, screen, ratio): - for s in self.screens: - if s.name == screen: - for f in s.formats: - if f.ratio == ratio: - return f - - return None diff --git a/hacks/python-playback/thumbs.py b/hacks/python-playback/thumbs.py deleted file mode 100644 index 921f82f5d..000000000 --- a/hacks/python-playback/thumbs.py +++ /dev/null @@ -1,76 +0,0 @@ -# GUI to display thumbnails and allow cropping -# to be set up - -import os -import sys -import pygtk -pygtk.require('2.0') -import gtk -import film -import player - -class Thumbs(gtk.Dialog): - def __init__(self, film): - gtk.Dialog.__init__(self) - self.film = film - self.controls = gtk.Table() - self.controls.set_col_spacings(4) - self.thumb_adj = gtk.Adjustment(0, 0, self.film.thumbs() - 1, 1, 10) - self.add_control("Thumbnail", self.thumb_adj, 0) - self.left_crop_adj = gtk.Adjustment(self.film.left_crop, 0, 1024, 1, 128) - self.add_control("Left crop", self.left_crop_adj, 1) - self.right_crop_adj = gtk.Adjustment(self.film.right_crop, 0, 1024, 1, 128) - self.add_control("Right crop", self.right_crop_adj, 2) - self.top_crop_adj = gtk.Adjustment(self.film.top_crop, 0, 1024, 1, 128) - self.add_control("Top crop", self.top_crop_adj, 3) - self.bottom_crop_adj = gtk.Adjustment(self.film.bottom_crop, 0, 1024, 1, 128) - self.add_control("Bottom crop", self.bottom_crop_adj, 4) - self.display_image = gtk.Image() - self.update_display() - window_box = gtk.HBox() - window_box.set_spacing(12) - - controls_vbox = gtk.VBox() - controls_vbox.set_spacing(4) - controls_vbox.pack_start(self.controls, False, False) - - window_box.pack_start(controls_vbox, True, True) - window_box.pack_start(self.display_image) - - self.set_title("%s Thumbnails" % film.name) - self.get_content_area().add(window_box) - self.add_button("Close", gtk.RESPONSE_ACCEPT) - self.show_all() - - for a in [self.thumb_adj, self.left_crop_adj, self.right_crop_adj, self.top_crop_adj, self.bottom_crop_adj]: - a.connect('value-changed', self.update_display, self) - - def add_control(self, name, adj, n): - l = gtk.Label(name) - l.set_alignment(1, 0.5) - self.controls.attach(l, 0, 1, n, n + 1) - s = gtk.SpinButton(adj) - self.controls.attach(s, 1, 2, n, n + 1) - - def update_display(self, a = None, b = None): - thumb_pixbuf = gtk.gdk.pixbuf_new_from_file(self.film.thumb(self.thumb_adj.get_value())) - self.width = thumb_pixbuf.get_width() - self.height = thumb_pixbuf.get_height() - left = self.left_crop() - right = self.right_crop() - top = self.top_crop() - bottom = self.bottom_crop() - pixbuf = thumb_pixbuf.subpixbuf(left, top, self.width - left - right, self.height - top - bottom) - self.display_image.set_from_pixbuf(pixbuf) - - def top_crop(self): - return int(self.top_crop_adj.get_value()) - - def bottom_crop(self): - return int(self.bottom_crop_adj.get_value()) - - def left_crop(self): - return int(self.left_crop_adj.get_value()) - - def right_crop(self): - return int(self.right_crop_adj.get_value()) diff --git a/hacks/python-playback/util.py b/hacks/python-playback/util.py deleted file mode 100644 index d78abdd00..000000000 --- a/hacks/python-playback/util.py +++ /dev/null @@ -1,7 +0,0 @@ - -def s_to_hms(s): - m = int(s / 60) - s -= (m * 60) - h = int(m / 60) - m -= (h * 60) - return (h, m, s) diff --git a/hacks/python-playback/xrandr-notes b/hacks/python-playback/xrandr-notes deleted file mode 100644 index eeabf1423..000000000 --- a/hacks/python-playback/xrandr-notes +++ /dev/null @@ -1,17 +0,0 @@ -Recommended 1680 x 1050, 60 fps -xrandr --output HDMI1 --mode 0xbc - -List modes -xrandr --verbose -q - -2048 x 1024, 24 fps -xrandr --output HDMI1 --mode 0xd1 - -cvt -to give modeline, then -xrandr --newmode modeline -then add -xrandr --verbose --addmode HDMI1 modename -then activate -xrandr --output HDMI1 --mode foo - diff --git a/icons/128x128/dcpomatic.png b/icons/128x128/dcpomatic.png new file mode 100644 index 000000000..9936b39af Binary files /dev/null and b/icons/128x128/dcpomatic.png differ diff --git a/icons/128x128/dvdomatic.png b/icons/128x128/dvdomatic.png deleted file mode 100644 index 9936b39af..000000000 Binary files a/icons/128x128/dvdomatic.png and /dev/null differ diff --git a/icons/16x16/dcpomatic.png b/icons/16x16/dcpomatic.png new file mode 100644 index 000000000..3c5a10f2d Binary files /dev/null and b/icons/16x16/dcpomatic.png differ diff --git a/icons/16x16/dvdomatic.png b/icons/16x16/dvdomatic.png deleted file mode 100644 index 3c5a10f2d..000000000 Binary files a/icons/16x16/dvdomatic.png and /dev/null differ diff --git a/icons/22x22/dcpomatic.png b/icons/22x22/dcpomatic.png new file mode 100644 index 000000000..dddb86298 Binary files /dev/null and b/icons/22x22/dcpomatic.png differ diff --git a/icons/22x22/dvdomatic.png b/icons/22x22/dvdomatic.png deleted file mode 100644 index dddb86298..000000000 Binary files a/icons/22x22/dvdomatic.png and /dev/null differ diff --git a/icons/32x32/dcpomatic.png b/icons/32x32/dcpomatic.png new file mode 100644 index 000000000..8cecf08f8 Binary files /dev/null and b/icons/32x32/dcpomatic.png differ diff --git a/icons/32x32/dvdomatic.png b/icons/32x32/dvdomatic.png deleted file mode 100644 index 8cecf08f8..000000000 Binary files a/icons/32x32/dvdomatic.png and /dev/null differ diff --git a/icons/48x48/dcpomatic.png b/icons/48x48/dcpomatic.png new file mode 100644 index 000000000..07bf2d10b Binary files /dev/null and b/icons/48x48/dcpomatic.png differ diff --git a/icons/48x48/dvdomatic.png b/icons/48x48/dvdomatic.png deleted file mode 100644 index 07bf2d10b..000000000 Binary files a/icons/48x48/dvdomatic.png and /dev/null differ diff --git a/icons/64x64/dcpomatic.png b/icons/64x64/dcpomatic.png new file mode 100644 index 000000000..35564a8a2 Binary files /dev/null and b/icons/64x64/dcpomatic.png differ diff --git a/icons/64x64/dvdomatic.png b/icons/64x64/dvdomatic.png deleted file mode 100644 index 35564a8a2..000000000 Binary files a/icons/64x64/dvdomatic.png and /dev/null differ diff --git a/run/dcpomatic b/run/dcpomatic new file mode 100755 index 000000000..7ea08778c --- /dev/null +++ b/run/dcpomatic @@ -0,0 +1,15 @@ +#!/bin/bash + +export LD_LIBRARY_PATH=build/src/lib:build/src/wx:build/src/asdcplib/src:$LD_LIBRARY_PATH +if [ "$1" == "--debug" ]; then + shift + gdb --args build/src/tools/dcpomatic $* +elif [ "$1" == "--valgrind" ]; then + shift + valgrind --tool="memcheck" build/src/tools/dcpomatic $* +elif [ "$1" == "--i18n" ]; then + shift + LANGUAGE=fr_FR.UTF8 LANG=fr_FR.UTF8 build/src/tools/dcpomatic "$*" +else + build/src/tools/dcpomatic $* +fi diff --git a/run/dcpomatic_cli b/run/dcpomatic_cli new file mode 100755 index 000000000..bf2f08015 --- /dev/null +++ b/run/dcpomatic_cli @@ -0,0 +1,12 @@ +#!/bin/bash + +export LD_LIBRARY_PATH=build/src/lib:$LD_LIBRARY_PATH:build/src +if [ "$1" == "--debug" ]; then + shift + gdb --args build/src/tools/dcpomatic_cli "$@" +elif [ "$1" == "--valgrind" ]; then + shift + valgrind --tool="memcheck" --leak-check=full --show-reachable=yes build/src/tools/dcpomatic_cli "$@" +else + build/src/tools/dcpomatic_cli "$@" +fi diff --git a/run/dvdomatic b/run/dvdomatic deleted file mode 100755 index 147c001cd..000000000 --- a/run/dvdomatic +++ /dev/null @@ -1,15 +0,0 @@ -#!/bin/bash - -export LD_LIBRARY_PATH=build/src/lib:build/src/wx:build/src/asdcplib/src:$LD_LIBRARY_PATH -if [ "$1" == "--debug" ]; then - shift - gdb --args build/src/tools/dvdomatic "$*" -elif [ "$1" == "--valgrind" ]; then - shift - valgrind --tool="memcheck" build/src/tools/dvdomatic $* -elif [ "$1" == "--i18n" ]; then - shift - LANGUAGE=fr_FR.UTF8 LANG=fr_FR.UTF8 build/src/tools/dvdomatic "$*" -else - build/src/tools/dvdomatic "$*" -fi diff --git a/run/makedcp b/run/makedcp deleted file mode 100755 index 2b95ea165..000000000 --- a/run/makedcp +++ /dev/null @@ -1,15 +0,0 @@ -#!/bin/bash - -export LD_LIBRARY_PATH=build/src/lib:$LD_LIBRARY_PATH:build/src -if [ "$1" == "--debug" ]; then - shift - gdb --args build/src/tools/makedcp "$@" -elif [ "$1" == "--memcheck" ]; then - shift - valgrind --tool="memcheck" --leak-check=full --show-reachable=yes build/src/tools/makedcp "$@" -elif [ "$1" == "--massif" ]; then - shift - valgrind --tool="massif" build/src/tools/makedcp "$@" -else - build/src/tools/makedcp "$@" -fi diff --git a/src/lib/ab_transcode_job.cc b/src/lib/ab_transcode_job.cc index 4ffdd9af6..2bdff47de 100644 --- a/src/lib/ab_transcode_job.cc +++ b/src/lib/ab_transcode_job.cc @@ -32,11 +32,9 @@ using std::string; using boost::shared_ptr; /** @param f Film to compare. - * @param o Decode options. */ -ABTranscodeJob::ABTranscodeJob (shared_ptr f, DecodeOptions o) +ABTranscodeJob::ABTranscodeJob (shared_ptr f) : Job (f) - , _decode_opt (o) { _film_b.reset (new Film (*_film)); _film_b->set_scaler (Config::instance()->reference_scaler ()); @@ -54,7 +52,7 @@ ABTranscodeJob::run () { try { /* _film_b is the one with reference filters */ - ABTranscoder w (_film_b, _film, _decode_opt, this, shared_ptr (new Encoder (_film))); + ABTranscoder w (_film_b, _film, shared_from_this ()); w.go (); set_progress (1); set_state (FINISHED_OK); diff --git a/src/lib/ab_transcode_job.h b/src/lib/ab_transcode_job.h index 8e3cbe2d8..cd82d4247 100644 --- a/src/lib/ab_transcode_job.h +++ b/src/lib/ab_transcode_job.h @@ -23,7 +23,6 @@ #include #include "job.h" -#include "options.h" class Film; @@ -38,16 +37,13 @@ class ABTranscodeJob : public Job { public: ABTranscodeJob ( - boost::shared_ptr f, - DecodeOptions o + boost::shared_ptr f ); std::string name () const; void run (); private: - DecodeOptions _decode_opt; - /** Copy of our Film using the reference filters and scaler */ boost::shared_ptr _film_b; }; diff --git a/src/lib/ab_transcoder.cc b/src/lib/ab_transcoder.cc index c42f0d241..91c4665a7 100644 --- a/src/lib/ab_transcoder.cc +++ b/src/lib/ab_transcoder.cc @@ -21,18 +21,11 @@ #include #include "ab_transcoder.h" #include "film.h" -#include "video_decoder.h" -#include "audio_decoder.h" #include "encoder.h" #include "job.h" -#include "options.h" #include "image.h" -#include "decoder_factory.h" -#include "matcher.h" -#include "delay_line.h" -#include "gain.h" +#include "player.h" #include "combiner.h" -#include "trimmer.h" /** @file src/ab_transcoder.cc * @brief A transcoder which uses one Film for the left half of the screen, and a different one @@ -50,93 +43,24 @@ using boost::dynamic_pointer_cast; * @param e Encoder to use. */ -ABTranscoder::ABTranscoder ( - shared_ptr a, shared_ptr b, DecodeOptions o, Job* j, shared_ptr e) - : _film_a (a) - , _film_b (b) +ABTranscoder::ABTranscoder (shared_ptr film_a, shared_ptr film_b, shared_ptr j) + : _player_a (film_a->player ()) + , _player_b (film_b->player ()) , _job (j) - , _encoder (e) - , _combiner (new Combiner (a->log())) + , _encoder (new Encoder (film_a, j)) + , _combiner (new Combiner (film_a->log())) { - _da = decoder_factory (_film_a, o); - _db = decoder_factory (_film_b, o); + _player_a->Video.connect (bind (&Combiner::process_video, _combiner, _1, _2, _3, _4)); + _player_b->Video.connect (bind (&Combiner::process_video_b, _combiner, _1, _2, _3, _4)); - shared_ptr st = _film_a->audio_stream(); - if (st && st->sample_rate()) { - _matcher.reset (new Matcher (_film_a->log(), st->sample_rate(), _film_a->source_frame_rate())); - } - _delay_line.reset (new DelayLine (_film_a->log(), _film_a->audio_delay() / 1000.0f)); - _gain.reset (new Gain (_film_a->log(), _film_a->audio_gain())); - - int const sr = st ? st->sample_rate() : 0; - int const trim_start = _film_a->trim_type() == Film::ENCODE ? _film_a->trim_start() : 0; - int const trim_end = _film_a->trim_type() == Film::ENCODE ? _film_a->trim_end() : 0; - _trimmer.reset (new Trimmer ( - _film_a->log(), trim_start, trim_end, _film_a->length().get(), - sr, _film_a->source_frame_rate(), _film_a->dcp_frame_rate() - )); - - /* Set up the decoder to use the film's set streams */ - _da.video->set_subtitle_stream (_film_a->subtitle_stream ()); - _db.video->set_subtitle_stream (_film_a->subtitle_stream ()); - if (_film_a->audio_stream ()) { - _da.audio->set_audio_stream (_film_a->audio_stream ()); - } - - _da.video->Video.connect (bind (&Combiner::process_video, _combiner, _1, _2, _3, _4)); - _db.video->Video.connect (bind (&Combiner::process_video_b, _combiner, _1, _2, _3, _4)); - - _combiner->connect_video (_delay_line); - if (_matcher) { - _delay_line->connect_video (_matcher); - _matcher->connect_video (_trimmer); - } else { - _delay_line->connect_video (_trimmer); - } - _trimmer->connect_video (_encoder); - - _da.audio->connect_audio (_delay_line); - if (_matcher) { - _delay_line->connect_audio (_matcher); - _matcher->connect_audio (_gain); - } else { - _delay_line->connect_audio (_gain); - } - _gain->connect_audio (_trimmer); - _trimmer->connect_audio (_encoder); + _combiner->connect_video (_encoder); + _player_a->connect_audio (_encoder); } void ABTranscoder::go () { _encoder->process_begin (); - - bool done[3] = { false, false, false }; - - while (1) { - done[0] = _da.video->pass (); - done[1] = _db.video->pass (); - - if (!done[2] && _da.audio && dynamic_pointer_cast (_da.audio) != dynamic_pointer_cast (_da.video)) { - done[2] = _da.audio->pass (); - } else { - done[2] = true; - } - - if (_job) { - _da.video->set_progress (_job); - } - - if (done[0] && done[1] && done[2]) { - break; - } - } - - _delay_line->process_end (); - if (_matcher) { - _matcher->process_end (); - } - _gain->process_end (); + while (!_player_a->pass () || !_player_b->pass ()) {} _encoder->process_end (); } - diff --git a/src/lib/ab_transcoder.h b/src/lib/ab_transcoder.h index 4f1b14e48..54d7ed0be 100644 --- a/src/lib/ab_transcoder.h +++ b/src/lib/ab_transcoder.h @@ -25,21 +25,14 @@ #include #include #include "util.h" -#include "decoder_factory.h" class Job; class Encoder; -class VideoDecoder; -class AudioDecoder; class Image; class Log; -class Subtitle; class Film; -class Matcher; -class DelayLine; -class Gain; class Combiner; -class Trimmer; +class Player; /** @class ABTranscoder * @brief A transcoder which uses one Film for the left half of the screen, and a different one @@ -51,24 +44,16 @@ public: ABTranscoder ( boost::shared_ptr a, boost::shared_ptr b, - DecodeOptions o, - Job* j, - boost::shared_ptr e + boost::shared_ptr j ); void go (); private: - boost::shared_ptr _film_a; - boost::shared_ptr _film_b; - Job* _job; + boost::shared_ptr _player_a; + boost::shared_ptr _player_b; + boost::shared_ptr _job; boost::shared_ptr _encoder; - Decoders _da; - Decoders _db; boost::shared_ptr _combiner; - boost::shared_ptr _matcher; - boost::shared_ptr _delay_line; - boost::shared_ptr _gain; - boost::shared_ptr _trimmer; boost::shared_ptr _image; }; diff --git a/src/lib/analyse_audio_job.cc b/src/lib/analyse_audio_job.cc index 88cd65fee..0ed33827c 100644 --- a/src/lib/analyse_audio_job.cc +++ b/src/lib/analyse_audio_job.cc @@ -21,9 +21,7 @@ #include "analyse_audio_job.h" #include "compose.hpp" #include "film.h" -#include "options.h" -#include "decoder_factory.h" -#include "audio_decoder.h" +#include "player.h" #include "i18n.h" @@ -52,29 +50,18 @@ AnalyseAudioJob::name () const void AnalyseAudioJob::run () { - if (!_film->audio_stream () || !_film->length()) { - set_progress (1); - set_state (FINISHED_ERROR); - return; - } - - DecodeOptions options; - options.decode_video = false; - - Decoders decoders = decoder_factory (_film, options); - assert (decoders.audio); + shared_ptr player = _film->player (); + player->disable_video (); - decoders.audio->set_audio_stream (_film->audio_stream ()); - decoders.audio->Audio.connect (bind (&AnalyseAudioJob::audio, this, _1)); + player->Audio.connect (bind (&AnalyseAudioJob::audio, this, _1)); - int64_t total_audio_frames = video_frames_to_audio_frames (_film->length().get(), _film->audio_stream()->sample_rate(), _film->source_frame_rate()); - _samples_per_point = max (int64_t (1), total_audio_frames / _num_points); + _samples_per_point = max (int64_t (1), _film->time_to_audio_frames (_film->length()) / _num_points); - _current.resize (_film->audio_stream()->channels ()); - _analysis.reset (new AudioAnalysis (_film->audio_stream()->channels())); + _current.resize (MAX_AUDIO_CHANNELS); + _analysis.reset (new AudioAnalysis (MAX_AUDIO_CHANNELS)); - while (!decoders.audio->pass()) { - set_progress (float (_done) / total_audio_frames); + while (!player->pass()) { + set_progress (float (_done) / _film->time_to_audio_frames (_film->length ())); } _analysis->write (_film->audio_analysis_path ()); diff --git a/src/lib/audio_analysis.h b/src/lib/audio_analysis.h index 6e0e2b78a..ec6905105 100644 --- a/src/lib/audio_analysis.h +++ b/src/lib/audio_analysis.h @@ -17,8 +17,8 @@ */ -#ifndef DVDOMATIC_AUDIO_ANALYSIS_H -#define DVDOMATIC_AUDIO_ANALYSIS_H +#ifndef DCPOMATIC_AUDIO_ANALYSIS_H +#define DCPOMATIC_AUDIO_ANALYSIS_H #include #include diff --git a/src/lib/audio_buffers.cc b/src/lib/audio_buffers.cc new file mode 100644 index 000000000..cd8fcd35b --- /dev/null +++ b/src/lib/audio_buffers.cc @@ -0,0 +1,222 @@ +/* + Copyright (C) 2012-2013 Carl Hetherington + + This program is free software; you can redistribute it and/or modify + it under the terms of the GNU General Public License as published by + the Free Software Foundation; either version 2 of the License, or + (at your option) any later version. + + This program is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + GNU General Public License for more details. + + You should have received a copy of the GNU General Public License + along with this program; if not, write to the Free Software + Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. + +*/ + +#include +#include +#include +#include "audio_buffers.h" + +using std::bad_alloc; +using boost::shared_ptr; + +/** Construct an AudioBuffers. Audio data is undefined after this constructor. + * @param channels Number of channels. + * @param frames Number of frames to reserve space for. + */ +AudioBuffers::AudioBuffers (int channels, int frames) + : _channels (channels) + , _frames (frames) + , _allocated_frames (frames) +{ + _data = static_cast (malloc (_channels * sizeof (float *))); + if (!_data) { + throw bad_alloc (); + } + + for (int i = 0; i < _channels; ++i) { + _data[i] = static_cast (malloc (frames * sizeof (float))); + if (!_data[i]) { + throw bad_alloc (); + } + } +} + +/** Copy constructor. + * @param other Other AudioBuffers; data is copied. + */ +AudioBuffers::AudioBuffers (AudioBuffers const & other) + : _channels (other._channels) + , _frames (other._frames) + , _allocated_frames (other._frames) +{ + _data = static_cast (malloc (_channels * sizeof (float *))); + if (!_data) { + throw bad_alloc (); + } + + for (int i = 0; i < _channels; ++i) { + _data[i] = static_cast (malloc (_frames * sizeof (float))); + if (!_data[i]) { + throw bad_alloc (); + } + memcpy (_data[i], other._data[i], _frames * sizeof (float)); + } +} + +/* XXX: it's a shame that this is a copy-and-paste of the above; + probably fixable with c++0x. +*/ +AudioBuffers::AudioBuffers (boost::shared_ptr other) + : _channels (other->_channels) + , _frames (other->_frames) + , _allocated_frames (other->_frames) +{ + _data = static_cast (malloc (_channels * sizeof (float *))); + if (!_data) { + throw bad_alloc (); + } + + for (int i = 0; i < _channels; ++i) { + _data[i] = static_cast (malloc (_frames * sizeof (float))); + if (!_data[i]) { + throw bad_alloc (); + } + memcpy (_data[i], other->_data[i], _frames * sizeof (float)); + } +} + +/** AudioBuffers destructor */ +AudioBuffers::~AudioBuffers () +{ + for (int i = 0; i < _channels; ++i) { + free (_data[i]); + } + + free (_data); +} + +/** @param c Channel index. + * @return Buffer for this channel. + */ +float* +AudioBuffers::data (int c) const +{ + assert (c >= 0 && c < _channels); + return _data[c]; +} + +/** Set the number of frames that these AudioBuffers will report themselves + * as having. + * @param f Frames; must be less than or equal to the number of allocated frames. + */ +void +AudioBuffers::set_frames (int f) +{ + assert (f <= _allocated_frames); + _frames = f; +} + +/** Make all samples on all channels silent */ +void +AudioBuffers::make_silent () +{ + for (int i = 0; i < _channels; ++i) { + make_silent (i); + } +} + +/** Make all samples on a given channel silent. + * @param c Channel. + */ +void +AudioBuffers::make_silent (int c) +{ + assert (c >= 0 && c < _channels); + + for (int i = 0; i < _frames; ++i) { + _data[c][i] = 0; + } +} + +/** Copy data from another AudioBuffers to this one. All channels are copied. + * @param from AudioBuffers to copy from; must have the same number of channels as this. + * @param frames_to_copy Number of frames to copy. + * @param read_offset Offset to read from in `from'. + * @param write_offset Offset to write to in `to'. + */ +void +AudioBuffers::copy_from (AudioBuffers const * from, int frames_to_copy, int read_offset, int write_offset) +{ + assert (from->channels() == channels()); + + assert (from); + assert (read_offset >= 0 && (read_offset + frames_to_copy) <= from->_allocated_frames); + assert (write_offset >= 0 && (write_offset + frames_to_copy) <= _allocated_frames); + + for (int i = 0; i < _channels; ++i) { + memcpy (_data[i] + write_offset, from->_data[i] + read_offset, frames_to_copy * sizeof(float)); + } +} + +/** Move audio data around. + * @param from Offset to move from. + * @param to Offset to move to. + * @param frames Number of frames to move. + */ + +void +AudioBuffers::move (int from, int to, int frames) +{ + if (frames == 0) { + return; + } + + assert (from >= 0); + assert (from < _frames); + assert (to >= 0); + assert (to < _frames); + assert (frames > 0); + assert (frames <= _frames); + assert ((from + frames) <= _frames); + assert ((to + frames) <= _frames); + + for (int i = 0; i < _channels; ++i) { + memmove (_data[i] + to, _data[i] + from, frames * sizeof(float)); + } +} + +/** Add data from from `from', `from_channel' to our channel `to_channel' */ +void +AudioBuffers::accumulate (AudioBuffers const * from, int from_channel, int to_channel) +{ + int const N = frames (); + assert (from->frames() == N); + + float* s = from->data (from_channel); + float* d = _data[to_channel]; + + for (int i = 0; i < N; ++i) { + *d++ += *s++; + } +} + +void +AudioBuffers::ensure_size (int frames) +{ + if (_allocated_frames >= frames) { + return; + } + + for (int i = 0; i < _channels; ++i) { + _data[i] = static_cast (realloc (_data[i], _frames * sizeof (float))); + if (!_data[i]) { + throw bad_alloc (); + } + } +} diff --git a/src/lib/audio_buffers.h b/src/lib/audio_buffers.h new file mode 100644 index 000000000..5e7b9fda4 --- /dev/null +++ b/src/lib/audio_buffers.h @@ -0,0 +1,67 @@ +/* + Copyright (C) 2012-2013 Carl Hetherington + + This program is free software; you can redistribute it and/or modify + it under the terms of the GNU General Public License as published by + the Free Software Foundation; either version 2 of the License, or + (at your option) any later version. + + This program is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + GNU General Public License for more details. + + You should have received a copy of the GNU General Public License + along with this program; if not, write to the Free Software + Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. + +*/ + +#include + +/** @class AudioBuffers + * @brief A class to hold multi-channel audio data in float format. + */ +class AudioBuffers +{ +public: + AudioBuffers (int channels, int frames); + AudioBuffers (AudioBuffers const &); + AudioBuffers (boost::shared_ptr); + ~AudioBuffers (); + + void ensure_size (int); + + float** data () const { + return _data; + } + + float* data (int) const; + + int channels () const { + return _channels; + } + + int frames () const { + return _frames; + } + + void set_frames (int f); + + void make_silent (); + void make_silent (int c); + + void copy_from (AudioBuffers const * from, int frames_to_copy, int read_offset, int write_offset); + void move (int from, int to, int frames); + void accumulate (AudioBuffers const *, int, int); + +private: + /** Number of channels */ + int _channels; + /** Number of frames (where a frame is one sample across all channels) */ + int _frames; + /** Number of frames that _data can hold */ + int _allocated_frames; + /** Audio data (so that, e.g. _data[2][6] is channel 2, sample 6) */ + float** _data; +}; diff --git a/src/lib/audio_content.cc b/src/lib/audio_content.cc new file mode 100644 index 000000000..e38d9d265 --- /dev/null +++ b/src/lib/audio_content.cc @@ -0,0 +1,52 @@ +/* -*- c-basic-offset: 8; default-tab-width: 8; -*- */ + +/* + Copyright (C) 2013 Carl Hetherington + + This program is free software; you can redistribute it and/or modify + it under the terms of the GNU General Public License as published by + the Free Software Foundation; either version 2 of the License, or + (at your option) any later version. + + This program is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + GNU General Public License for more details. + + You should have received a copy of the GNU General Public License + along with this program; if not, write to the Free Software + Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. + +*/ + +#include +#include "audio_content.h" + +using boost::shared_ptr; + +int const AudioContentProperty::AUDIO_CHANNELS = 200; +int const AudioContentProperty::AUDIO_LENGTH = 201; +int const AudioContentProperty::AUDIO_FRAME_RATE = 202; + +AudioContent::AudioContent (boost::filesystem::path f) + : Content (f) +{ + +} + +AudioContent::AudioContent (shared_ptr node) + : Content (node) +{ +} + +AudioContent::AudioContent (AudioContent const & o) + : Content (o) +{ + +} + +void +AudioContent::as_xml (xmlpp::Node* node) const +{ + +} diff --git a/src/lib/audio_content.h b/src/lib/audio_content.h new file mode 100644 index 000000000..51f05efb0 --- /dev/null +++ b/src/lib/audio_content.h @@ -0,0 +1,56 @@ +/* -*- c-basic-offset: 8; default-tab-width: 8; -*- */ + +/* + Copyright (C) 2013 Carl Hetherington + + This program is free software; you can redistribute it and/or modify + it under the terms of the GNU General Public License as published by + the Free Software Foundation; either version 2 of the License, or + (at your option) any later version. + + This program is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + GNU General Public License for more details. + + You should have received a copy of the GNU General Public License + along with this program; if not, write to the Free Software + Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. + +*/ + +#ifndef DCPOMATIC_AUDIO_CONTENT_H +#define DCPOMATIC_AUDIO_CONTENT_H + +#include "content.h" +#include "audio_mapping.h" + +namespace cxml { + class Node; +} + +class AudioContentProperty +{ +public: + static int const AUDIO_CHANNELS; + static int const AUDIO_LENGTH; + static int const AUDIO_FRAME_RATE; +}; + +class AudioContent : public virtual Content +{ +public: + AudioContent (boost::filesystem::path); + AudioContent (boost::shared_ptr); + AudioContent (AudioContent const &); + + void as_xml (xmlpp::Node *) const; + + virtual int audio_channels () const = 0; + virtual ContentAudioFrame audio_length () const = 0; + virtual int content_audio_frame_rate () const = 0; + virtual int output_audio_frame_rate (boost::shared_ptr) const = 0; + virtual AudioMapping audio_mapping () const = 0; +}; + +#endif diff --git a/src/lib/audio_decoder.cc b/src/lib/audio_decoder.cc index a54c14843..e1c93ac77 100644 --- a/src/lib/audio_decoder.cc +++ b/src/lib/audio_decoder.cc @@ -18,19 +18,116 @@ */ #include "audio_decoder.h" -#include "stream.h" +#include "audio_buffers.h" +#include "exceptions.h" +#include "log.h" +#include "i18n.h" + +using std::stringstream; using boost::optional; using boost::shared_ptr; -AudioDecoder::AudioDecoder (shared_ptr f, DecodeOptions o) - : Decoder (f, o) +AudioDecoder::AudioDecoder (shared_ptr f, shared_ptr c) + : Decoder (f) + , _audio_content (c) + , _output_audio_frame_rate (_audio_content->output_audio_frame_rate (f)) { + if (_audio_content->content_audio_frame_rate() != _output_audio_frame_rate) { + + stringstream s; + s << String::compose ("Will resample audio from %1 to %2", _audio_content->content_audio_frame_rate(), _output_audio_frame_rate); + _film->log()->log (s.str ()); + + /* We will be using planar float data when we call the + resampler. As far as I can see, the audio channel + layout is not necessary for our purposes; it seems + only to be used get the number of channels and + decide if rematrixing is needed. It won't be, since + input and output layouts are the same. + */ + _swr_context = swr_alloc_set_opts ( + 0, + av_get_default_channel_layout (MAX_AUDIO_CHANNELS), + AV_SAMPLE_FMT_FLTP, + _output_audio_frame_rate, + av_get_default_channel_layout (MAX_AUDIO_CHANNELS), + AV_SAMPLE_FMT_FLTP, + _audio_content->content_audio_frame_rate(), + 0, 0 + ); + + swr_init (_swr_context); + } else { + _swr_context = 0; + } +} + +AudioDecoder::~AudioDecoder () +{ + if (_swr_context) { + swr_free (&_swr_context); + } } + +#if 0 void -AudioDecoder::set_audio_stream (shared_ptr s) +AudioDecoder::process_end () { - _audio_stream = s; + if (_swr_context) { + + shared_ptr out (new AudioBuffers (_film->audio_mapping().dcp_channels(), 256)); + + while (1) { + int const frames = swr_convert (_swr_context, (uint8_t **) out->data(), 256, 0, 0); + + if (frames < 0) { + throw EncodeError (_("could not run sample-rate converter")); + } + + if (frames == 0) { + break; + } + + out->set_frames (frames); + _writer->write (out); + } + + } } +#endif + +void +AudioDecoder::emit_audio (shared_ptr data, Time time) +{ + /* XXX: map audio to 5.1 */ + + /* Maybe sample-rate convert */ + if (_swr_context) { + + /* Compute the resampled frames count and add 32 for luck */ + int const max_resampled_frames = ceil ((int64_t) data->frames() * _output_audio_frame_rate / _audio_content->content_audio_frame_rate()) + 32; + + shared_ptr resampled (new AudioBuffers (MAX_AUDIO_CHANNELS, max_resampled_frames)); + + /* Resample audio */ + int const resampled_frames = swr_convert ( + _swr_context, (uint8_t **) resampled->data(), max_resampled_frames, (uint8_t const **) data->data(), data->frames() + ); + + if (resampled_frames < 0) { + throw EncodeError (_("could not run sample-rate converter")); + } + + resampled->set_frames (resampled_frames); + + /* And point our variables at the resampled audio */ + data = resampled; + } + + Audio (data, time); +} + + diff --git a/src/lib/audio_decoder.h b/src/lib/audio_decoder.h index cfe94b528..94845ec23 100644 --- a/src/lib/audio_decoder.h +++ b/src/lib/audio_decoder.h @@ -21,38 +21,32 @@ * @brief Parent class for audio decoders. */ -#ifndef DVDOMATIC_AUDIO_DECODER_H -#define DVDOMATIC_AUDIO_DECODER_H +#ifndef DCPOMATIC_AUDIO_DECODER_H +#define DCPOMATIC_AUDIO_DECODER_H #include "audio_source.h" -#include "stream.h" #include "decoder.h" +extern "C" { +#include +} + +class AudioContent; /** @class AudioDecoder. * @brief Parent class for audio decoders. */ -class AudioDecoder : public TimedAudioSource, public virtual Decoder +class AudioDecoder : public AudioSource, public virtual Decoder { public: - AudioDecoder (boost::shared_ptr, DecodeOptions); - - virtual void set_audio_stream (boost::shared_ptr); - - /** @return Audio stream that we are using */ - boost::shared_ptr audio_stream () const { - return _audio_stream; - } + AudioDecoder (boost::shared_ptr, boost::shared_ptr); + ~AudioDecoder (); - /** @return All available audio streams */ - std::vector > audio_streams () const { - return _audio_streams; - } + void emit_audio (boost::shared_ptr, Time); -protected: - /** Audio stream that we are using */ - boost::shared_ptr _audio_stream; - /** All available audio streams */ - std::vector > _audio_streams; +private: + boost::shared_ptr _audio_content; + SwrContext* _swr_context; + int _output_audio_frame_rate; }; #endif diff --git a/src/lib/audio_mapping.cc b/src/lib/audio_mapping.cc new file mode 100644 index 000000000..d0aa33657 --- /dev/null +++ b/src/lib/audio_mapping.cc @@ -0,0 +1,118 @@ +/* -*- c-basic-offset: 8; default-tab-width: 8; -*- */ + +/* + Copyright (C) 2013 Carl Hetherington + + This program is free software; you can redistribute it and/or modify + it under the terms of the GNU General Public License as published by + the Free Software Foundation; either version 2 of the License, or + (at your option) any later version. + + This program is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + GNU General Public License for more details. + + You should have received a copy of the GNU General Public License + along with this program; if not, write to the Free Software + Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. + +*/ + +#include +#include +#include +#include "audio_mapping.h" + +using std::list; +using std::cout; +using std::make_pair; +using std::pair; +using std::string; +using boost::shared_ptr; +using boost::lexical_cast; +using boost::dynamic_pointer_cast; + +AudioMapping::AudioMapping () +{ + +} + +/** Create a default AudioMapping for a given channel count. + * @param c Number of channels. + */ +AudioMapping::AudioMapping (int c) +{ + if (c == 1) { + /* Mono -> Centre */ + add (0, libdcp::CENTRE); + } else { + /* 1:1 mapping */ + for (int i = 0; i < c; ++i) { + add (i, static_cast (i)); + } + } +} + +AudioMapping::AudioMapping (shared_ptr node) +{ + list > const c = node->node_children ("Map"); + for (list >::const_iterator i = c.begin(); i != c.end(); ++i) { + add ((*i)->number_child ("ContentIndex"), static_cast ((*i)->number_child ("DCP"))); + } +} + +void +AudioMapping::add (int c, libdcp::Channel d) +{ + _content_to_dcp.push_back (make_pair (c, d)); +} + +list +AudioMapping::dcp_to_content (libdcp::Channel d) const +{ + list c; + for (list >::const_iterator i = _content_to_dcp.begin(); i != _content_to_dcp.end(); ++i) { + if (i->second == d) { + c.push_back (i->first); + } + } + + return c; +} + +list +AudioMapping::content_channels () const +{ + list c; + for (list >::const_iterator i = _content_to_dcp.begin(); i != _content_to_dcp.end(); ++i) { + if (find (c.begin(), c.end(), i->first) == c.end ()) { + c.push_back (i->first); + } + } + + return c; +} + +list +AudioMapping::content_to_dcp (int c) const +{ + list d; + for (list >::const_iterator i = _content_to_dcp.begin(); i != _content_to_dcp.end(); ++i) { + if (i->first == c) { + d.push_back (i->second); + } + } + + return d; +} + +void +AudioMapping::as_xml (xmlpp::Node* node) const +{ + for (list >::const_iterator i = _content_to_dcp.begin(); i != _content_to_dcp.end(); ++i) { + xmlpp::Node* t = node->add_child ("Map"); + t->add_child ("ContentIndex")->add_child_text (lexical_cast (i->first)); + t->add_child ("DCP")->add_child_text (lexical_cast (i->second)); + } +} diff --git a/src/lib/audio_mapping.h b/src/lib/audio_mapping.h new file mode 100644 index 000000000..7d76e4f5a --- /dev/null +++ b/src/lib/audio_mapping.h @@ -0,0 +1,60 @@ +/* -*- c-basic-offset: 8; default-tab-width: 8; -*- */ + +/* + Copyright (C) 2013 Carl Hetherington + + This program is free software; you can redistribute it and/or modify + it under the terms of the GNU General Public License as published by + the Free Software Foundation; either version 2 of the License, or + (at your option) any later version. + + This program is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + GNU General Public License for more details. + + You should have received a copy of the GNU General Public License + along with this program; if not, write to the Free Software + Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. + +*/ + +#ifndef DCPOMATIC_AUDIO_MAPPING_H +#define DCPOMATIC_AUDIO_MAPPING_H + +#include +#include +#include + +namespace xmlpp { + class Node; +} + +namespace cxml { + class Node; +} + +class AudioMapping +{ +public: + AudioMapping (); + AudioMapping (int); + AudioMapping (boost::shared_ptr); + + void as_xml (xmlpp::Node *) const; + + void add (int, libdcp::Channel); + + std::list dcp_to_content (libdcp::Channel) const; + std::list > content_to_dcp () const { + return _content_to_dcp; + } + + std::list content_channels () const; + std::list content_to_dcp (int) const; + +private: + std::list > _content_to_dcp; +}; + +#endif diff --git a/src/lib/audio_sink.h b/src/lib/audio_sink.h index 69b3a4b75..1aad5edf9 100644 --- a/src/lib/audio_sink.h +++ b/src/lib/audio_sink.h @@ -17,21 +17,16 @@ */ -#ifndef DVDOMATIC_AUDIO_SINK_H -#define DVDOMATIC_AUDIO_SINK_H +#ifndef DCPOMATIC_AUDIO_SINK_H +#define DCPOMATIC_AUDIO_SINK_H + +class AudioBuffers; class AudioSink { public: /** Call with some audio data */ - virtual void process_audio (boost::shared_ptr) = 0; -}; - -class TimedAudioSink -{ -public: - /** Call with some audio data */ - virtual void process_audio (boost::shared_ptr, double t) = 0; + virtual void process_audio (boost::shared_ptr, Time) = 0; }; #endif diff --git a/src/lib/audio_source.cc b/src/lib/audio_source.cc index d77e89367..e61721646 100644 --- a/src/lib/audio_source.cc +++ b/src/lib/audio_source.cc @@ -21,22 +21,22 @@ #include "audio_sink.h" using boost::shared_ptr; +using boost::weak_ptr; using boost::bind; -void -AudioSource::connect_audio (shared_ptr s) +static void +process_audio_proxy (weak_ptr sink, shared_ptr audio, Time time) { - Audio.connect (bind (&AudioSink::process_audio, s, _1)); + shared_ptr p = sink.lock (); + if (p) { + p->process_audio (audio, time); + } } void -TimedAudioSource::connect_audio (shared_ptr s) +AudioSource::connect_audio (shared_ptr s) { - Audio.connect (bind (&TimedAudioSink::process_audio, s, _1, _2)); + Audio.connect (bind (process_audio_proxy, weak_ptr (s), _1, _2)); } -void -TimedAudioSource::connect_audio (shared_ptr s) -{ - Audio.connect (bind (&AudioSink::process_audio, s, _1)); -} + diff --git a/src/lib/audio_source.h b/src/lib/audio_source.h index c13f1636b..ef47e969b 100644 --- a/src/lib/audio_source.h +++ b/src/lib/audio_source.h @@ -21,35 +21,23 @@ * @brief Parent class for classes which emit audio data. */ -#ifndef DVDOMATIC_AUDIO_SOURCE_H -#define DVDOMATIC_AUDIO_SOURCE_H +#ifndef DCPOMATIC_AUDIO_SOURCE_H +#define DCPOMATIC_AUDIO_SOURCE_H #include +#include "types.h" class AudioBuffers; class AudioSink; -class TimedAudioSink; /** A class that emits audio data */ class AudioSource { public: /** Emitted when some audio data is ready */ - boost::signals2::signal)> Audio; + boost::signals2::signal, Time)> Audio; void connect_audio (boost::shared_ptr); }; - -/** A class that emits audio data with timestamps */ -class TimedAudioSource -{ -public: - /** Emitted when some audio data is ready */ - boost::signals2::signal, double)> Audio; - - void connect_audio (boost::shared_ptr); - void connect_audio (boost::shared_ptr); -}; - #endif diff --git a/src/lib/combiner.cc b/src/lib/combiner.cc index 367cefa7f..0afb9807a 100644 --- a/src/lib/combiner.cc +++ b/src/lib/combiner.cc @@ -23,7 +23,7 @@ using boost::shared_ptr; Combiner::Combiner (shared_ptr log) - : TimedVideoProcessor (log) + : VideoProcessor (log) { } @@ -33,7 +33,7 @@ Combiner::Combiner (shared_ptr log) * @param image Frame image. */ void -Combiner::process_video (shared_ptr image, bool, shared_ptr, double) +Combiner::process_video (shared_ptr image, bool, shared_ptr, Time) { _image.reset (new SimpleImage (image)); } @@ -43,7 +43,7 @@ Combiner::process_video (shared_ptr image, bool, shared_ptr image, bool, shared_ptr sub, double t) +Combiner::process_video_b (shared_ptr image, bool, shared_ptr sub, Time t) { /* Copy the right half of this image into our _image */ /* XXX: this should probably be in the Image class */ diff --git a/src/lib/combiner.h b/src/lib/combiner.h index 7ed316e26..062297f0d 100644 --- a/src/lib/combiner.h +++ b/src/lib/combiner.h @@ -28,13 +28,13 @@ * one image used for the left half of the screen and the other for * the right. */ -class Combiner : public TimedVideoProcessor +class Combiner : public VideoProcessor { public: Combiner (boost::shared_ptr log); - void process_video (boost::shared_ptr i, bool, boost::shared_ptr s, double); - void process_video_b (boost::shared_ptr i, bool, boost::shared_ptr s, double); + void process_video (boost::shared_ptr i, bool, boost::shared_ptr s, Time); + void process_video_b (boost::shared_ptr i, bool, boost::shared_ptr s, Time); private: /** The image that we are currently working on */ diff --git a/src/lib/config.cc b/src/lib/config.cc index 8c65e371a..3beb0aea6 100644 --- a/src/lib/config.cc +++ b/src/lib/config.cc @@ -22,6 +22,7 @@ #include #include #include +#include #include "config.h" #include "server.h" #include "scaler.h" @@ -36,7 +37,10 @@ using std::vector; using std::ifstream; using std::string; using std::ofstream; +using std::list; using boost::shared_ptr; +using boost::lexical_cast; +using boost::optional; Config* Config::_instance = 0; @@ -47,6 +51,7 @@ Config::Config () , _reference_scaler (Scaler::from_id (N_("bicubic"))) , _tms_path (N_(".")) , _sound_processor (SoundProcessor::from_id (N_("dolby_cp750"))) + , _default_still_length (10) , _default_format (0) , _default_dcp_content_type (0) { @@ -56,8 +61,70 @@ Config::Config () _allowed_dcp_frame_rates.push_back (48); _allowed_dcp_frame_rates.push_back (50); _allowed_dcp_frame_rates.push_back (60); +} + +void +Config::read () +{ + if (!boost::filesystem::exists (file (false))) { + read_old_metadata (); + return; + } + + cxml::File f (file (false), "Config"); + optional c; + + _num_local_encoding_threads = f.number_child ("NumLocalEncodingThreads"); + _default_directory = f.string_child ("DefaultDirectory"); + _server_port = f.number_child ("ServerPort"); + c = f.optional_string_child ("ReferenceScaler"); + if (c) { + _reference_scaler = Scaler::from_id (c.get ()); + } + + list > filters = f.node_children ("ReferenceFilter"); + for (list >::iterator i = filters.begin(); i != filters.end(); ++i) { + _reference_filters.push_back (Filter::from_id ((*i)->content ())); + } - ifstream f (file().c_str ()); + list > servers = f.node_children ("Server"); + for (list >::iterator i = servers.begin(); i != servers.end(); ++i) { + _servers.push_back (new ServerDescription (*i)); + } + + _tms_ip = f.string_child ("TMSIP"); + _tms_path = f.string_child ("TMSPath"); + _tms_user = f.string_child ("TMSUser"); + _tms_password = f.string_child ("TMSPassword"); + + c = f.optional_string_child ("SoundProcessor"); + if (c) { + _sound_processor = SoundProcessor::from_id (c.get ()); + } + + _language = f.optional_string_child ("Language"); + + c = f.optional_string_child ("DefaultFormat"); + if (c) { + _default_format = Format::from_id (c.get ()); + } + + c = f.optional_string_child ("DefaultDCPContentType"); + if (c) { + _default_dcp_content_type = DCPContentType::from_dci_name (c.get ()); + } + + _dcp_metadata.issuer = f.optional_string_child ("DCPMetadataIssuer").get_value_or (""); + _dcp_metadata.creator = f.optional_string_child ("DCPMetadataCreator").get_value_or (""); + + _default_dci_metadata = DCIMetadata (f.node_child ("DCIMetadata")); + _default_still_length = f.optional_number_child("DefaultStillLength").get_value_or (10); +} + +void +Config::read_old_metadata () +{ + ifstream f (file(true).c_str ()); string line; while (getline (f, line)) { if (line.empty ()) { @@ -101,7 +168,7 @@ Config::Config () } else if (k == "language") { _language = v; } else if (k == "default_format") { - _default_format = Format::from_metadata (v); + _default_format = Format::from_id (v); } else if (k == "default_dcp_content_type") { _default_dcp_content_type = DCPContentType::from_dci_name (v); } else if (k == "dcp_metadata_issuer") { @@ -112,17 +179,21 @@ Config::Config () _dcp_metadata.issue_date = v; } - _default_dci_metadata.read (k, v); + _default_dci_metadata.read_old_metadata (k, v); } } /** @return Filename to write configuration to */ string -Config::file () const +Config::file (bool old) const { boost::filesystem::path p; p /= g_get_user_config_dir (); - p /= N_(".dvdomatic"); + if (old) { + p /= ".dvdomatic"; + } else { + p /= ".dcpomatic.xml"; + } return p.string (); } @@ -132,6 +203,13 @@ Config::instance () { if (_instance == 0) { _instance = new Config; + try { + _instance->read (); + } catch (...) { + /* configuration load failed; never mind, just + stick with the default. + */ + } } return _instance; @@ -141,44 +219,48 @@ Config::instance () void Config::write () const { - ofstream f (file().c_str ()); - f << "num_local_encoding_threads " << _num_local_encoding_threads << "\n" - << "default_directory " << _default_directory << "\n" - << "server_port " << _server_port << "\n"; + xmlpp::Document doc; + xmlpp::Element* root = doc.create_root_node ("Config"); + root->add_child("NumLocalEncodingThreads")->add_child_text (lexical_cast (_num_local_encoding_threads)); + root->add_child("DefaultDirectory")->add_child_text (_default_directory); + root->add_child("ServerPort")->add_child_text (lexical_cast (_server_port)); if (_reference_scaler) { - f << "reference_scaler " << _reference_scaler->id () << "\n"; + root->add_child("ReferenceScaler")->add_child_text (_reference_scaler->id ()); } for (vector::const_iterator i = _reference_filters.begin(); i != _reference_filters.end(); ++i) { - f << "reference_filter " << (*i)->id () << "\n"; + root->add_child("ReferenceFilter")->add_child_text ((*i)->id ()); } for (vector::const_iterator i = _servers.begin(); i != _servers.end(); ++i) { - f << "server " << (*i)->as_metadata () << "\n"; + (*i)->as_xml (root->add_child ("Server")); } - f << "tms_ip " << _tms_ip << "\n"; - f << "tms_path " << _tms_path << "\n"; - f << "tms_user " << _tms_user << "\n"; - f << "tms_password " << _tms_password << "\n"; + root->add_child("TMSIP")->add_child_text (_tms_ip); + root->add_child("TMSPath")->add_child_text (_tms_path); + root->add_child("TMSUser")->add_child_text (_tms_user); + root->add_child("TMSPassword")->add_child_text (_tms_password); if (_sound_processor) { - f << "sound_processor " << _sound_processor->id () << "\n"; + root->add_child("SoundProcessor")->add_child_text (_sound_processor->id ()); } if (_language) { - f << "language " << _language.get() << "\n"; + root->add_child("Language")->add_child_text (_language.get()); } if (_default_format) { - f << "default_format " << _default_format->as_metadata() << "\n"; + root->add_child("DefaultFormat")->add_child_text (_default_format->id ()); } if (_default_dcp_content_type) { - f << "default_dcp_content_type " << _default_dcp_content_type->dci_name() << "\n"; + root->add_child("DefaultDCPContentType")->add_child_text (_default_dcp_content_type->dci_name ()); } - f << "dcp_metadata_issuer " << _dcp_metadata.issuer << "\n"; - f << "dcp_metadata_creator " << _dcp_metadata.creator << "\n"; - f << "dcp_metadata_issue_date " << _dcp_metadata.issue_date << "\n"; + root->add_child("DCPMetadataIssuer")->add_child_text (_dcp_metadata.issuer); + root->add_child("DCPMetadataCreator")->add_child_text (_dcp_metadata.creator); + + _default_dci_metadata.as_xml (root->add_child ("DCIMetadata")); + + root->add_child("DefaultStillLength")->add_child_text (lexical_cast (_default_still_length)); - _default_dci_metadata.write (f); + doc.write_to_file_formatted (file (false)); } string diff --git a/src/lib/config.h b/src/lib/config.h index a59cdcae0..96aa4e449 100644 --- a/src/lib/config.h +++ b/src/lib/config.h @@ -21,8 +21,8 @@ * @brief Class holding configuration. */ -#ifndef DVDOMATIC_CONFIG_H -#define DVDOMATIC_CONFIG_H +#ifndef DCPOMATIC_CONFIG_H +#define DCPOMATIC_CONFIG_H #include #include @@ -110,6 +110,10 @@ public: return _language; } + int default_still_length () const { + return _default_still_length; + } + Format const * default_format () const { return _default_format; } @@ -185,6 +189,10 @@ public: _language = boost::none; } + void set_default_still_length (int s) { + _default_still_length = s; + } + void set_default_format (Format const * f) { _default_format = f; } @@ -204,7 +212,9 @@ public: private: Config (); - std::string file () const; + std::string file (bool) const; + void read (); + void read_old_metadata (); /** number of threads to use for J2K encoding on the local machine */ int _num_local_encoding_threads; @@ -233,6 +243,7 @@ private: /** Default DCI metadata for newly-created Films */ DCIMetadata _default_dci_metadata; boost::optional _language; + int _default_still_length; Format const * _default_format; DCPContentType const * _default_dcp_content_type; libdcp::XMLMetadata _dcp_metadata; diff --git a/src/lib/content.cc b/src/lib/content.cc new file mode 100644 index 000000000..578dafd67 --- /dev/null +++ b/src/lib/content.cc @@ -0,0 +1,76 @@ +/* -*- c-basic-offset: 8; default-tab-width: 8; -*- */ + +/* + Copyright (C) 2013 Carl Hetherington + + This program is free software; you can redistribute it and/or modify + it under the terms of the GNU General Public License as published by + the Free Software Foundation; either version 2 of the License, or + (at your option) any later version. + + This program is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + GNU General Public License for more details. + + You should have received a copy of the GNU General Public License + along with this program; if not, write to the Free Software + Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. + +*/ + +#include +#include +#include +#include "content.h" +#include "util.h" + +using std::string; +using boost::shared_ptr; +using boost::lexical_cast; + +Content::Content (boost::filesystem::path f) + : _file (f) + , _time (0) +{ + +} + +Content::Content (shared_ptr node) +{ + _file = node->string_child ("File"); + _digest = node->string_child ("Digest"); + _time = node->number_child