We truncated the diff of some files because they were too big.
If you want to see the full diff for every file, click here.
Changes of Revision 9
tovid.changes
Changed
x
1
2
-------------------------------------------------------------------
3
+Fri May 24 13:24:31 UTC 2019 - Luigi Baldoni <aloisio@gmx.com>
4
+
5
+- Update to version 0.35.2
6
+ * Fixed set_chapters not having exec bit set
7
+ * Fixed grep for libav filters
8
+ * Some python3 fixes
9
+ * Fixed scope problem that only showed up on freebsd for some
10
+ reason.
11
+ * Fixed imagemagick spumux buttons for IM-6.9.1-x.
12
+ * Make ffmpeg the default encoder when both ffmpeg and avconv
13
+ are present.
14
+
15
+-------------------------------------------------------------------
16
Mon Apr 6 19:29:20 UTC 2015 - aloisio@gmx.com
17
18
- Version 0.35.0
19
tovid.spec
Changed
97
1
2
-# vim: set ts=4 sw=4 et:
3
#
4
-# Copyright (c) 2015 Luigi Baldoni <aloisio@gmx.com>
5
+# spec file for package tovid
6
+#
7
+# Copyright (c) 2015-2019 Luigi Baldoni <aloisio@gmx.com>
8
# Copyright (c) 2005-2010 oc2pus
9
#
10
# All modifications and additions to the file contributed by third parties
11
12
# license that conforms to the Open Source Definition (Version 1.9)
13
# published by the Open Source Initiative.
14
15
-# Please submit bugfixes or comments to packman@links2linux.de
16
+# Please submit bugfixes or comments via https://bugs.links2linux.org/
17
+#
18
19
20
-%{!?python_sitelib: %global python_sitelib %(python -c "from distutils.sysconfig import get_python_lib; print(get_python_lib())")}
21
-%{!?python_sitearch: %global python_sitearch %(python -c "from distutils.sysconfig import get_python_lib; print(get_python_lib(1))")}
22
Name: tovid
23
-Version: 0.35.0
24
+Version: 0.35.2
25
Release: 0
26
Summary: Video conversion and DVD authoring tools
27
-License: GPL-2.0+
28
+License: GPL-2.0-or-later
29
Group: Productivity/Multimedia/Video/Editors and Convertors
30
-Url: http://tovid.wikia.com/wiki/Tovid_Wiki
31
-Source: https://github.com/tovid-suite/tovid/releases/download/v0.35.0/tovid-%{version}.tar.gz
32
+URL: http://tovid.wikia.com/wiki/Tovid_Wiki
33
+Source: https://github.com/tovid-suite/tovid/releases/download/%{version}/tovid-%{version}.tar.gz
34
BuildRequires: hicolor-icon-theme
35
BuildRequires: python-devel
36
BuildRequires: python-setuptools
37
BuildRequires: txt2tags
38
BuildRequires: update-desktop-files
39
+Requires: /usr/bin/mkisofs
40
Requires: ImageMagick >= 6.0
41
Requires: MPlayer
42
Requires: bc
43
44
Requires: ffmpeg
45
Requires: lsdvd
46
Requires: mjpegtools
47
-Requires: /usr/bin/mkisofs
48
Requires: normalize
49
Requires: python-base >= %{py_ver}
50
Requires: python-tk
51
52
Requires: tk
53
Recommends: libdvdcss2
54
Recommends: transcode
55
-BuildRoot: %{_tmppath}/%{name}-%{version}-build
56
-%py_requires
57
-%if 0%{?suse_version} > 1110
58
BuildArch: noarch
59
-%endif
60
61
%description
62
tovid is a suite of utilities designed to make DVD
63
64
65
%prep
66
%setup -q
67
+# fix shebang
68
+sed -i 's|^#!.*|#!%{_bindir}/bash|' \
69
+ src/idvid src/makedvd src/makempg \
70
+ src/todisc src/todisc-fade-routine \
71
+ src/tovid-init.in
72
+sed -i 's|^#!.*|#!%{_bindir}/python|' \
73
+ src/set_chapters src/titleset-wizard \
74
+ src/todiscgui src/tovid-stats
75
76
%build
77
python setup.py build
78
79
done
80
81
%files
82
-%defattr(-,root,root)
83
-%doc AUTHORS ChangeLog COPYING README
84
+%license COPYING
85
+%doc AUTHORS ChangeLog README
86
%{_bindir}/tovid
87
%{python_sitelib}/libtovid
88
%{python_sitelib}/tovid-%{version}*
89
90
%{_datadir}/icons/*/*/apps/tovid.png
91
%{_datadir}/icons/*/*/apps/titleset-wizard.png
92
%{_datadir}/icons/*/scalable/apps/*.svg
93
-%doc %{_mandir}/man1/tovid.1%{ext_man}
94
+%{_mandir}/man1/tovid.1%{?ext_man}
95
96
%changelog
97
tovid-0.35.0.tar.gz/docs/src/en/tovid.html
Deleted
201
1
2
-<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN">
3
-<HTML>
4
-<HEAD>
5
-<META NAME="generator" CONTENT="http://txt2tags.org">
6
-<TITLE>tovid manual</TITLE>
7
-</HEAD><BODY BGCOLOR="white" TEXT="black">
8
-<CENTER>
9
-<H1>tovid manual</H1>
10
-</CENTER>
11
-
12
-<P></P>
13
-<HR NOSHADE SIZE=1>
14
-<P></P>
15
-
16
- <UL>
17
- <LI><A HREF="#toc1">Name</A>
18
- <LI><A HREF="#toc2">Description</A>
19
- <LI><A HREF="#toc3">Usage</A>
20
- <LI><A HREF="#toc4">Configuration</A>
21
- <LI><A HREF="#toc5">Command:gui</A>
22
- <LI><A HREF="#toc6">Usage</A>
23
- <LI><A HREF="#toc7">Command:titlesets</A>
24
- <LI><A HREF="#toc8">Command:disc</A>
25
- <UL>
26
- <LI><A HREF="#toc9">Usage</A>
27
- <LI><A HREF="#toc10">General Options</A>
28
- <LI><A HREF="#toc11">Menu style</A>
29
- <LI><A HREF="#toc12">Thumbnail style</A>
30
- <LI><A HREF="#toc13">Slideshows</A>
31
- <LI><A HREF="#toc14">Burning the disc</A>
32
- <LI><A HREF="#toc15">Advanced usage</A>
33
- <LI><A HREF="#toc16">Menu Style</A>
34
- <LI><A HREF="#toc17">Thumbnail Style</A>
35
- <LI><A HREF="#toc18">Dvdauthor options</A>
36
- <LI><A HREF="#toc19">Usage notes</A>
37
- </UL>
38
- <LI><A HREF="#toc20">Command:mpg</A>
39
- <UL>
40
- <LI><A HREF="#toc21">Usage</A>
41
- <LI><A HREF="#toc22">Basic options</A>
42
- <LI><A HREF="#toc23">Advanced options</A>
43
- </UL>
44
- <LI><A HREF="#toc24">Command:id</A>
45
- <UL>
46
- <LI><A HREF="#toc25">Usage</A>
47
- <LI><A HREF="#toc26">Options</A>
48
- <LI><A HREF="#toc27">Examples</A>
49
- </UL>
50
- <LI><A HREF="#toc28">Command:dvd</A>
51
- <UL>
52
- <LI><A HREF="#toc29">Usage</A>
53
- <LI><A HREF="#toc30">Options</A>
54
- </UL>
55
- <LI><A HREF="#toc31">Command:chapters</A>
56
- <UL>
57
- <LI><A HREF="#toc32">Examples</A>
58
- </UL>
59
- <LI><A HREF="#toc33">CONTACT</A>
60
- </UL>
61
-
62
-<P></P>
63
-<HR NOSHADE SIZE=1>
64
-<P></P>
65
-
66
-<A NAME="toc1"></A>
67
-<H1>Name</H1>
68
-
69
-<P>
70
-tovid: Make DVDs from video files
71
-</P>
72
-
73
-<A NAME="toc2"></A>
74
-<H1>Description</H1>
75
-
76
-<P>
77
-<B>tovid</B> is a command-line tool for creating DVDs. It can encode your video
78
-files to DVD-compliant MPEG format, generate simple or complex DVD menus,
79
-author and burn a ready-to-watch DVD, with just a few shell commands. A
80
-graphical interface is also provided to make the process even easier.
81
-</P>
82
-<P>
83
-<B>NOTE</B>: As of tovid 0.35, the legacy scripts <B>makemenu</B> and <B>makexml</B>
84
-have been removed and no longer appear in this manpage.
85
-All of their functions and more can be done with the 'tovid disc' command,
86
-(todisc script). See <B>Command:disc</B> and the <A HREF="http://tovid.wikia.com">wiki</A>
87
-for more info.
88
-</P>
89
-<P>
90
-Also note that as of tovid 0.32, this is the only manual page provided by tovid.
91
-There is now a single executable frontend to all functionality in the suite, so
92
-if you were expecting to find manpages for <B>todisc</B>, <B>idvid</B>, <B>makempg</B>
93
-and their kin, they can all be found in the <B>tovid</B> manpage you are reading now.
94
-And yes, this makes for a pretty large manual page. If you are viewing this
95
-manpage from the command-line <B>man</B> utility, which normally pages through the
96
-<B>less</B> utility, you can skip to a section by searching with the <B>/</B> key,
97
-followed by a <B>^</B> to match the given section name. For example, to skip to
98
-the <B>mpg</B> command, type <B>/^Command:mpg</B>. See <B>man less</B> for more on how
99
-to navigate.
100
-</P>
101
-
102
-<A NAME="toc3"></A>
103
-<H1>Usage</H1>
104
-
105
-<P>
106
-<B>tovid</B> <I>COMMAND</I> [<I>OPTIONS</I>]
107
-</P>
108
-<P>
109
-Where <I>COMMAND</I> is one of the following:
110
-</P>
111
-<P>
112
- Main Commands
113
-</P>
114
-
115
-<DL>
116
-<DT><B>disc</B></DT><DD>
117
- Encode, make menus, author, burn. (was <B>todisc</B>. See <B>Command:disc</B>)
118
-<DT><B>gui</B></DT><DD>
119
- Start the tovid GUI (was <B>todiscgui</B>. See <B>Command:gui</B>)
120
-<DT><B>titlesets</B></DT><DD>
121
- A GUI wizard for multiple titlesets. (new: See <B>Command:titlesets</B>)
122
-</DL>
123
-
124
-<P>
125
- Helper Commands
126
-</P>
127
-
128
-<DL>
129
-<DT><B>mpg</B></DT><DD>
130
- Encode videos to MPEG format (was <B>tovid</B>. See <B>Command:mpg</B>)
131
-<DT><B>dvd</B></DT><DD>
132
- Author and/or burn a DVD (was <B>makedvd</B>. See <B>Command:dvd</B>)
133
-<DT><B>id</B></DT><DD>
134
- Identify one or more video files (was <B>idvid</B>. See <B>Command:id</B>)
135
-<DT><B>chapters</B></DT><DD>
136
- A GUI using mplayer for setting chapter points. It will return a string of
137
- chapter points to the terminal, in a format recognized by 'tovid disc'
138
- (todisc) or by 'tovid gui', for the <B>-chapters</B> option.
139
-</DL>
140
-
141
-<P>
142
-The <I>OPTIONS</I> differ for each command; run <B>tovid <command></B> with no
143
-further arguments to get help on a command, and what options it expects.
144
-</P>
145
-
146
-<A NAME="toc4"></A>
147
-<H1>Configuration</H1>
148
-
149
-<P>
150
-Two configuration files are created the first time you run tovid:
151
-</P>
152
-
153
-<DL>
154
-<DT><B>~/.tovid/preferences</B></DT><DD>
155
- Defines working directory for all scripts.
156
- You can define the output directory for makempg here.
157
- The 'ffmpeg' executable can be set here: ffmpeg or avconv (TOVID_FFMPEG)
158
-<DT><B>~/.tovid/tovid.ini</B></DT><DD>
159
- Includes command-line options that should be passed to the various
160
- <B>tovid</B> sub-commands. Note: each sub-command has its own section,
161
- starting with the line [sub-command], for example:
162
-
163
-<PRE>
164
- [disc]
165
- ; -no-warn
166
- -static
167
- -no-ask
168
-</PRE>
169
-
170
-</DL>
171
-
172
-<P>
173
-Edit these files if you wish to change your configuration.
174
-</P>
175
-<P>
176
-The following environment variables are also honoured:
177
-</P>
178
-
179
-<PRE>
180
- TOVID_HOME (directory containing preferences: ~/.tovid)
181
- TOVID_WORKING_DIR (working directory for all scripts).
182
- TOVID_OUTPUT_DIR (output directory for the makempg script).
183
- TOVID_FFMPEG_CMD (the 'ffmpeg' executable to use: ffmpeg or avconv)
184
-</PRE>
185
-
186
-<P>
187
-These will override 'TOVID_HOME', 'WORKING_DIR', 'OUTPUT_DIR',
188
-and 'TOVID_FFMPEG' if set in ~/.tovid/preferences.
189
-</P>
190
-
191
-<A NAME="toc5"></A>
192
-<H1>Command:gui</H1>
193
-
194
-<A NAME="toc6"></A>
195
-<H1>Usage</H1>
196
-
197
-<P>
198
-<B>tovid gui</B> [<I>OPTIONS</I>]
199
-</P>
200
-<P>
201
tovid-0.35.0.tar.gz/docs/src/en/tovid.wiki
Deleted
201
1
2
-'''tovid manual'''
3
-
4
-
5
-
6
-
7
-----
8
-
9
-__TOC__
10
-
11
-----
12
-
13
-
14
-== Name ==
15
-
16
-tovid: Make DVDs from video files
17
-
18
-== Description ==
19
-
20
-'''tovid''' is a command-line tool for creating DVDs. It can encode your video
21
-files to DVD-compliant MPEG format, generate simple or complex DVD menus,
22
-author and burn a ready-to-watch DVD, with just a few shell commands. A
23
-graphical interface is also provided to make the process even easier.
24
-
25
-'''NOTE''': As of tovid 0.35, the legacy scripts '''makemenu''' and '''makexml'''
26
-have been removed and no longer appear in this manpage.
27
-All of their functions and more can be done with the 'tovid disc' command,
28
-(todisc script). See '''Command:disc''' and the [http://tovid.wikia.com wiki]
29
-for more info.
30
-
31
-Also note that as of tovid 0.32, this is the only manual page provided by tovid.
32
-There is now a single executable frontend to all functionality in the suite, so
33
-if you were expecting to find manpages for '''todisc''', '''idvid''', '''makempg'''
34
-and their kin, they can all be found in the '''tovid''' manpage you are reading now.
35
-And yes, this makes for a pretty large manual page. If you are viewing this
36
-manpage from the command-line '''man''' utility, which normally pages through the
37
-'''less''' utility, you can skip to a section by searching with the '''/''' key,
38
-followed by a '''^''' to match the given section name. For example, to skip to
39
-the '''mpg''' command, type '''/^Command:mpg'''. See '''man less''' for more on how
40
-to navigate.
41
-
42
-== Usage ==
43
-
44
-'''tovid''' ''COMMAND'' [''OPTIONS'']
45
-
46
-Where ''COMMAND'' is one of the following:
47
-
48
- Main Commands
49
-
50
-; '''disc'''
51
-: Encode, make menus, author, burn. (was '''todisc'''. See '''Command:disc''')
52
-; '''gui'''
53
-: Start the tovid GUI (was '''todiscgui'''. See '''Command:gui''')
54
-; '''titlesets'''
55
-: A GUI wizard for multiple titlesets. (new: See '''Command:titlesets''')
56
-
57
- Helper Commands
58
-
59
-; '''mpg'''
60
-: Encode videos to MPEG format (was '''tovid'''. See '''Command:mpg''')
61
-; '''dvd'''
62
-: Author and/or burn a DVD (was '''makedvd'''. See '''Command:dvd''')
63
-; '''id'''
64
-: Identify one or more video files (was '''idvid'''. See '''Command:id''')
65
-; '''chapters'''
66
-: A GUI using mplayer for setting chapter points. It will return a string of
67
-: chapter points to the terminal, in a format recognized by 'tovid disc'
68
-: (todisc) or by 'tovid gui', for the '''-chapters''' option.
69
-
70
-The ''OPTIONS'' differ for each command; run '''tovid <command>''' with no
71
-further arguments to get help on a command, and what options it expects.
72
-
73
-== Configuration ==
74
-
75
-Two configuration files are created the first time you run tovid:
76
-
77
-; '''~/.tovid/preferences'''
78
-: Defines working directory for all scripts.
79
-: You can define the output directory for makempg here.
80
-: The 'ffmpeg' executable can be set here: ffmpeg or avconv (TOVID_FFMPEG)
81
-; '''~/.tovid/tovid.ini'''
82
-: Includes command-line options that should be passed to the various
83
-: '''tovid''' sub-commands. Note: each sub-command has its own section,
84
-: starting with the line [sub-command], for example:
85
-<pre>
86
- [disc]
87
- ; -no-warn
88
- -static
89
- -no-ask
90
-</pre>
91
-
92
-
93
-Edit these files if you wish to change your configuration.
94
-
95
-The following environment variables are also honoured:
96
-
97
-<pre>
98
- TOVID_HOME (directory containing preferences: ~/.tovid)
99
- TOVID_WORKING_DIR (working directory for all scripts).
100
- TOVID_OUTPUT_DIR (output directory for the makempg script).
101
- TOVID_FFMPEG_CMD (the 'ffmpeg' executable to use: ffmpeg or avconv)
102
-</pre>
103
-
104
-These will override 'TOVID_HOME', 'WORKING_DIR', 'OUTPUT_DIR',
105
-and 'TOVID_FFMPEG' if set in ~/.tovid/preferences.
106
-
107
-== Command:gui ==
108
-
109
-== Usage ==
110
-
111
-'''tovid gui''' [''OPTIONS'']
112
-
113
-'''tovid gui''' starts the graphical user interface (GUI) for tovid. This is
114
-the easiest way to start creating DVDs with tovid. The optional arguments
115
-''OPTIONS'' are any option used by todisc ('tovid disc') which will save
116
-entering it manually, OR the full path to a saved script from the GUI.
117
-You can also combine these, but the script must be the FIRST option
118
-directly after '''tovid gui''' . (This option to save the contents of your
119
-project allows you to use it as a bash script later, or to reload the
120
-project to continue working with it at another time.)
121
-
122
-'''tovid gui''' will also take the option '''--position''', which denotes the
123
-screen position that the GUI will start at, in the form '+X+Y', similar to
124
-this part of the Xorg -geometry string.
125
-
126
-All help is integrated in the form of tooltips. You can also see
127
-**Command:disc ** for more detail about the options. Note: if you wish to use
128
-a GUI to make multiple titlesets on the same DVD use '''*tovid titlesets*''',
129
-which is a wizard that uses the the 'tovid gui. See '''*Command:titlesets*'''.
130
-
131
-Please note that although the interface may seem complex with so many options,
132
-you can create a fully functional DVD with only a few options on the opening
133
-tab of the GUI (select video files and an output name).
134
-
135
-== Command:titlesets ==
136
-
137
-'''tovid titlesets''' will assist in making a DVD with multiple titlesets. It can
138
-be started without any options, or you can feed it the path to a saved titleset
139
-script as an option. The option to save a script is also useful as the resulting
140
-script can be run later from a terminal.
141
-
142
-== Command:disc ==
143
-
144
-'''tovid disc''' creates a DVD file-system with optional menus, from a list of
145
-multimedia video files and their titles. As todisc can function as a master
146
-script, calling other scripts as it needs them, it is the easiest command line
147
-program for creating a DVD from start to finish, including automatically
148
-converting non-compliant videos and prompting to burn at completion. It can do
149
-animated menus, static thumbnail menus, text-only menus, or author with no menu.
150
-In addition, it can do slideshows, using images as input, and even combine
151
-slideshows with videos. It supports sub-menus for chapter breaks,
152
-configurable menu style, animated backgrounds and transparency effects.
153
-From simple (no menu) to complex (switched menus and titlesets), you should
154
-be able to do what you want with 'tovid disc'.
155
-
156
-=== Usage ===
157
-
158
-<pre>
159
- tovid disc [OPTIONS] \
160
- -files <file list> -titles <title list>
161
- -out mydvd
162
-</pre>
163
-
164
-For example:
165
-
166
-<pre>
167
- $ tovid disc -files File1.mpg File2.mpg File3.mpg \
168
- -titles "Episode 1" "Episode 2" "Episode 3" \
169
- -out Season_one
170
-</pre>
171
-
172
-The number of '''-files''' and '''-titles''' must be equal, though if you do not
173
-include any titles '''tovid disc''' will use the basename of the included files
174
-as titles. If you are doing a slideshow or multiple slideshows, use
175
-'''-slides''' rather than '''-files''' for passing in the images. You may use
176
--files and -slides more than once to create an ordering in a mixed
177
-slideshows/videos menu. See Slideshows part of Usage section, below.
178
-
179
-If the input files are not mpeg, you will have the option to auto-encode them.
180
-
181
-General Options
182
-
183
-'''At present there are 2 display arrangements or "templates":'''
184
-
185
-; A. (Default)
186
-: Thumbs will be centred, and as large as space restraints allow.
187
-:
188
-; B. '''-showcase''' IMAGE|VIDEO
189
-: Produces an arrangement with small buttons on
190
-: the side and the showcase image/video in the centre. If no IMAGE or VIDEO
191
-: argument is supplied, the central thumb will be omitted.
192
-:
193
-: Note: '''-textmenu''', '''-quick-menu''' and '''-switched-menus''' are all types
194
-: of showcase style menus. See descriptions under '''Menu style''' section.
195
-
196
-The '''-titles''' arguments should be double or single quoted, or have the spaces
197
-backslash-escaped. Special characters (like ", !, *, &, ?) may need to be
198
-backslash-escaped. To include a quoted string within a title, backslash-escape
199
-the quotes. These titles are used for labelling thumbnails on the main menu,
200
-and for the submenu title for that video. ( see also '''-submenu-titles''' )
201
tovid-0.35.0.tar.gz/PKG-INFO -> tovid-0.35.2.tar.gz/PKG-INFO
Changed
9
1
2
Metadata-Version: 1.1
3
Name: tovid
4
-Version: 0.35.0
5
+Version: 0.35.2
6
Summary: A suite of tools for making video DVDs
7
Home-page: http://tovid.wikia.com/
8
Author: grepper
9
tovid-0.35.2.tar.gz/docs/scripts
Added
2
1
+(directory)
2
tovid-0.35.2.tar.gz/docs/scripts/txt2tags
Added
201
1
2
+#!/usr/bin/env python
3
+# txt2tags - generic text conversion tool ---> READY TO PYTHON 3!
4
+# http://txt2tags.org
5
+#
6
+# Copyright 2001-2010 Aurelio Jargas
7
+#
8
+# License: http://www.gnu.org/licenses/gpl-2.0.txt
9
+# Subversion: http://svn.txt2tags.org
10
+# Bug tracker: http://bugs.txt2tags.org
11
+#
12
+########################################################################
13
+#
14
+# BORING CODE EXPLANATION AHEAD
15
+#
16
+# Just read it if you wish to understand how the txt2tags code works.
17
+#
18
+########################################################################
19
+#
20
+# The code that [1] parses the marked text is separated from the
21
+# code that [2] insert the target tags.
22
+#
23
+# [1] made by: def convert()
24
+# [2] made by: class BlockMaster
25
+#
26
+# The structures of the marked text are identified and its contents are
27
+# extracted into a data holder (Python lists and dictionaries).
28
+#
29
+# When parsing the source file, the blocks (para, lists, quote, table)
30
+# are opened with BlockMaster, right when found. Then its contents,
31
+# which spans on several lines, are feeded into a special holder on the
32
+# BlockMaster instance. Just when the block is closed, the target tags
33
+# are inserted for the full block as a whole, in one pass. This way, we
34
+# have a better control on blocks. Much better than the previous line by
35
+# line approach.
36
+#
37
+# In other words, whenever inside a block, the parser *holds* the tag
38
+# insertion process, waiting until the full block is read. That was
39
+# needed primary to close paragraphs for the XHTML target, but
40
+# proved to be a very good adding, improving many other processing.
41
+#
42
+# -------------------------------------------------------------------
43
+#
44
+# These important classes are all documented:
45
+# CommandLine, SourceDocument, ConfigMaster, ConfigLines.
46
+#
47
+# There is a RAW Config format and all kind of configuration is first
48
+# converted to this format. Then a generic method parses it.
49
+#
50
+# These functions get information about the input file(s) and take
51
+# care of the init processing:
52
+# get_infiles_config(), process_source_file() and convert_this_files()
53
+#
54
+########################################################################
55
+
56
+#XXX Python coding warning
57
+# Avoid common mistakes:
58
+# - do NOT use newlist=list instead newlist=list[:]
59
+# - do NOT use newdic=dic instead newdic=dic.copy()
60
+# - do NOT use dic[key] instead dic.get(key)
61
+# - do NOT use del dic[key] without has_key() before
62
+
63
+#XXX Smart Image Align don't work if the image is a link
64
+# Can't fix that because the image is expanded together with the
65
+# link, at the linkbank filling moment. Only the image is passed
66
+# to parse_images(), not the full line, so it is always 'middle'.
67
+
68
+#XXX Paragraph separation not valid inside Quote
69
+# Quote will not have <p></p> inside, instead will close and open
70
+# again the <blockquote>. This really sux in CSS, when defining a
71
+# different background color. Still don't know how to fix it.
72
+
73
+#XXX TODO (maybe)
74
+# New mark or macro which expands to an anchor full title.
75
+# It is necessary to parse the full document in this order:
76
+# DONE 1st scan: HEAD: get all settings, including %!includeconf
77
+# DONE 2nd scan: BODY: expand includes & apply %!preproc
78
+# 3rd scan: BODY: read titles and compose TOC info
79
+# 4th scan: BODY: full parsing, expanding [#anchor] 1st
80
+# Steps 2 and 3 can be made together, with no tag adding.
81
+# Two complete body scans will be *slow*, don't know if it worths.
82
+# One solution may be add the titles as postproc rules
83
+
84
+
85
+##############################################################################
86
+
87
+# User config (1=ON, 0=OFF)
88
+
89
+USE_I18N = 1 # use gettext for i18ned messages? (default is 1)
90
+COLOR_DEBUG = 1 # show debug messages in colors? (default is 1)
91
+BG_LIGHT = 0 # your terminal background color is light (default is 0)
92
+HTML_LOWER = 0 # use lowercased HTML tags instead upper? (default is 0)
93
+
94
+##############################################################################
95
+
96
+
97
+# These are all the core Python modules used by txt2tags (KISS!)
98
+import re, os, sys, time, getopt
99
+
100
+# The CSV module is new in Python version 2.3
101
+try:
102
+ import csv
103
+except ImportError:
104
+ csv = None
105
+
106
+# Program information
107
+my_url = 'http://txt2tags.org'
108
+my_name = 'txt2tags'
109
+my_email = 'verde@aurelio.net'
110
+my_version = '2.6'
111
+
112
+# i18n - just use if available
113
+if USE_I18N:
114
+ try:
115
+ import gettext
116
+ # If your locale dir is different, change it here
117
+ cat = gettext.Catalog('txt2tags',localedir='/usr/share/locale/')
118
+ _ = cat.gettext
119
+ except:
120
+ _ = lambda x:x
121
+else:
122
+ _ = lambda x:x
123
+
124
+# FLAGS : the conversion related flags , may be used in %!options
125
+# OPTIONS : the conversion related options, may be used in %!options
126
+# ACTIONS : the other behavior modifiers, valid on command line only
127
+# MACROS : the valid macros with their default values for formatting
128
+# SETTINGS: global miscellaneous settings, valid on RC file only
129
+# NO_TARGET: actions that don't require a target specification
130
+# NO_MULTI_INPUT: actions that don't accept more than one input file
131
+# CONFIG_KEYWORDS: the valid %!key:val keywords
132
+#
133
+# FLAGS and OPTIONS are configs that affect the converted document.
134
+# They usually have also a --no-<option> to turn them OFF.
135
+#
136
+# ACTIONS are needed because when doing multiple input files, strange
137
+# behavior would be found, as use command line interface for the
138
+# first file and gui for the second. There is no --no-<action>.
139
+# --version and --help inside %!options are also odd
140
+#
141
+TARGETS = sorted( 'html xhtml sgml dbk tex lout man mgp wiki gwiki doku pmw moin pm6 txt art adoc creole'.split() )
142
+
143
+FLAGS = {'headers' :1 , 'enum-title' :0 , 'mask-email' :0 ,
144
+ 'toc-only' :0 , 'toc' :0 , 'rc' :1 ,
145
+ 'css-sugar' :0 , 'css-suggar' :0 , 'css-inside' :0 ,
146
+ 'quiet' :0 , 'slides' :0 }
147
+OPTIONS = {'target' :'', 'toc-level' :3 , 'style' :'',
148
+ 'infile' :'', 'outfile' :'', 'encoding' :'',
149
+ 'config-file':'', 'split' :0 , 'lang' :'',
150
+ 'width' :0 , 'height' :0 , 'art-chars' :'',
151
+ 'show-config-value':''}
152
+ACTIONS = {'help' :0 , 'version' :0 , 'gui' :0 ,
153
+ 'verbose' :0 , 'debug' :0 , 'dump-config':0 ,
154
+ 'dump-source':0 , 'targets' :0}
155
+MACROS = {'date' : '%Y%m%d', 'infile': '%f',
156
+ 'mtime': '%Y%m%d', 'outfile': '%f'}
157
+SETTINGS = {} # for future use
158
+NO_TARGET = ['help', 'version', 'gui', 'toc-only', 'dump-config', 'dump-source', 'targets']
159
+NO_MULTI_INPUT = ['gui','dump-config','dump-source']
160
+CONFIG_KEYWORDS = [
161
+ 'target', 'encoding', 'style', 'options', 'preproc','postproc',
162
+ 'guicolors']
163
+
164
+TARGET_NAMES = {
165
+ 'html' : _('HTML page'),
166
+ 'xhtml' : _('XHTML page'),
167
+ 'sgml' : _('SGML document'),
168
+ 'dbk' : _('DocBook document'),
169
+ 'tex' : _('LaTeX document'),
170
+ 'lout' : _('Lout document'),
171
+ 'man' : _('UNIX Manual page'),
172
+ 'mgp' : _('MagicPoint presentation'),
173
+ 'wiki' : _('Wikipedia page'),
174
+ 'gwiki' : _('Google Wiki page'),
175
+ 'doku' : _('DokuWiki page'),
176
+ 'pmw' : _('PmWiki page'),
177
+ 'moin' : _('MoinMoin page'),
178
+ 'pm6' : _('PageMaker document'),
179
+ 'txt' : _('Plain Text'),
180
+ 'art' : _('ASCII Art text'),
181
+ 'adoc' : _('AsciiDoc document'),
182
+ 'creole' : _('Creole 1.0 document')
183
+}
184
+
185
+DEBUG = 0 # do not edit here, please use --debug
186
+VERBOSE = 0 # do not edit here, please use -v, -vv or -vvv
187
+QUIET = 0 # do not edit here, please use --quiet
188
+GUI = 0 # do not edit here, please use --gui
189
+AUTOTOC = 1 # do not edit here, please use --no-toc or %%toc
190
+
191
+DFT_TEXT_WIDTH = 72 # do not edit here, please use --width
192
+DFT_SLIDE_WIDTH = 80 # do not edit here, please use --width
193
+DFT_SLIDE_HEIGHT = 25 # do not edit here, please use --height
194
+
195
+# ASCII Art config
196
+AA_KEYS = 'corner border side bar1 bar2 level2 level3 level4 level5'.split()
197
+AA_VALUES = '+-|-==-^"' # do not edit here, please use --art-chars
198
+AA = dict(zip(AA_KEYS, AA_VALUES))
199
+AA_COUNT = 0
200
+AA_TITLE = ''
201
tovid-0.35.0.tar.gz/libtovid/metagui/gui.py -> tovid-0.35.2.tar.gz/libtovid/metagui/gui.py
Changed
12
1
2
"""
3
text = self.stdin_text.get()
4
# Write the entered text to the command's stdin pipe
5
- self.command.proc.stdin.write(text + '\n')
6
+ #self.command.proc.stdin.write(text + '\n')
7
+ # python 3 compatibility
8
+ self.command.proc.stdin.write(bytearray(text + "\n", "ascii"))
9
self.command.proc.stdin.flush()
10
# Show what was typed in the log window
11
self.write(text)
12
tovid-0.35.0.tar.gz/setup.py -> tovid-0.35.2.tar.gz/setup.py
Changed
30
1
2
# Current SVN version number
3
#_tovid_version = svn_version()
4
# Official release number
5
-_tovid_version = '0.35.0'
6
+_tovid_version = '0.35.2'
7
8
9
import os
10
11
def run(self):
12
"""Build the tovid manual page.
13
"""
14
+ # For python 3 txt2tags needs an unofficial script
15
+ import sys
16
+ if (sys.version_info > (3, 0)):
17
+ txt2tags = 'docs/scripts/txt2tags'
18
+ else:
19
+ txt2tags = 'txt2tags'
20
+
21
# Build only if target does not exist, or if source is newer than target
22
mod = os.path.getmtime
23
if not os.path.exists(self.target) or (mod(self.source) > mod(self.target)):
24
print("Rebuilding tovid manual page")
25
- command = 'txt2tags -t man -i "%s" -o "%s"' % (self.source, self.target)
26
+ command = '%s -t man -i "%s" -o "%s"' % (txt2tags, self.source, self.target)
27
os.system(command)
28
else:
29
print("Manual page already built, not building again")
30
tovid-0.35.0.tar.gz/src/idvid -> tovid-0.35.2.tar.gz/src/idvid
Changed
42
1
2
if $USE_NAVLOG; then
3
if egrep -qi 'mpeg$|mpg$|vob$' <<< "${INFILE##*.}"; then
4
ID_VIDEO_FRAMES=$(awk 'END{print NR}' "$NAV_LOG" )
5
- V_DUR=$(bc <<< "$ID_VIDEO_FRAMES / $ID_VIDEO_FPS")
6
+ V_DUR=$( ${bC} <<< "$ID_VIDEO_FRAMES / $ID_VIDEO_FPS")
7
V_DURATION=${V_DUR%%.*} # final value is integer ( seconds )
8
else
9
V_DURATION=$(awk '($2==1) { field = $NF }; END{ print field/1000 }' "$NAV_LOG")
10
- ID_VIDEO_FRAMES=$(bc <<< "$V_DURATION * $ID_VIDEO_FPS")
11
+ ID_VIDEO_FRAMES=$( ${bC} <<< "$V_DURATION * $ID_VIDEO_FPS")
12
ID_VIDEO_FRAMES=${ID_VIDEO_FRAMES%%.*}
13
# final value is in seconds
14
V_DURATION=${V_DURATION%%.*} # integer
15
16
# infer bitrate from file size and duration
17
v_size=$(( $(du -m "$INFILE" | awk '{ print $1 }') * 8192 ))
18
if (( ${V_DURATION%.*} )); then
19
- ID_VIDEO_BITRATE=$(bc -l <<< "$v_size / $V_DURATION")
20
+ ID_VIDEO_BITRATE=$( ${bC} -l <<< "$v_size / $V_DURATION")
21
ID_VIDEO_BITRATE=$(( v_size / V_DURATION ))000
22
#echo -e "Probed video bitrate not available, infering from file size and duration\n"
23
fi
24
25
if test_is_number $vid_frames && ((vid_frames)); then
26
(( $ID_VIDEO_FRAMES == 0 )) && ID_VIDEO_FRAMES=$vid_frames
27
elif (( ${V_DURATION%.*} )) && (( ${ID_VIDEO_FPS/./} )); then
28
- VIDEO_FRAMES=$(bc -l <<< "$V_DURATION * $ID_VIDEO_FPS")
29
+ VIDEO_FRAMES=$( ${bC} -l <<< "$V_DURATION * $ID_VIDEO_FPS")
30
if (( $ID_VIDEO_FRAMES == 0 )); then
31
ID_VIDEO_FRAMES=${VIDEO_FRAMES%.*}
32
#echo -e "Probed frame count not available, infering from duration and framerate\n"
33
34
echo "V_ASPECT_WIDTH=$V_ASPECT_WIDTH"
35
echo "ID_VIDEO_FRAMES=$ID_VIDEO_FRAMES"
36
elif $TABULAR; then
37
- FILE_SIZE=$(du -Dh "$INFILE" | awk '{print $1}')
38
+ FILE_SIZE=$(du -Hh "$INFILE" | awk '{print $1}')
39
echo "$INFILE||$FILE_SIZE||${ID_VIDEO_WIDTH}x${ID_VIDEO_HEIGHT}||$ID_VIDEO_FPS||$ID_VIDEO_BITRATE||$ID_AUDIO_BITRATE" >> "$TABLE"
40
else
41
echo $SEPARATOR
42
tovid-0.35.0.tar.gz/src/makedvd -> tovid-0.35.2.tar.gz/src/makedvd
Changed
26
1
2
else
3
DISC_CAPACITY=0
4
fi
5
- DISC_CAPACITY=$(echo "$DISC_CAPACITY / 1024 / 1024" | bc)
6
+ DISC_CAPACITY=$(echo "$DISC_CAPACITY / 1024 / 1024" | ${bC} )
7
8
# Define usable DVDs
9
HAVE_DVD_RW=$(verify "$DISC_TYPE" set "DVD-RW DVD+RW")
10
11
DISC_SUM=0
12
while test $i -le $NUM_VOBS; do
13
VOB=$(echo "$VOB_LIST" | awk -F ':' '{ print $'$i' }')
14
- VOB_SIZE=$(du -D -B M "$VOB" | awk -F ' ' '{print $1}' | tr -d M)
15
+ VOB_SIZE=$(du -H -m "$VOB" | awk '{print $1}')
16
DISC_SUM=$(expr $VOB_SIZE \+ $DISC_SUM)
17
i=$(expr $i \+ 1)
18
done
19
OUTDIR=$(readlink -f "$OUT_DIR")
20
- AVAIL_SPACE=$(df -B M -P "${OUTDIR%/*}" | awk 'NR != 1 {print $4;}' | tr -d M)
21
+ AVAIL_SPACE=$(df -P "$OUT_DIR" | awk 'NR==1 {sub("-blocks", "", $2); blocksize=$2} \
22
+ NR!=1 {print int($4/1024*blocksize/1024)}')
23
24
if test $DISC_SUM -gt $AVAIL_SPACE; then
25
echo $SEPARATOR
26
tovid-0.35.0.tar.gz/src/makempg -> tovid-0.35.2.tar.gz/src/makempg
Changed
89
1
2
# based on original file size
3
$SLICE && VIDEO_DURATION=$CLIP_LENGTH || VIDEO_DURATION=$V_DURATION
4
if test "$VIDEO_DURATION" = "0"; then
5
- CUR_SIZE=$(du -Dck "$IN_FILE" | awk 'END{print $1}')
6
+ CUR_SIZE=$(du -Hck "$IN_FILE" | awk 'END{print $1}')
7
NEED_SPACE=$(expr $CUR_SIZE \* 2)
8
# Estimate space based as kbps * duration
9
else
10
11
test -n "$AVG_BITRATE" && AVG_BITRATE=$(expr $AVG_BITRATE \/ 1000)
12
test -n "$PEAK_BITRATE" && PEAK_BITRATE=$(expr $PEAK_BITRATE \/ 1000)
13
KB_PER_MIN=$(expr $FINAL_SIZE \* 60 \/ $V_DURATION \+ 1)
14
- ENC_TIME_RATIO=$(echo "scale = 2; $SCRIPT_TOT_TIME / $V_DURATION" | bc)
15
+ ENC_TIME_RATIO=$(echo "scale = 2; $SCRIPT_TOT_TIME / $V_DURATION" | ${bC} )
16
if $USE_FFMPEG; then
17
BACKEND="$FFmpeg"
18
else
19
BACKEND="mpeg2enc"
20
fi
21
-
22
+ [[ $CPU_SPEED ]] && MHZ=MHz || MHZ=
23
# Final statistics string (pretty-printed)
24
FINAL_STATS_PRETTY=`cat << EOF
25
----------------------------------------
26
27
Target bitrate: $VID_BITRATE kbits/sec
28
Average bitrate: $AVG_BITRATE kbits/sec
29
Peak bitrate: $PEAK_BITRATE kbits/sec
30
- Took $HHMMSS to encode on $CPU_MODEL $CPU_SPEED mhz
31
+ Took $HHMMSS to encode on $CPU_MODEL $CPU_SPEED $MHZ
32
-----------------------------------------
33
EOF`
34
35
36
((${CLIP_SEEK%.*} > 0)) && [[ -z $ASYNC ]] && ASYNC1="-async 1"
37
if [[ "$CLIP_ENDTIME" ]]; then
38
[[ "$CLIP_ENDTIME" = *:* ]] && CLIP_ENDTIME=$(unformat_time $CLIP_ENDTIME)
39
- CLIP_LENGTH=$(echo "$CLIP_ENDTIME - $CLIP_SEEK" | bc)
40
+ CLIP_LENGTH=$(echo "$CLIP_ENDTIME - $CLIP_SEEK" | ${bC} )
41
[[ ${CLIP_LENGTH%.*} -eq 0 ]] && CLIP_LENGTH=1
42
FF_LENGTH="-t $CLIP_LENGTH"
43
fi
44
CLIP_SEEK="-ss $CLIP_SEEK"
45
fi
46
-# FRAMES=$(echo "scale = 2; $ID_VIDEO_FPS * $CLIP_ENDTIME" | bc)
47
+# FRAMES=$(echo "scale = 2; $ID_VIDEO_FPS * $CLIP_ENDTIME" | ${bC} )
48
# MP_FRAMES="-frames ${FRAMES%.*}"
49
50
51
52
yecho "Probing video for information. This may take several minutes..."
53
54
# Get an MD5sum of the input file for statistics
55
- IN_FILE_MD5=$(md5sum "$IN_FILE" | awk '{print $1}')
56
+ IN_FILE_MD5=$($md5sum "$IN_FILE" | awk '{print $1}')
57
58
# Assume nothing is compliant unless idvid says so
59
# (these will be overridden by idvid for compliant A/V)
60
61
# When the audio is already compliant and the bitrate is known we
62
# can calculate a more accurate size.
63
if $AUDIO_OK && test "$ID_AUDIO_BITRATE" != "0"; then
64
- AUD_BITRATE=$(echo "scale = 0; $ID_AUDIO_BITRATE / 1000" | bc)
65
+ AUD_BITRATE=$(echo "scale = 0; $ID_AUDIO_BITRATE / 1000" | ${bC} )
66
fi
67
AUDIO_SIZE=$(bc_math "$AUD_BITRATE * $LENGTH / (8 *1024)")
68
VIDEO_SIZE=$(bc_math "$AUD_VID_SIZE - $AUDIO_SIZE")
69
70
errors=$( $FFmpeg -i "$IN_FILE" -t 1 \
71
-vf scale=w=720:h=352,pad=width=720:height=480:x=0:y=64,setdar=16/9 \
72
-f null -y /dev/null 2>&1)
73
-if grep -qE "Error.*\(width\|height\|setdar\|w=\|h=\)" <<< "$errors"; then
74
+if grep -qE "Error.*(width|height|setdar|w=|h=)" <<< "$errors"; then
75
ff_legacy=1
76
fi
77
78
79
# ******************************************************************************
80
81
if ! $FAKE; then
82
- AUDIO_SIZE=$(du -c -b "$AUDIO_STREAM" | awk 'END{print $1}')
83
- VIDEO_SIZE=$(du -c -b "$VIDEO_STREAM" | awk 'END{print $1}')
84
+ AUDIO_SIZE=$(ls -lnR "$AUDIO_STREAM" | awk 'END{print $5}')
85
+ VIDEO_SIZE=$(ls -lnR "$VIDEO_STREAM" | awk 'END{print $5}')
86
# Total size of streams so far (in MBytes)
87
STREAM_SIZE=$(expr \( $AUDIO_SIZE \+ $VIDEO_SIZE \) \/ 1000000)
88
# If it exceeds disc size, add '%d' field to allow mplex to split output
89
tovid-0.35.0.tar.gz/src/todisc -> tovid-0.35.2.tar.gz/src/todisc
Changed
201
1
2
3
# check if symlink in /tmp exists and use time stamped link if so
4
WORK_DIR="/tmp/todisc-work"
5
-
6
LOG_FILE=$(readlink -f todisc.log)
7
OUT_DIRECTORY=""
8
TV_STANDARD=ntsc
9
10
# Usage: continue_in [SECONDS]
11
continue_in()
12
{
13
+ local count LAST
14
yecho ""
15
(($1)) && LAST=$1 || LAST=5
16
for ((i=LAST; i>=0; i--)); do
17
18
# last 2 args are optional: defaults 'video' and the whole stream.
19
stream_length()
20
{
21
- local end=""
22
+ local end=""
23
local stream_type=video
24
local ff_opts="-an -vcodec copy"
25
[[ -n $2 ]] && stream_type=$2
26
[[ -n $3 ]] && end="-t $3"
27
- sed_var="{s/^.*time= *\([^ ]*\).*/\1/p}"
28
+ sed_var="{s/^.*time= *\([^ ]*\).*/\1/p;}"
29
stream_name=$stream_type
30
if [[ $stream_type = 'audio' ]]; then
31
ff_opts="-vn -acodec copy"
32
# workaround for avconv which is broken atm wrt getting m2v framerate right
33
# overload stream_type to have another meaning,
34
elif [[ $stream_type = 'm2v' ]]; then
35
- sed_var="{s/^.*frame= *\([^ ]*\).*/\1/p}"
36
+ sed_var="{s/^.*frame= *\([^ ]*\).*/\1/p;}"
37
stream_name=video
38
fi
39
print2log "Using $FFmpeg to get accurate $stream_name length of $1"
40
41
# usage: bc_math "expression" [int]
42
bc_math()
43
{
44
+ local val=$1
45
+ #val=${val//$'\n'/}
46
OLC_ALL=$LC_ALL
47
LC_ALL=C
48
- bc_out=$(bc <<< "scale=3;$1" 2>/dev/null)
49
+ bc_out=$( ${bC} <<< "scale=3;$val" 2>/dev/null)
50
if [[ -n $2 && $2 = "int" ]]; then
51
echo ${bc_out%.*}
52
else
53
54
video_type=$3
55
yecho ""
56
yecho "$VIDEO_IN is not compliant - re-encoding \
57
- $(bc <<< "$VIDEO_IN_SEEK + ${MENU_LEN[MENU_NUM-1]}" 2>/dev/null)
58
+ $( ${bC} <<< "$VIDEO_IN_SEEK + ${MENU_LEN[MENU_NUM-1]}" 2>/dev/null)
59
second slice to DVD compliant file"
60
yecho "This is not strictly necessary and will reduce quality, but it may"
61
yecho "help with sync problems if using the same file for audio and video."
62
63
yecho "Converting files to $TGT_CAPS format with 'makempg'"
64
continue_in 5
65
makempg $NO_ASK -in "$VIDEO_IN" \
66
- -slice 0-$(bc <<< "$VIDEO_IN_SEEK + ${MENU_LEN[MENU_NUM-1]}" 2>/dev/null) \
67
+ -slice 0-$( ${bC} <<< "$VIDEO_IN_SEEK + ${MENU_LEN[MENU_NUM-1]}" 2>/dev/null) \
68
-${TV_STANDARD} -${TARGET} -in "$VIDEO_IN" \
69
-out "${VIDEO_IN}.enc" "${TOVID_OPTS[@]}"
70
# See if output file exists
71
72
done
73
else
74
for len in ${GROUP_VIDEO_LENGTHS[@]}; do
75
- adjusted_length=$( bc <<< "scale=3; $len + $remainder" 2>/dev/null)
76
+ adjusted_length=$( ${bC} <<< "scale=3; $len + $remainder" 2>/dev/null)
77
num_chapters=$( bc_math "$adjusted_length / $chapter_length" int )
78
if (( num_chapters > 0)); then
79
chapt_len_array=( $( for ((t=0; t<num_chapters; t++)); do
80
81
chapter_points=$( running_total <<< ${chapt_len_array[@]} )
82
# remove trailing space
83
chapter_points=$(sed 's/[ \t]*$//' <<< $chapter_points)
84
- remainder=$( bc <<< "$adjusted_length % $chapter_length" \
85
+ remainder=$( ${bC} <<< "$adjusted_length % $chapter_length" \
86
2>/dev/null)
87
(( ${nochapt[index]} )) && local group_chapters[x++]=0 ||
88
local group_chapters[x++]=$chapter_points
89
90
MENUTITLES=( "${menutitles[@]}" )
91
# some vars for vmgm menu, depending on presence of -static or -quick-nav
92
# how many titlesets do we have ?
93
- for i in "$@"; do [[ $i == -end-titleset ]] && ((count++)); done
94
+ for i in "$@"; do [[ $i == -end-titleset ]] && ((tscount++)); done
95
VMGM_PAUSE=$PAUSE_TIME
96
grep -q -- -static <<< "${VMGM_OPTS[@]}" && VMGM_PAUSE="inf"
97
for i in ${!VMGM_OPTS[@]}; do
98
99
fi)
100
$(if $QUICK_NAV; then
101
echo -e " <button name=\"ActionLeft\">"
102
- echo -e " g5=${ALLTITLES[count-1]}; g3=$count; button=1024;"
103
+ echo -e " g5=${ALLTITLES[tscount-1]}; g3=$tscount; button=1024;"
104
echo -e " jump vmgm menu entry title;</button>"
105
echo -e " <button name=\"ActionRight\">"
106
echo -e " g5=1; g3=1; button=1024;"
107
108
done
109
unset vmgmtitles
110
get_menu_titles "${VMGM_OPTS[@]}"
111
- if [[ -n ${VMGM_OPTS[@]} ]] && ((${#vmgmtitles[@]} != count)); then
112
+ if [[ -n ${VMGM_OPTS[@]} ]] && ((${#vmgmtitles[@]} != tscount)); then
113
usage_error "Number of titleset titles must equal the number
114
of titlesets. ( -vmgm ... -titles 'Title 1' 'Title 2' -end-vmgm )"
115
fi
116
117
yecho "One title for each titleset you are making."
118
yecho "Any other appropriate todisc options for the vmgm menu \
119
can be specified as well."
120
- if [[ ${#MENUTITLES[@]} -eq $count ]]; then
121
+ if [[ ${#MENUTITLES[@]} -eq $tscount ]]; then
122
yecho "Since -menu-title was supplied for each titleset: \
123
these titleset titles will be used:"
124
for t in "${MENUTITLES[@]}"; do echo "\"$t\""; done
125
VMGM_OPTS=(-titles "${MENUTITLES[@]}")
126
else
127
VMGM_OPTS[0]="-titles"
128
- for ((menu=1; menu<=count; menu++)); do
129
+ for ((menu=1; menu<=tscount; menu++)); do
130
VMGM_OPTS[menu]="Titleset $menu"
131
done
132
fi
133
134
else
135
unset vmgmtitles
136
get_menu_titles "${VMGM_OPTS[@]}"
137
- if ((${#vmgmtitles[@]} != 0)) && ((${#vmgmtitles[@]} != count)); then
138
+ if ((${#vmgmtitles[@]} != 0)) && ((${#vmgmtitles[@]} != tscount)); then
139
usage_error "Number of titleset titles must equal the number
140
of titlesets."
141
fi
142
143
shift
144
done
145
titleset_cmd=( todisc -titleset-mode -basedir "$WORK_DIR" \
146
- -title_count "$num_titles" -tset_num ${count}-${tset} \
147
+ -title_count "$num_titles" -tset_num ${tscount}-${tset} \
148
"${GEN_OPTS[@]}" $NO_CONFIRM_BACKUP "${TITLESET_OPTS[@]}" \
149
$vmgm_playall )
150
yecho
151
152
clr1="$colr1"
153
fi
154
155
- mk_rtn_cmd=(convert -size 100x80 xc:none \
156
+ mk_rtn_cmd=(convert +antialias -size 100x80 xc:none \
157
-strokewidth 1 -stroke "$colr2" -fill "$clr1" \
158
-draw 'rectangle 0,0 70,62' \
159
-fill "$colr2" -stroke none \
160
-draw "polyline 40,10 40,50 10,30 40,10" \
161
-draw "polyline 60,10 60,50 30,30 60,10" \
162
-fill "$colr2" -draw "rectangle 6,10 10,50" \
163
- -resize 30% -trim +repage +antialias "$outbutton")
164
+ -resize 30% -trim +repage "$outbutton")
165
print2log "Running ${mk_rtn_cmd[@]}"
166
"${mk_rtn_cmd[@]}"
167
mogrify -channel A -threshold 50% "$outbutton"
168
169
play_btn_dim=$(get_image_dim "$outbutton")
170
play_btn_width=$(awk -Fx '{print $1}' <<< $play_btn_dim )
171
play_btn_height=$(awk -Fx '{print $2}' <<< $play_btn_dim )
172
+ mogrify -channel A -threshold 50% "$outbutton"
173
}
174
175
check_menufile()
176
177
index=$2
178
outppm="$WORK_DIR/animenu/$(printf %06d%s $index .ppm)"
179
if [[ $fade_type = "crossfade" ]]; then
180
- value=$(bc -l <<< "scale=2; ($fade_slide + 1) * $fade_incr") >&2
181
+ value=$( ${bC} -l <<< "scale=2; ($fade_slide + 1) * $fade_incr") >&2
182
fade_cmd=(composite -blend $value -depth 8 "$overlay_ppm" \
183
"$base_ppm" "$outppm")
184
elif [[ $fade_type = "fadein" ]]; then
185
- value=$(bc -l <<< "scale=2; $fade_slide * $fade_incr") >&2
186
+ value=$( ${bC} -l <<< "scale=2; $fade_slide * $fade_incr") >&2
187
fade_cmd=(composite -depth 8 "$base_ppm" "$WORK_DIR/black.ppm" \
188
-blend ${value}% "$outppm")
189
elif [[ $fade_type = "fadeout" ]]; then
190
- value=$(bc -l <<< "scale=2;100 - (($fade_slide + 1) * $fade_incr)") >&2
191
- (( $(bc <<< "$value < 0") == 1 )) && value=0
192
+ value=$( ${bC} -l <<< "scale=2;100 - (($fade_slide + 1) * $fade_incr)") >&2
193
+ (( $( ${bC} <<< "$value < 0") == 1 )) && value=0
194
fade_cmd=(composite -depth 8 "$base_ppm" "$WORK_DIR/black.ppm" \
195
-blend ${value}% "$outppm")
196
fi
197
198
# check for multiple cpus if -jobs not passed already
199
#TODO always wait for either 1 or 2 processes - no need for if block later
200
if [[ -z $JOBS ]]; then
201
tovid-0.35.0.tar.gz/src/todisc-fade-routine -> tovid-0.35.2.tar.gz/src/todisc-fade-routine
Changed
18
1
2
3
init_gamma_array ()
4
{
5
-bc -l <<BC_EOF
6
+${bC} -l <<BC_EOF
7
pi=4*a(1);
8
9
start_frame=0
10
11
# Get values from standard in
12
# Format:
13
-# echo "29.97\n 300\n 10\n .1\n 5\n .05\n .1\n" | bc -l
14
+# echo "29.97\n 300\n 10\n .1\n 5\n .05\n .1\n" | ${bC} -l
15
frame_rate=$FRAME_RATE;
16
end_frame=$ANIMENU_ENDFRAME;
17
average=$1;
18
tovid-0.35.0.tar.gz/src/tovid-init -> tovid-0.35.2.tar.gz/src/tovid-init
Changed
172
1
2
#set -u
3
4
# Suite version
5
-TOVID_VERSION="0.35.0"
6
+TOVID_VERSION="0.35.2"
7
8
# String used to separate blocks of output
9
SEPARATOR="========================================================="
10
11
TOVID_FORUMS="http://groups.google.com/group/tovid-users"
12
TOVID_ISSUES="https://github.com/tovid-suite/tovid/issues"
13
14
+
15
# ******************************************************************************
16
# ******************************************************************************
17
#
18
19
HMS_SECS=$(awk -F ':' '{print $3}' <<< $1)
20
# allow integer to be passed, if so it will be echoed unchanged
21
if [[ $1 = *:* ]]; then
22
- TOT_SECONDS=$(bc <<< "($HMS_HOURS * 3600) + ($HMS_MINS * 60) + $HMS_SECS")
23
+ TOT_SECONDS=$( ${bC} <<< "($HMS_HOURS * 3600) + ($HMS_MINS * 60) + $HMS_SECS")
24
else
25
TOT_SECONDS=$1
26
fi
27
28
# Wait for input file to appear
29
# After a 30-second timeout, exit gracefully
30
CUR_TIME=30
31
- while test $CUR_TIME -gt 0; do
32
+ while test $CUR_TIME -gt 0; do
33
sleep 3
34
# If file exists, wait a few more seconds, then break out
35
if test -e "$FOP_OUTFILE"; then
36
37
38
# File size in bytes
39
FOP_LAST_SIZE=0
40
- FOP_CUR_SIZE=$(du -b "$FOP_OUTFILE" | awk '{print $1}')
41
+ # BSD compatibiity, yes I know parsing ls is bad
42
+ FOP_CUR_SIZE=$(ls -lnR "$FOP_OUTFILE" | awk 'END{print $5}')
43
44
# Keep looping until outfile stops getting bigger
45
while test "$FOP_CUR_SIZE" -gt "$FOP_LAST_SIZE"; do
46
47
"$ANIM_STR" "$FOP_MSG" "$FOP_CUR_MB" "$FOP_BASENAME_NAME"
48
49
# Doze a bit to let the file size increase
50
- # (SLEEP_TIME defaults to 1s if unset)
51
- sleep ${SLEEP_TIME-"1"}
52
+ # freebsd couldn't handle ${SLEEP_TIME-1} so leave at 1s
53
+ sleep 1
54
55
FOP_LAST_SIZE=$FOP_CUR_SIZE
56
- FOP_CUR_SIZE=$(du -b "$FOP_OUTFILE" | awk '{print $1}')
57
+ FOP_CUR_SIZE=$(ls -lnR "$FOP_OUTFILE" | awk 'END{print $5}')
58
done
59
$QUIET && printf "\n" || printf "\n\n"
60
}
61
62
bc_math()
63
# usage: bc_math "expression" [int]
64
{
65
- bc_out=$(bc <<< "scale=3;$1" 2>/dev/null)
66
+ bc_out=$( ${bC} <<< "scale=3;$1" 2>/dev/null)
67
if [[ -n $2 && $2 = "int" ]]; then
68
echo ${bc_out%.*}
69
else
70
71
printf "\n"
72
}
73
74
+# BSD's readlink behaves differently than GNU's. Use python instead
75
+# This is just a replacement for readlink -f which is used in our scripts,
76
+# though it could be adapted for other options easily enough.
77
+if [[ $(uname -s) =~ BSD ]]; then
78
+ readlink ()
79
+ {
80
+ local args out parent_dir;
81
+ args=();
82
+ for arg in "$@"; do
83
+ case "$arg" in
84
+ -[a-zA-Z0-9]) ;;
85
+ *) args+=($arg) ;;
86
+ esac;
87
+ done;
88
+ out="\"${args[*]}\"";
89
+ python -c "import os.path; print os.path.realpath($out)"
90
+ }
91
+fi
92
+
93
# ******************************************************************************
94
#
95
#
96
97
/proc/cpuinfo | head -n 1 | sed 's/^ *//g')
98
CPU_SPEED=$(awk 'BEGIN { IGNORECASE = 1 } /MHz/ { print $4 }' /proc/cpuinfo | head -n 1)
99
# Test for multiple CPUs. If they are available, try to use them.
100
- if test $(grep "^processor" /proc/cpuinfo | wc -l) -ge "2"; then
101
- MULTIPLE_CPUS=:
102
- else
103
- MULTIPLE_CPUS=false
104
- fi
105
+ cpu_count=$(grep "^processor" /proc/cpuinfo | wc -l)
106
+ ((cpu_count > 1)) && MULTIPLE_CPUS=: || MULTIPLE_CPUS=false
107
elif test "$KERNEL" = "Darwin"; then
108
- :
109
+ (( $(sysctl -n hw.ncpu) > 1 )) && MULTIPLE_CPUS=: || MULTIPLE_CPUS=false
110
+elif [[ $KERNEL =~ BSD ]]; then
111
+ cpu_count=$(sysctl hw.ncpu | awk '{print $2}')
112
+ ((cpu_count > 1)) && MULTIPLE_CPUS=:
113
+ CPU_MODEL=$(sysctl hw.model |sed 's/.*: \(.*\)@/\1/')
114
+ CPU_SPEED=''
115
fi
116
117
+# use gnubc on bsd systems (found in /usr/local)
118
+# bsd uses md5, which needs -r to print hash in 1st column
119
+if [[ $KERNEL =~ 'BSD' ]]; then
120
+ bC=/usr/local/bin/bc
121
+ md5=md5
122
+ md5sum="md5 -r"
123
+else
124
+ bC=$(which bc)
125
+ md5=md5sum
126
+ md5sum=md5sum
127
+fi
128
129
# ******************************************************************************
130
# Find multiple version kludge
131
132
[[ $TOVID_OUTPUT_DIR ]] && OUTPUT_DIR="$TOVID_WORKING_DIR"
133
[[ $TOVID_FFMPEG_CMD ]] && TOVID_FFMPEG="$TOVID_FFMPEG_CMD"
134
# FFmpeg and FFprobe are vars used for ffmpeg by scripts needing ffmpeg/avconv
135
-# if avconv is installed, use that unless env var set
136
-hash avconv 2>/dev/null && TOVID_FFMPEG=${TOVID_FFMPEG:-avconv}
137
-hash avprobe 2>/dev/null && TOVID_FFPROBE=${TOVID_FFPROBE:=avprobe}
138
+# if ffmpeg is installed, use that unless env var set
139
+if hash ffmpeg 2>/dev/null; then
140
+ TOVID_FFMPEG=${TOVID_FFMPEG:-ffmpeg}
141
+elif hash avconv 2>/dev/null; then
142
+ TOVID_FFMPEG=${TOVID_FFMPEG:-avconv}
143
+fi
144
+if hash ffprobe 2>/dev/null; then
145
+ TOVID_FFPROBE=${TOVID_FFPROBE:=ffprobe}
146
+elif hash ffprobe 2>/dev/null; then
147
+ TOVID_FFPROBE=${TOVID_FFPROBE:=avprobe}
148
+fi
149
# finally, default to ffmpeg if non of the above override it
150
+# this will cause the assert_dep to recommend installing ffmpeg
151
FFmpeg=${TOVID_FFMPEG:=ffmpeg}
152
[[ $FFmpeg =~ ffmpeg ]] && TOVID_FFPROBE=ffprobe
153
[[ $FFmpeg =~ avconv ]] && TOVID_FFPROBE=avprobe
154
155
# *************************************************************************
156
# Required Dependencies
157
# *************************************************************************
158
- core="grep sed md5sum mplayer mplex mpeg2enc yuvfps yuvdenoise ppmtoy4m mp2enc jpeg2yuv"
159
+ core="grep sed $md5 mplayer mplex mpeg2enc yuvfps yuvdenoise ppmtoy4m mp2enc jpeg2yuv"
160
161
# *************************************************************************
162
# Optional Dependencies
163
164
# Quit and complain if ANY core dependency is missing.
165
assert_dep "$core" "You are missing CORE tovid dependencies!"
166
# ffmpeg is also a part of core deps, but is taken care of here
167
- ffmpeg_alts="Use either ffmpeg (ffmpeg.org) or avconv (libav.org)."
168
+ ffmpeg_alts="Use ffmpeg from ffmpeg.org (recommended), or avconv from libav.org."
169
ffmpeg_pref="Set choice in ${USER_PREFS}. As in: TOVID_FFMPEG=ffmpeg"
170
assert_dep $FFmpeg "You are missing $FFmpeg ! $ffmpeg_alts ${ffmpeg_pref}."
171
172
tovid-0.35.0.tar.gz/src/tovid-init.in -> tovid-0.35.2.tar.gz/src/tovid-init.in
Changed
163
1
2
TOVID_FORUMS="http://groups.google.com/group/tovid-users"
3
TOVID_ISSUES="https://github.com/tovid-suite/tovid/issues"
4
5
+
6
# ******************************************************************************
7
# ******************************************************************************
8
#
9
10
HMS_SECS=$(awk -F ':' '{print $3}' <<< $1)
11
# allow integer to be passed, if so it will be echoed unchanged
12
if [[ $1 = *:* ]]; then
13
- TOT_SECONDS=$(bc <<< "($HMS_HOURS * 3600) + ($HMS_MINS * 60) + $HMS_SECS")
14
+ TOT_SECONDS=$( ${bC} <<< "($HMS_HOURS * 3600) + ($HMS_MINS * 60) + $HMS_SECS")
15
else
16
TOT_SECONDS=$1
17
fi
18
19
# Wait for input file to appear
20
# After a 30-second timeout, exit gracefully
21
CUR_TIME=30
22
- while test $CUR_TIME -gt 0; do
23
+ while test $CUR_TIME -gt 0; do
24
sleep 3
25
# If file exists, wait a few more seconds, then break out
26
if test -e "$FOP_OUTFILE"; then
27
28
29
# File size in bytes
30
FOP_LAST_SIZE=0
31
- FOP_CUR_SIZE=$(du -b "$FOP_OUTFILE" | awk '{print $1}')
32
+ # BSD compatibiity, yes I know parsing ls is bad
33
+ FOP_CUR_SIZE=$(ls -lnR "$FOP_OUTFILE" | awk 'END{print $5}')
34
35
# Keep looping until outfile stops getting bigger
36
while test "$FOP_CUR_SIZE" -gt "$FOP_LAST_SIZE"; do
37
38
"$ANIM_STR" "$FOP_MSG" "$FOP_CUR_MB" "$FOP_BASENAME_NAME"
39
40
# Doze a bit to let the file size increase
41
- # (SLEEP_TIME defaults to 1s if unset)
42
- sleep ${SLEEP_TIME-"1"}
43
+ # freebsd couldn't handle ${SLEEP_TIME-1} so leave at 1s
44
+ sleep 1
45
46
FOP_LAST_SIZE=$FOP_CUR_SIZE
47
- FOP_CUR_SIZE=$(du -b "$FOP_OUTFILE" | awk '{print $1}')
48
+ FOP_CUR_SIZE=$(ls -lnR "$FOP_OUTFILE" | awk 'END{print $5}')
49
done
50
$QUIET && printf "\n" || printf "\n\n"
51
}
52
53
bc_math()
54
# usage: bc_math "expression" [int]
55
{
56
- bc_out=$(bc <<< "scale=3;$1" 2>/dev/null)
57
+ bc_out=$( ${bC} <<< "scale=3;$1" 2>/dev/null)
58
if [[ -n $2 && $2 = "int" ]]; then
59
echo ${bc_out%.*}
60
else
61
62
printf "\n"
63
}
64
65
+# BSD's readlink behaves differently than GNU's. Use python instead
66
+# This is just a replacement for readlink -f which is used in our scripts,
67
+# though it could be adapted for other options easily enough.
68
+if [[ $(uname -s) =~ BSD ]]; then
69
+ readlink ()
70
+ {
71
+ local args out parent_dir;
72
+ args=();
73
+ for arg in "$@"; do
74
+ case "$arg" in
75
+ -[a-zA-Z0-9]) ;;
76
+ *) args+=($arg) ;;
77
+ esac;
78
+ done;
79
+ out="\"${args[*]}\"";
80
+ python -c "import os.path; print os.path.realpath($out)"
81
+ }
82
+fi
83
+
84
# ******************************************************************************
85
#
86
#
87
88
/proc/cpuinfo | head -n 1 | sed 's/^ *//g')
89
CPU_SPEED=$(awk 'BEGIN { IGNORECASE = 1 } /MHz/ { print $4 }' /proc/cpuinfo | head -n 1)
90
# Test for multiple CPUs. If they are available, try to use them.
91
- if test $(grep "^processor" /proc/cpuinfo | wc -l) -ge "2"; then
92
- MULTIPLE_CPUS=:
93
- else
94
- MULTIPLE_CPUS=false
95
- fi
96
+ cpu_count=$(grep "^processor" /proc/cpuinfo | wc -l)
97
+ ((cpu_count > 1)) && MULTIPLE_CPUS=: || MULTIPLE_CPUS=false
98
elif test "$KERNEL" = "Darwin"; then
99
- :
100
+ (( $(sysctl -n hw.ncpu) > 1 )) && MULTIPLE_CPUS=: || MULTIPLE_CPUS=false
101
+elif [[ $KERNEL =~ BSD ]]; then
102
+ cpu_count=$(sysctl hw.ncpu | awk '{print $2}')
103
+ ((cpu_count > 1)) && MULTIPLE_CPUS=:
104
+ CPU_MODEL=$(sysctl hw.model |sed 's/.*: \(.*\)@/\1/')
105
+ CPU_SPEED=''
106
fi
107
108
+# use gnubc on bsd systems (found in /usr/local)
109
+# bsd uses md5, which needs -r to print hash in 1st column
110
+if [[ $KERNEL =~ 'BSD' ]]; then
111
+ bC=/usr/local/bin/bc
112
+ md5=md5
113
+ md5sum="md5 -r"
114
+else
115
+ bC=$(which bc)
116
+ md5=md5sum
117
+ md5sum=md5sum
118
+fi
119
120
# ******************************************************************************
121
# Find multiple version kludge
122
123
[[ $TOVID_OUTPUT_DIR ]] && OUTPUT_DIR="$TOVID_WORKING_DIR"
124
[[ $TOVID_FFMPEG_CMD ]] && TOVID_FFMPEG="$TOVID_FFMPEG_CMD"
125
# FFmpeg and FFprobe are vars used for ffmpeg by scripts needing ffmpeg/avconv
126
-# if avconv is installed, use that unless env var set
127
-hash avconv 2>/dev/null && TOVID_FFMPEG=${TOVID_FFMPEG:-avconv}
128
-hash avprobe 2>/dev/null && TOVID_FFPROBE=${TOVID_FFPROBE:=avprobe}
129
+# if ffmpeg is installed, use that unless env var set
130
+if hash ffmpeg 2>/dev/null; then
131
+ TOVID_FFMPEG=${TOVID_FFMPEG:-ffmpeg}
132
+elif hash avconv 2>/dev/null; then
133
+ TOVID_FFMPEG=${TOVID_FFMPEG:-avconv}
134
+fi
135
+if hash ffprobe 2>/dev/null; then
136
+ TOVID_FFPROBE=${TOVID_FFPROBE:=ffprobe}
137
+elif hash ffprobe 2>/dev/null; then
138
+ TOVID_FFPROBE=${TOVID_FFPROBE:=avprobe}
139
+fi
140
# finally, default to ffmpeg if non of the above override it
141
+# this will cause the assert_dep to recommend installing ffmpeg
142
FFmpeg=${TOVID_FFMPEG:=ffmpeg}
143
[[ $FFmpeg =~ ffmpeg ]] && TOVID_FFPROBE=ffprobe
144
[[ $FFmpeg =~ avconv ]] && TOVID_FFPROBE=avprobe
145
146
# *************************************************************************
147
# Required Dependencies
148
# *************************************************************************
149
- core="grep sed md5sum mplayer mplex mpeg2enc yuvfps yuvdenoise ppmtoy4m mp2enc jpeg2yuv"
150
+ core="grep sed $md5 mplayer mplex mpeg2enc yuvfps yuvdenoise ppmtoy4m mp2enc jpeg2yuv"
151
152
# *************************************************************************
153
# Optional Dependencies
154
155
# Quit and complain if ANY core dependency is missing.
156
assert_dep "$core" "You are missing CORE tovid dependencies!"
157
# ffmpeg is also a part of core deps, but is taken care of here
158
- ffmpeg_alts="Use either ffmpeg (ffmpeg.org) or avconv (libav.org)."
159
+ ffmpeg_alts="Use ffmpeg from ffmpeg.org (recommended), or avconv from libav.org."
160
ffmpeg_pref="Set choice in ${USER_PREFS}. As in: TOVID_FFMPEG=ffmpeg"
161
assert_dep $FFmpeg "You are missing $FFmpeg ! $ffmpeg_alts ${ffmpeg_pref}."
162
163