summaryrefslogtreecommitdiffstats
path: root/debian/transcode/transcode-1.1.7/docs/import-xml.txt
blob: 24e286b9aba40dade5f398d495a35751ed6b187c (plain)
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
Import_xml Documentation

Last update 2003/06/27 Marzio Malanchini <[email protected]>

---------------
* Index
---------------
  - Overview
  - Schema
  - Usage
  - Requierements
  - Examples
  - SMIL extract
  - Changelog
  - Todo



---------------
* Overview
---------------

The import_xml module is based on a SMIL2 directive (http://www.w3.org/2001/SMIL20/Language) and it was initially designed to manage the smil file produced by kino (http://www.schirmacher.de/arne/kino) .
Now it has some features (not supported by kino) that enable transcode to work in a different mode respect to the basic use: for example it's possible to force transcode to work with different sources in the same session (for instance only with dv, avi, mov (all mov supported by import_mov plus quicktime_dv generated by kino) or manage video sources with different height and width (for example a PAL with NTSC).


---------------
* Schema
---------------


  /---------\				/---------\
  |          |				|  load    |
  |transcode |--> autoprobe xml------->	| import   |
  |          |				|  xml     |
  \---------/				\---------/
					    |
					    | det. source
                                           \ /
					    |
				____________|________________
				|	    |		     |
				|	    |		     |
  			  /---------\   /---------\     /---------\
  			  |video.dv |   |         |     |         |
  spec. source processor  |    +    |   |video.mov|     |video.avi|
  			  |audio.avi|   |         |     |         |
  			  \---------/   \---------/     \---------/
     				\___________|_______________/
                           	            |
					   \ /
                           	            |
                     	     	     /--------------\
                     		     |internal filter|
   /---------\         		     \--------------/
   |transcode |            	            |
   |  filter  |_____________________________/
   |  module  |
   \---------/
	|
	|
   /---------\
   |  normal  |
   |transcode |
   |  flow    |
   \---------/


---------------
* Usage
---------------

import_xml module gets its options from transcode command line (such as -Q -d etc.) and from the smil file.

A simply way to use the import_xml module is to build an smil file like this:

------ start my.smil ----
<?xml version="1.0"?>
<smil xmlns:smil2="http://www.w3.org/2001/SMIL20/Language">
        <seq>
                <video src="/mnt/hd/avi/mare008.avi" clipBegin="0" clipEnd="200"/>
        </seq>
        <seq>
                <video src="/mnt/hd/avi/mare009.avi" clipBegin="smpte=00:00:10" clipEnd="20s"/>
                <audio src="/mnt/hd/avi/new-audio.avi" clipBegin="smpte=00:00:10" clipEnd="20s"/>
        </seq>
</smil>
------ end my.smil ----

and run

transcode -i my.smil -y .............

The smil file is auto probed by transcode (it's possible to force the option -x xml)

The first 2 lines define the namespace
Each sequences are include in <seq> tag and for instance is possible to define two tag <video> and <audio> .
By default audio track is taken from the <video> file but, if <audio> tag is present the module use this as audio track (the length of audio track must be the same of the video one).
Inside the <audio> and <video> tags it's possible to declare two properties: clipBegin and clipEnd: if clipBegin and/or clipEnd are not defined, all frames are processed by the input module.  The metric is conform to SMIL2 directive: see SMIL extract

All audio track can be override by pass to transcode an other smil file that specify the audio tracks.

e.g.

transcode -i my.smil -p my-audio.smil -y .............

where my-audio.smil
------ start my-audio.smil ----
<?xml version="1.0"?>
<smil xmlns:smil2="http://www.w3.org/2001/SMIL20/Language">
        <seq>
                <audio src="/mnt/hd/avi/alternative-audio.avi" clipBegin="0" clipEnd="200"/>
        </seq>
        <seq>
                <audio src="/mnt/hd/avi/alternative-audio.avi" clipBegin="201" clipEnd="550"/>
        </seq>
</smil>
------ end my-audio.smil----


In  each <audio> and <video> tag is possible to define <param> tag and this is useful to override some autoprobe parameter or activate feature

in-audio-module 		 	define the module that will be used by the import_xml module;
					only dv,mov and avi are currently supported.

in-video-module                      	define the module that will be used by the import_xml module;
					only dv,mov and avi are currently supported.

in-audio-codec                     	define the codec that will be used by the import_xml module;
					only pcm and mov related are currently supported.

in-video-codec                     	define the codec that will be used by the import_xml module;
					only yuv2 rgb yu12 yuy2 (for --dv_yuy2_mode) and raw are currently supported.

target-height				set the size of target height

target-width				set the size of target width

resize-filter				choose between bell|box|mitchell|hermite|B_spline|triangle|lanczos3 resize filter (default lanczos3)


e.g.

------ start resize.smil ----
<?xml version="1.0"?>
<smil xmlns:smil2="http://www.w3.org/2001/SMIL20/Language">
	<seq>
		<video src="/mnt/hd/avi/mare-ntsc.mov" clipBegin="0" clipEnd="100">
			<param name="in-video-codec" value="rgb"/>
		        <param name="target-width" value="352"/>
		        <param name="target-height" value="288"/>
        		<param name="resize-filter" value="mitchell"/>
		</video>
	</seq>
</smil>
------ end resize.smil ----


In one smil file it's possible to combine different video sources (PAL,NTSC) with different height and width: in that case it's necessary to declare target-height and/or target-width (or vice versa).
VERY IMPORTANT: any resize option passed from command line are ignored if target-width or target-height parameter is setting in the smil file.

It's possible to use in the same xml file different file type (i.e. avi, dv, mov...).


---------------
* Requierements
---------------

import_xml require libxml2 to be compiled in transcode (if present import_xml is enable by default)


---------------
* Examples
---------------

1) Manage different source with the same heigth and width in the same smil file (clipBegin and clipEnd in frames)

<?xml version="1.0"?>
<smil xmlns:smil2="http://www.w3.org/2001/SMIL20/Language">
	<seq>
		<video src="/mnt/hd/avi/mare-01.mov" clipBegin="0" clipEnd="100"/>
	</seq>
	<seq>
		<video src="/mnt/hd/avi/mare-02.avi" clipBegin="0" clipEnd="100"/>
	</seq>
</smil>


2) Manage different source with different heigth and width in the same smil file (clipBegin and clipEnd in different format)

