forked from gerbera/gerbera
-
Notifications
You must be signed in to change notification settings - Fork 0
/
README.old
3450 lines (2754 loc) · 113 KB
/
README.old
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
530
531
532
533
534
535
536
537
538
539
540
541
542
543
544
545
546
547
548
549
550
551
552
553
554
555
556
557
558
559
560
561
562
563
564
565
566
567
568
569
570
571
572
573
574
575
576
577
578
579
580
581
582
583
584
585
586
587
588
589
590
591
592
593
594
595
596
597
598
599
600
601
602
603
604
605
606
607
608
609
610
611
612
613
614
615
616
617
618
619
620
621
622
623
624
625
626
627
628
629
630
631
632
633
634
635
636
637
638
639
640
641
642
643
644
645
646
647
648
649
650
651
652
653
654
655
656
657
658
659
660
661
662
663
664
665
666
667
668
669
670
671
672
673
674
675
676
677
678
679
680
681
682
683
684
685
686
687
688
689
690
691
692
693
694
695
696
697
698
699
700
701
702
703
704
705
706
707
708
709
710
711
712
713
714
715
716
717
718
719
720
721
722
723
724
725
726
727
728
729
730
731
732
733
734
735
736
737
738
739
740
741
742
743
744
745
746
747
748
749
750
751
752
753
754
755
756
757
758
759
760
761
762
763
764
765
766
767
768
769
770
771
772
773
774
775
776
777
778
779
780
781
782
783
784
785
786
787
788
789
790
791
792
793
794
795
796
797
798
799
800
801
802
803
804
805
806
807
808
809
810
811
812
813
814
815
816
817
818
819
820
821
822
823
824
825
826
827
828
829
830
831
832
833
834
835
836
837
838
839
840
841
842
843
844
845
846
847
848
849
850
851
852
853
854
855
856
857
858
859
860
861
862
863
864
865
866
867
868
869
870
871
872
873
874
875
876
877
878
879
880
881
882
883
884
885
886
887
888
889
890
891
892
893
894
895
896
897
898
899
900
901
902
903
904
905
906
907
908
909
910
911
912
913
914
915
916
917
918
919
920
921
922
923
924
925
926
927
928
929
930
931
932
933
934
935
936
937
938
939
940
941
942
943
944
945
946
947
948
949
950
951
952
953
954
955
956
957
958
959
960
961
962
963
964
965
966
967
968
969
970
971
972
973
974
975
976
977
978
979
980
981
982
983
984
985
986
987
988
989
990
991
992
993
994
995
996
997
998
999
1000
MediaTomb - UPnP MediaServer
This documentation is valid for MediaTomb version 0.12.1.
Copyright © 2005 Gena Batsyan, Sergey Bostandzhyan
Copyright © 2006-2010, 2013 Gena Batsyan, Sergey Bostandzhyan,
Leonhard Wimmer
THIS SOFTWARE COMES WITH ABSOLUTELY NO WARRANTY! USE AT YOUR
OWN RISK!
__________________________________________________________
Table of Contents
1. Introduction
1.1. Currently Supported Features
2. Requirements
3. Compiling From Source
3.1. Standard Method
3.2. Configure Options
4. Initial Installation
4.1. Network Setup
4.2. First Time Launch
5. Command Line Options
5.1. IP Address
5.2. Interface
5.3. Port
5.4. Configuration File
5.5. Daemon Mode
5.6. Home Directory
5.7. Config Directory
5.8. Write PID File
5.9. Run Under Different User Name
5.10. Run Under Different Group
5.11. Add Content
5.12. Log To File
5.13. Debug Output
5.14. Compile Info
5.15. Version Information
5.16. Display Command Line Summary
6. Configuration File
6.1. Server Settings
6.2. Import Settings
6.3. Transcoding Settings
7. Supported Devices
7.1. MediaRenderers
7.2. Network Attached Storage Devices
8. Running The Server
9. Legal
9.1. Copyright
9.2. License
10. Acknowledgments
11. Contributions
1. Introduction
MediaTomb is an open source (GPL) UPnP MediaServer with a nice
web user interface, it allows you to stream your digital media
through your home network and listen to/watch it on a variety
of UPnP compatible devices.
MediaTomb implements the UPnP MediaServer V 1.0 specification
that can be found on http://www.upnp.org/. The current
implementation focuses on parts that are required by the
specification, however we look into extending the functionality
to cover the optional parts of the spec as well.
MediaTomb should work with any UPnP compliant MediaRenderer,
please tell us if you experience difficulties with particular
models, also take a look at the Supported Devices list for more
information.
WARNING!
The server has an integrated file system browser in the UI,
that means that anyone who has access to the UI can browse your
file system (with user permissions under which the server is
running) and also download your data! If you want maximum
security - disable the UI completely! Account authentication
offers simple protection that might hold back your kids, but it
is not secure enough for use in an untrusted environment!
Note:
since the server is meant to be used in a home LAN
environment the UI is enabled by default and accounts
are deactivated, thus allowing anyone on your network to
connect to the user interface.
1.1. Currently Supported Features
* browse and playback your media via UPnP
* metadata extraction from mp3, ogg, flac, jpeg, etc. files.
* Exif thumbnail support
* user defined server layout based on extracted metadata
(scriptable virtual containers)
* automatic directory rescans
* sophisticated web UI with a tree view of the database and
the file system, allowing to add/remove/edit/browse your
media
* highly flexible media format transcoding via plugins /
scripts
* allows to watch YouTube(tm) videos on your UPnP player
device
* supports last fm scrobbing using lastfmlib
* on the fly video thumbnail generation with
libffmpegthumbnailer
* support for external URLs (create links to internet content
and serve them via UPnP to your renderer)
* support for ContentDirectoryService container updates
* Active Items (experimental feature), allows execution of
server side scripts upon HTTP GET requests to certain items
* highly flexible configuration, allowing you to control the
behavior of various features of the server
* runs on Linux, FreeBSD, NetBSD, Mac OS X, eCS
* runs on x86, Alpha, ARM, MIPS, Sparc, PowerPC
2. Requirements
Note:
remember to install associated development packages,
because development headers are needed for compilation!
Note:
libupnp is now a part of MediaTomb and does not have to
be installed separately. We base our heavily patched
version on libupnp 1.4.1 from http://pupnp.sf.net/
Note:
you need at least one database in order to compile and
run MediaTomb - either sqlite or mysql.
In order to compile MediaTomb you will have to install the
following packages.:
* sqlite (version > 3.x) http://www.sqlite.org/ REQUIRED (if
mysql is not available)
* mysql client library (version > 4.0.x) http://mysql.org/
REQUIRED (if sqlite is not available)
* expat http://expat.sourceforge.net/ REQUIRED
Expat is a very good and robust XML parser, since most of
UPnP is based on XML this package is a requirement.
* zlib http://www.zlib.net/ OPTIONAL, HIGHLY RECOMMENDED
Zlib is a compression library that is available on most
systems, we need it for the database autocreation
functionality. Make sure to install the zlib development
package providing zlib.h, if it is not available you will
need to create the MediaTomb sqlite3/MySQL database
manually.
* libmagic OPTIONAL, RECOMMENDED
This is the 'file' package, it is used to determine the
mime type of the media. If you don't have this you will
have to enter file extension to mime type mappings manually
in your config file.
* js - SpiderMonkey JavaScript Engine
http://www.mozilla.org/js/spidermonkey/ OPTIONAL,
RECOMMENDED, REQUIRED FOR PLAYLIST SUPPORT
This package is necessary to allow the user defined
creation of virtual containers. The import.js script
defines the layout of your media, the default import script
will create a structure sorted by Audio/Photo/Video, it
will make use of the gathered metadata (like ID3 tags) to
sort your music by Artist/Album/Genre/Year , etc. The
import script can be adjusted and modified - it allows you
to create the layout that you want.
* taglib http://developer.kde.org/~wheeler/taglib.html
OPTIONAL, RECOMMENDED
This library retrieves metadata from mp3, ogg and flac
files. You will need it if you want to have virtual objects
for those files (i.e. nice content layout).
Note:
It makes no sense to use taglib and id3lib at the
same time, the configure script will first look
for TagLib, if TagLib detection fails it will
search for id3lib. You can also force the
configure script to take the library of your
choice, overriding the default setting.
* id3lib http://id3lib.sourceforge.net/ (at least version
3.8.3) OPTIONAL, RECOMMENDED (if TagLib is not available)
This library retrieves id3 tags from mp3 files.
* libexif http://libexif.sourceforge.net/ OPTIONAL,
RECOMMENDED
You will need this library if you want to extract metadata
from images, this will allow you to have virtual containers
for your Photos, sorted by various attributes like Date,
etc. It also enables thumbnail support: if EXIF thumbnails
are present in your images they will also be offered via
UPnP.
* curl http://curl.haxx.se/ OPTIONAL, REQUIRED FOR YOUTUBE
AND SOPCAST SUPPORT
curl is a library that allows to easily fetch content from
the web, if you want to compile MediaTomb with YouTube
and/or SopCast support then curl is required.
* ffmpeg http://ffmpeg.mplayerhq.hu/ OPTIONAL
Currently ffmpeg is used to gather additional metadata from
audio and video files.
* libffmpegthumbnailer
http://code.google.com/p/ffmpegthumbnailer/ OPTIONAL
ffmpegthumbnailer is used to generate video thumbnails on
the fly. If your device (like DSM-510 or PlayStation 3)
supports video thumbnails it would be worth to compile
MediaTomb with this library.
Note:
ffmpegthumbnailer support is only provided if
MediaTomb is compiled with ffmpeg support.
* lastfmlib http://code.google.com/p/lastfmlib/ OPTIONAL
last.fm scrobbing
In order to use the web UI you will need to have javascript
enabled in your web browser.
The UI has been tested and works with the recent versions of :
* Firefox/Mozilla
* Opera
Tested and does not work with the recent versions of:
* Konqueror
* Safari
Limited functionality with:
* Internet Explorer 6 and 7
3. Compiling From Source
3.1. Standard Method
If you don't care about the details - make sure you have
installed the required packages and the appropriate development
headers and simply run
$ ./configure
$ make
$ make install
This should compile and install MediaTomb, the resulting binary
is ready to run.
Note:
if you checked out the sources from SVN the configure
script will not be available, you will have to create it
with the following command:
autoreconf -i
3.2. Configure Options
The MediaTomb configure script provides a large variety of
options, allowing you to specify the additional libraries that
will be used, features that will be compiled or disabled,
workarounds for known bugs in some distributions and so on.
Some options are straightforward, some require deeper knowledge
- make sure you know what you are doing :)
3.2.1. Install Location Of Architecture Independent Files
--prefix=PREFIX
Default:
/usr/local/
Install all architecture independent files - all .js files and
.png images for the Web UI, the import.js script, the service
description XML files - in the directory of your choice. This
is especially useful if you do not want to perform a
system-wide installation, but want to install MediaTomb only
for your user.
Important:
the prefix path will be compiled into the binary; the
binary will still be relocatable, but you move those
files you will have to point MediaTomb to the proper
location by specifying it in the server configuration
file.
3.2.2. Static Build
--enable-static
Default:
disabled
Build a static binary. This may be useful if you plan to
install a precompiled MediaTomb binary on a system that does
not have all the required libraries and where installation of
those libraries is not possible due to reasons beyond your
control.
Note:
if you enable this option, make sure that you have all
static versions of the appropriate libraries installed
on your system. The configure script may not detect that
those are missing - in this case you will get linker
errors. Some distributions, for example Fedora Core, do
not ship static library versions.
3.2.3. Automatically Create Database
--enable-db-autocreate
Default:
enabled
Automatically create the database if it is missing (for example
upon a first time launch). Disabling this will make the
resulting binary a little smaller, however you will have to
take care of the database creation yourself by invoking the
appropriate .sql scripts that are provided with the package.
Note:
the server configuration file has to be setup correctly.
Either sqlite or MySQL has to be chosen in the storage
section, for sqlite the database file has to point to a
writable location, for MySQL the user has to be setup
with a valid password and permissions and the database
“mediatomb” has to exist.
3.2.4. Debug Malloc/Realloc Of Zero bytes
--enable-debug-malloc0
Default:
disabled
This feature is only for debugging purposes, whenever a malloc
or realloc with a value of zero bytes is encountered, the
server will terminate with abort()
3.2.5. Force Linking With The Pthread Library
--enable-pthread-lib
Default:
disabled
We use the ACX_PTHREAD macro from the autoconf archive to
determine the way how to link against the pthread library.
Usually it works fine, but it can fail when cross compiling.
This configure option tells us to use -lpthread when linking,
it seems to be needed when building MediaTomb under Optware.
Note, that using --disable-pthread-lib will not prevent
automatic checks against the pthread library.
3.2.6. Force Linking With The Iconv Library
--enable-iconv-lib
Default:
disabled
By default we will attempt to use iconv functionality provided
with glibc, however under some circumstances it may make sense
to link against a separate iconv library. This option will
attempt to do that. Note, that using --disable-iconv-lib will
not prevent automatic attempts to link ageinst the iconv
library in the case where builtin glibc iconv functionality is
not available.
3.2.7. Use Atomic Assembler Code For x86 Single CPU systems
--enable-atomic-x86-single
Default:
disabled
Use assembler code suited for single CPU x86 machines. This may
improve performance, but your binary will not function properly
on SMP systems. If you specify this for a non x86 architecture
the binary will not run at all. If you wonder about the purpose
of assembler code in a mediaserver application: we need it for
atomic operations that are required for reference counting. The
pthread library will be used as a fallback for other
architectures, but can also be forced by a designated configure
option. This however, will have the worst performance.
By default x86 SMP code will be used on x86 systems - it will
reliably work on both SMP and single CPU systems, but will not
be as fast as the atomic-x86-single option on uniprocessor
machines.
3.2.8. Use Pthread Code For Atomic Operations
--enable-atomic-pthread
Default:
auto detect
This is the default setting for non x86 architectures, we may
add assembler optimizations for other architectures as well,
but currently only x86 optimizations are available. This option
may also be safely used on x86 machines - the drawback is poor
performance, compared to assembler optimized code.
3.2.9. Enable SIGHUP Handling
--enable-sighup
This option turns on SIGHUP handling, every time a SIGHUP is
caught we will attempt to restart the server and reread the
configuration file. By default this feature is enabled for x86
platforms, but is disabled for others. We discovered that
MediaTomb will not cleanly restart on ARM based systems,
investigations revealed that this is somehow related to an
unclean libupnp shutdown. This will be fixed in a later
release.
Default:
auto detect
3.2.10. X_MS_MediaReceiverRegistrar Support
--enable-mrreg-service
Default:
disabled
This option will enable the compilation and support of the
X_MS_MediaReceiverRegistrar UPnP service, this was implemented
for future Xbox 360 support. If you have a renderer that
requires this service, you can safely enable it. It will always
return true to IsValidated and IsAuthorized requests.
Note:
eventhough this service is implemented there is still no
Xbox 360 support in MediaTomb, more work needs to be
done.
3.2.11. Playstation 3 Support
--enable-protocolinfo-extension
Default:
enabled
This option allows to send additional information in the
protocolInfo attribute, this will enable MP3 and MPEG4 playback
for the Playstation 3, but may also be useful to some other
renderers.
Note:
allthough compiled in, this feature is disabled in
configuration by default.
3.2.12. Fseeko Check
--disable-fseeko-check
Default:
enabled
This is a workaround for a bug in some Debian distributions,
disable this check if you know that your system has large file
support, but configure fails to detect it.
3.2.13. Largefile Support
--disable-largefile
Default:
auto
By default largefile support will be auto detected by
configure, however you can disable it if you do not want it or
if you experience problems with it on your system.
3.2.14. Redefinition Of Malloc And Realloc
--disable-rpl-malloc
Default:
enabled
Autoconf may redefine malloc and realloc functions to
rpl_malloc and rpl_realloc, usually this will happen if the
autotools think that you are compiling against a non GNU C
library. Since malloc and realloc may behave different on other
systems, this gives us the opportunity to write wrapper
functions to handle special cases. However, this redefinition
may get triggered when cross compiling, even if you are
compiling against the GNU C lib. If this is the case, you can
use this option to disable the redefinition.
3.2.15. SQLite Support
--enable-sqlite3
Default:
enabled
The SQLite database is very easy in installation and use, you
do not have to setup any users, permissions, etc. A database
file will be simply created as specified in the MediaTomb
configuration. At least SQLite version 3 is required.
3.2.16. MySQL Support
--enable-mysql
Default:
enabled
MySQL is a very powerful database, however it requires some
additional setup. You will find information on how to setup
MediaTomb with MySQL in the Installation section.
3.2.17. SpiderMonkey LibJS Support
--enable-libjs
Default:
enabled
SpiderMonkey is Mozilla's JavaScript engine, it plays a very
important role in MediaTomb. We use it to create a nice virtual
container layout based on the metadata that is extracted from
your media. We also allow the user to create custom import
scripts, so everyone has the possibility to adapt the layout to
ones personal needs. Read more about this in the installation
section.
The main problem with this library is, that it is called
differently on various distributions and that it is installed
in different locations. For example, it is called js on Fedora,
but is available under the name of smjs on Debian. If configure
fails to find your js headers and libraries you can point it to
the desired locations (see options below).
3.2.18. Filemagic Support
--enable-libmagic
Default:
enabled
This library determines the file type and provides us with the
appropriate mime type information. It is very important to
correctly determine the mime type of your media - this
information will be sent to your renderer. Based on the mime
type information, the renderer will decide if it can
play/display the particular file or not. If auto detection
returns strange mime types, you may want to do a check using
the 'file' command (the 'file' package must be installed on
your system). Assuming that you want to check somefile.avi
enter the following in your terminal:
$ file -i somefile.avi
This will print the detected mime type, this is exactly the
information that we use in MediaTomb. You can override auto
detection by defining appropriate file extension to mime type
mappings in your configuration file. You can also edit the mime
type information of an imported object manually via the web UI.
3.2.19. Id3lib Support
--enable-id3lib
Default:
disabled, used if taglib is not available
This library will parse id3 tags of your MP3 files, the
gathered information will be saved in the database and provided
via UPnP. Further, the gathered metadata will be used by the
import script to create a nice container layout
(Audio/Artist/Album, etc.)
3.2.20. Taglib Support
--enable-taglib
Default:
enabled, preffered over id3lib
This library will parse id3 tags of your MP3 files as well as
information provided with flac files. It claims to be faster
than id3lib, but it also seems to have some drawbacks. We had
some cases where it crashed when trying to parse tags of
certain MP3 files on embedded systems, we had reports and
observed that it had problems parsing the sample rates. We also
did some valgrinding and detected memory leaks. Our feeling is,
that you will have more stable results with id3lib, however it
is up to you to enable or disable this library. By default
id3lib will be taken if both libraries are present on the
system.
3.2.21. Libexif Support
--enable-libexif
Default:
enabled
The exif library will gather metadata from your photos, it will
also find exif thumbnails which are created automatically by
most digital camera models. The gathered data will be used by
the import script, the thumbnails will be offered as additional
resources via UPnP.
3.2.22. Inotify Support
--enable-inotify
Default:
auto
Inotify is a kernel mechanism that allows monitoring of
filesystem events. You need this if you want to use the Inotify
Autoscan mode, contrary to the Timed mode which recsans given
directories in specified intervals, Inotify mode will
immedeately propagate changes in monitored directories on the
filesystem to the database.
If you do not specify this option configure will check if
inotify works on the build system and compile it in only if the
check succeeds. If you specify this option, the functionality
will be compiled in even if the build system does not support
inotify - the availability of inotify will then be checked at
server runtime.
3.2.23. YouTube Service Support
--enable-youtube
Default:
enabled
This option enabled support of the YouTube service, it allows
to gather information about content on the YouTube site and
offers the content via UPnP, thus enabling you to watch your
favorite YouTube videos on your UPnP player device. The feature
only makes sense in combination with transcoding, since most
devices do not support playback of flv files natively.
3.2.24. External Transcoding
--enable-external-transcoding
Default:
enabled
3.2.25. Sqlite Backup Defaults
--enable-sqlite-backup-defaults
Default:
disabled
Enables backup option for sqlite as the default setting, might
be useful for NAS builds.
3.2.26. Curl
--enable-curl
Default:
enabled if external transcoding or YouTube features are
turned on
It only makes sense to enable the curl library if YouTube and
External Transcoding are turned on. YouTube requires curl, but
it's optional for External Transcoding.
3.2.27. Ffmpeg Support
--enable-ffmpeg
Default:
enabled
Currently the ffmpeg library is used to extract additional
information from audio and video files. It is also capable of
reading out the tag information from theora content. It is not
yet used for transcoding, so this feature only gathers
additional metadata.
3.2.28. Ffmpeg Thumbnailer Support
--enable-ffmpegthumbnailer
Default:
enabled
Compiling with ffmpegthumbnailer support is only possible if
you also compile with ffmpeg support. The library allows to
generate thumbnails for the videos on the fly.
3.2.29. MediaTomb Debug Output
--enable-tombdebug
Default:
disabled
This option enables debug output, the server will print out a
lot of information which is mainly interesting to developers.
Use this if you are trying to trace down a bug or a problem,
the additional output may give you some clues.
3.2.30. UPnP Library Debug Output
--enable-upnpdebug
Default:
disabled
This option enables debug output of the UPnP SDK. You should
not need it under normal circumstances.
3.2.31. Log Output
--disable-log
Default:
enabled
This option allows you to suppress all log output from the
server.
3.2.32. Debug Log Output
Default:
enabled
This option allows you to compile the server with debug
messages. If enabled, switching between verbose and normal
output during runtime becomes possible.
3.2.33. Package Search Directory
--with-search=DIR
Default:
/opt/local/ on Darwin, /usr/local/ on all other systems
Some systems may have whole sets of packages installed in an
alternative location, for example Darwinports on OSX get
installed to /opt/local/. This option tells the configure
script to additionally search for headers and libraries of
various packages in DIR/include and DIR/lib.
3.2.34. Specifying Header And Library Locations Of Various Packages
You can specify the exact location of particular headers and
libraries. Some packages use extra programs that tell us the
appropriate flags that are needed for compilation - like
mysql_config. You can also specify the exact location of those
programs. The parameters are self explanatory, in case of
headers and libraries the DIR parameter is the directory where
those headers and libraries are located.
--with-sqlite3-h=DIR search for sqlite3 headers only in DI
R
--with-sqlite3-libs=DIR search for sqlite3 libraries only in
DIR
--with-mysql-cfg=mysql_config absolute path/name of mysql_config
--with-js-h=DIR search for js (spidermonkey) headers
in DIR
--with-js-libs=DIR search for js (spidermonkey) librarie
s in DIR
--with-libmagic-h=DIR search for filemagic headers in DIR
--with-libmagic-libs=DIR search for filemagic headers in DIR
--with-libexif-h=DIR search for libexif headers in DIR
--with-libexif-libs=DIR search for libexif libraries in DIR
--with-expat-h=DIR search for expat headers in DIR
--with-expat-libs=DIR search for expat libraries in DIR
--with-taglib-cfg=taglib-config absolute path/name of taglib-config
--with-id3lib-h=DIR search for id3lib headers in DIR
--with-id3lib-libs=DIR search for id3lib libraries in DIR
--with-zlib-h=DIR search for zlib headers in DIR
--with-zlib-libs=DIR search for zlib libraries in DIR
--with-inotify-h=DIR search for inotify header in DIR
--with-iconv-h=DIR search for iconv headers in DIR/sys
--with-iconv-libs=DIR search for iconv libraries in DIR
--with-avformat-h=DIR search for avformat headers in DIR
--with-avformat-libs=DIR search for avformat libraries in DIR
--with-avutil-libs=DIR search for avutil libraries in DIR
--with-ffmpegthumbnailer-h=DIR search for ffmpegthumbnailer headers
in DIR
--with-ffmpegthumbnailer-libs=DIR search for ffmpegthumbnailer librarie
s in DIR
--with-curl-cfg=curl-config absolute path/name of curl-config scr
ipt
--with-libmp4v2-h=DIR search for libmp4v2 headers in DIR
--with-libmp4v2-libs=DIR search for libmp4v2 libraries in DIR
--with-rt-libs=DIR search for rt libraries in DIR
--with-pthread-libs=DIR search for pthread libraries in DIR
--with-lastfmlib-h=DIR search for lastfmlib headers in DIR
--with-lastfmlib-libs=DIR search for lastfmlib libraries in DIR
3.2.35. The devconf Script
If you are doing some development work and some debugging, you
will probably want to compile with the -g flag and also disable
optimization. The devconf script does exactly that. In
addition, it accepts command line parameters that are passed to
the configure script.
4. Initial Installation
4.1. Network Setup
Some systems require a special setup on the network interface.
If MediaTomb exits with UPnP Error -117, or if it does not
respond to M-SEARCH requests from the renderer (i.e. MediaTomb
is running, but your renderer device does not show it) you
should try the following settings (the lines below assume that
MediaTomb is running on a Linux machine, on network interface
eth1):
# route add -net 239.0.0.0 netmask 255.0.0.0 eth1
# ifconfig eth1 allmulti
Those settings will be applied automatically by the init.d
startup script.
You should also make sure that your firewall is not blocking
port UDP port 1900 (required for SSDP) and UDP/TCP port of
MediaTomb. By default MediaTomb will select a free port
starting with 49152, however you can specify a port of your
choice in the configuration file.
4.2. First Time Launch
When starting MediaTomb for the first time, a .mediatomb
directory will be created in your home. Further, a default
server configuration file, called config.xml will be generated
in that directory.
4.2.1. Using Sqlite Database
If you are using sqlite - you are ready to go, the database
file will be created automatically and will be located
~/.mediatomb/mediatomb.db If needed you can adjust the database
file name and location in the server configuration file.
4.2.2. Using MySQL Database
If MediaTomb was compiled with support for both databases,
sqlite will be chosen as default because the initial database
can be created and used without any user interaction. If
MediaTomb was compiled only with MySQL support, the appropriate
config.xml file will be created in the ~/.mediatomb directory,
but the server will then terminate, because user interaction is
required.
MediaTomb has to be able to connect to the MySQL server and at
least the (empty) database has to exist. To create the database
and provide MediaTomb with the ability to connect to the MySQL
server you need to have the appropriate permissions. Note that
user names and passwords in MySQL have nothing to do with UNIX
accounts, MySQL has it's own user names/passwords. Connect to
the MySQL database as “root” or any other user with the
appropriate permissions:
$ mysql [-u <username>] [-p]
(You'll probably need to use “-u” to specify a different MySQL
user and “-p” to specify a password.)
Create a new database for MediaTomb: (substitute “<database
name>” with the name of the database)
mysql> CREATE DATABASE <database name>;
(You can also use “mysqladmin” instead.)
Give MediaTomb the permissions to access the database:
mysql> GRANT ALL ON <database name>.*
TO '<user name>'@'<hostname>'
IDENTIFIED BY '<password>';
If you don't want to set a password, omit “IDENTIFIED BY ..”
completely. You could also use the MySQL “root” user with
MediaTomb directly, but this is not recommended.
To create a database and a user named “mediatomb” (who is only
able to connect via “localhost”) without a password (the
defaults) use:
mysql> CREATE DATABASE mediatomb;
mysql> GRANT ALL ON mediatomb.* TO 'mediatomb'@'localhost';
If MediaTomb was compiled with database auto creation the
tables will be created automatically during the first startup.
All table names have a “mt_” prefix, so you can theoretically
share the database with a different application. However, this
is not recommended.
If database auto creation wasn't compiled in (configure was run
with the “--disable-db-autocreate” or zlib.h was not available)
you have to create the tables manually:
$ mysql [-u <username>] [-p] \
<database name> < \
<install prefix>/share/mediatomb/mysql.sql
After creating the database and making the appropriate changes
in your MediaTomb config file you are ready to go - launch the
server, and everything should work.
5. Command Line Options
There is a number of options that can be passed via command
line upon server start up, for a short summary you can invoke
MediaTomb with the following parameter:
$ mediatomb --help
Note:
the command line options override settings in the
configuration file!
5.1. IP Address
--ip or -i
The server will bind to the given IP address, currently we can
not bind to multiple interfaces so binding to 0.0.0.0 will not
be possible.
5.2. Interface
--interface or -e
Interface to bind to, for example eth0, this can be specified
instead of the ip address.
5.3. Port
--port or -p
Specify the server port that will be used for the web user
interface, for serving media and for UPnP requests, minimum
allowed value is 49152. If this option is omitted a default
port will be chosen, however, in this case it is possible that
the port will change upon server restart.
5.4. Configuration File
--config or -c
By default MediaTomb will search for a file named “config.xml”
in the ~/.mediatomb directory. This option allows you to
specify a config file by the name and location of your choice.
The file name must be absolute.
5.5. Daemon Mode
--daemon or -d
Run the server in background, MediaTomb will shutdown on
SIGTERM, SIGINT and restart on SIGHUP.
5.6. Home Directory
--home or -m
Specify an alternative home directory. By default MediaTomb
will try to retrieve the users home directory from the
environment, then it will look for a .mediatomb directory in
users home. If .mediatomb was found we will try to find the
default configuration file (config.xml), if not found we will
create both, the .mediatomb directory and the default config
file.
This option is useful in two cases: when the home directory can
not be retrieved from the environment (in this case you could
also use -c to point MediaTomb to your configuration file or
when you want to create a new configuration in a non standard
location (for example, when setting up daemon mode). In the
latter case you can combine this parameter with the parameter
described in Section 5.7, “Config Directory”
5.7. Config Directory
--cfgdir or -f
The default configuration directory is combined out of the
users home and the default that equals to .mediatomb, this
option allows you to override the default directory naming.
This is useful when you want to setup the server in a
nonstandard location, but want that the default configuration
to be written by the server.
5.8. Write PID File
--pidfile or -P
Specify a file that will hold the server process ID, the
filename must be absolute.
5.9. Run Under Different User Name