<?xml version="1.0"?>
<smil xmlns:smil2="http://www.w3.org/2001/SMIL20/Language">
	<seq>
		<video src="/mnt/hd/avi/mare-01.mov" clipBegin="00:00:12" clipEnd="50s">
		        <param name="target-width" value="352"/>
		        <param name="target-height" value="288"/>
        		<param name="resize-filter" value="bell"/>
		</video>
	</seq>
	<seq>
		<video src="/mnt/hd/avi/mare-ntsc.avi" clipBegin="24" clipEnd="10s">
        		<param name="resize-filter" value="mitchell"/>
		</video>
	</seq>
</smil>


3) Override autoprobe parameter

<?xml version="1.0"?>
<smil xmlns:smil2="http://www.w3.org/2001/SMIL20/Language">
	<seq>
		<video src="/mnt/hd/avi/mare015.dv" clipBegin="10" clipEnd="60"/>
		<video src="/mnt/hd/avi/mare016.dv" clipBegin="10" clipEnd="60"/>
		<video src="/mnt/hd/avi/mare014.dv" clipBegin="10" clipEnd="60">
			<param name="in-video-module" value="dv"/>
			<param name="in-audio-module" value="dv"/>
			<param name="in-video-codec" value="rgb"/>
			<param name="in-audio-codec" value="pcm"/>
		</video>
	</seq>
</smil>


---------------
* SMIL extract
---------------


Taken from SMIL MediaClipping Module "....

Values in the clipBegin and clipEnd attribute have the following syntax:
Clip-value-MediaClipping ::= [ Metric "=" ] ( Clock-val | Smpte-val )
Metric            ::= Smpte-type | "npt"
Smpte-type        ::= "smpte" | "smpte-30-drop" | "smpte-25"
Smpte-val         ::= Hours ":" Minutes ":" Seconds
                      [ ":" Frames [ "." Subframes ]]
Hours             ::= Digit+
Minutes           ::= Digit Digit; range from 00 to 59
Seconds           ::= Digit Digit; range from 00 to 59

Frames            ::= Digit Digit; smpte range = 00-29, smpte-30-drop range = 00-29, smpte-25 range = 00-24
Subframes         ::= Digit Digit; smpte range = 00-01, smpte-30-drop range = 00-01, smpte-25 range = 00-01




SMPTE Timestamp
SMPTE time codes [SMPTE] can be used for frame-level access accuracy. The metric specifier can have the following values:

	smpte

	smpte-30-drop
	These values indicate the use of the "SMPTE 30 drop" format (approximately 29.97 frames per second), as defined in the SMPTE specification (also referred to as "NTSC drop frame").
	The "frames" field in the time value can assume the values 0 through 29. The difference between 30 and 29.97 frames per second is handled by dropping the first two frame indices
	(values 00 and 01) of every minute, except every tenth minute.

	smpte-25
	The "frames" field in the time specification can assume the values 0 through 24. This corresponds to the PAL standard as noted in [SMPTE]
	The time value has the format hours:minutes:seconds:frames.subframes. If the subframe value is zero, it may be omitted. Subframes are measured in one-hundredths of a frame.
		Examples:
		clipBegin="smpte=10:12:33:20"

Normal Play Time

	npt
	Normal Play Time expresses time in terms of SMIL clock values. The metric specifier is "npt", and the syntax of the time value is identical to the syntax of SMIL clock values.
		Examples:
		clipBegin="npt=123.45s"
		clipBegin="npt=12:05:35.3"

....."


---------------
* Changelog
---------------

2003-07-09 * docs/import-xml.txt import/import_xml.c import/ioxml.c import/af6_decore.cpp import/magic.h
- enable support for all source files readable by avifile (af6).

2003-06-26 * docs/import-xml.txt /import/import_xml.c import/ioxml.c import/ioxml.h import/Makefile.am import/probe_xml.c import/tcxmlcheck.c src/transcode.c docs/man/tcxmlcheck.1 docs/man/tcdecode.1 docs/man/transcode.1:
- change the evaluation order of audio parameter (priority: -p audio.smil, <audio> tag and then <video> tag)
- review of syncronization time for ntsc and pal
- support for source with different height and width
- adding target-height target-width and resize-filter
- document file rewritten

2003-05-30 * docs/import-xml.txt import/import_xml.c import/ioxml.c:
- enable support for libdv-yuy2.

2003-05-13 * docs/import-xml.txt import/decode_mov.c import/import_xml.c import/ioxml.c import/ioxml.h import/Makefile.am import/probe_mov.c import/probe_xml.c import/tcdecode.c import/tc.h:
- manage quicktime (as import_mov) , avi and dv file in the same xml
- manage quicktime_dv format (generated by kino not yet supported by import_mov)
- tcdecode can manage mov input file
- enable new parameters in the PARM option (see file import-xml.txt under docs directory )               `

2003-04-18 * import/ioxml.c, docs/import-xml.txt:
- allow ioxml to handle the multiple video and audio elements in the same seq statement

2003-04-09
- manage different file type in the same xml (only for dv and avi created with dvgrab/kino)
- add a program to check the consistence of xml file
- enable new parameters in the PARM option (see file import-xml.txt under docs directory )

2003-01-09
- patch for probe_xml.c
2002-06-08
- patch for import_xml.c
2002-03-27 * docs/import_xml.txt import/import_xml.c
- update for import_xml.c
2002-03-20 * first release of import_xml




---------------
* Todo
---------------

- autobuild the xml file
- extension to manage mpeg file (mpeg1,mpeg2)