Batch Splitter console utility
The Batch Splitter console utility (SMM_BatchSplit.exe) duplicates the Video Splitter video/audio trimming functionality in the console mode. It allows you to trim and join media files (See Supported File Formats for more details). The files and parameters should be described in the batch file (*.xtl) specified as the input parameter to the utility.
XTL batch file could be obtained by "Save Task List As..." command from Video Splitter's main window or Video Splitter Batch Manager "File" menu. See Batch file structure and XTL batch file samples for more details.
Usage:
BatchSplit.exe [-Llogfilename] [-LD log_dir] [-P profile] file.xtl
Parameters:
-L logfilename: Log filename. By default it equals to BatchSplit.log". Use the NULL value to disable logging.
-LD log_dir: Log files directory. Create log files from components involved in operation.
-P profile: Set codecs profile.
file.xtl: XTL Batch file path name.
Example:
BatchSplit.exe -L MySplitTaskLog.log D:\Video\SplitTasks\MySplitTask.xtl
Note: Batch Splitter console utility available only in the Video Splitter Business Edition
For more information see destinctions between Home Edition and Business Edition.
Batch file structure
Video Splitter batch files have the *.xtl, *.jxtl extensions and are based on the DirectShow Editing Services XTL format.
Note: All the sections and attributes are case-sensitive and must be in the lower case. The values must be enclosed in quotation marks ("").
timelines Element
The timelines element is the root XML node.
Example:
<timelines version="2">
</timelines>
Attributes:
Attribute name | Possible values | Required | Description |
version | 2 | Yes | The name attribute specifies the output filename with its path |
Parent/Child Information:
Parent | Children |
none | timeline |
timeline Element
The timeline element describes particular timeline.
Example:
<timeline>
</timeline>
Attributes:
no attributes specified.
Parent/Child Information:
Parent | Children |
timelines | group |
group Element
The group element defines output files parameters.
Example:
<group name="..." mode="...">
</group>
Attributes:
Attribute name | Possible values | Required | Description |
output | string with file path name | No | Specifies the output file name with it's path |
out_type | see Output file types |
No | Specifies output file type. Note: This parameter should be set depending on input format and video audio codec. |
outdir | string with file path | No | Specifies the output files' path for tasks with multiple files output |
outmask | see Output file mask format | No | Specifies the output files' mask for task with multiple files |
compatibility | see Compatibility types | No | Specifies the output files compatibility |
Output file types:
avi - Audio Video Interleave
asf, wmv - Window Media Video
wma - Windows Media Audio
mpa, mp3, mp1 - MPEG audio
mpg_ts - MPEG2 transport
stream
mpg_ps - MPEG2 program stream
mpg_ves - MPEG2 video
elementary stream
mpg1_sys - MPEG1 system stream
mpg1_ves - MPEG1 video
elementary stream
avc_ves - AVC video elementary
stream
wav - Waveform Audio
matroska - Matroska
mp4 - MPEG-4 Part 14 file
format
flv - Flash Video
gif - Animated GIF
yuv - I420 YUV
raw - Raw format
Compatibility types:
original - Ordinary
file
GeoVision - GeoVision
RemoteView compatible file
BlueSonicF008 - DVR
BlueSonic F008 file
Parent/Child Information
Parent | Children |
timeline | track |
task Element
The task element defines operation that is applied to timeline.
Example:
<task type="..." time="..." timeFormat="..."/>
Attributes:
Attribute name | Possible values | Required | Description |
type | joining, indexation, autosplit | No | Specifies the task type. See Task types for detais |
time | time string | No | Specifies the time parameter for task |
timeFormat | 100ns_units, time10ms, parts, bytes |
No | Specifies how to interpret value specified in time attribute. See time format types By default timeFormat equals to 'time10ms'. |
Task types:
joining - Join should
be applied to timeline
indexation - Indexation operation should be applied to
clip
autosplit - Slicing by time, by size, into parts should
be applied to timeline
Parent/Child Information:
Parent | Children |
group | none |
track Element
The track element is container for clip elements it defines common attributes for clips if it is not set.
Example:
<track video="..." audio="..." text="..." obey_sample_times="..."
accuracy="..." compatibility="..." flags="...">
</track>
Attributes:
Attribute name | Possible values | Required | Description |
video | any number | No | Specifies the number of video stream. The 0 value means no video stream. The -1 value means - all video streams |
audio | any number | No | Specifies the number of audio stream. The 0 value means no audio stream. The -1 value means - all audio streams |
text | any number | No | Specifies the number of text stream. The 0 value means no audio stream. The -1 value means - all text streams |
obey_sample_time | 0, 1 | No | The obey_sample_times attribute specifies whether an alternative synchronization algorithm should be used: 0 = Do not use obey_sample_time 1 = Use obey_sample_time By default, obey_sample_time equals to 0 |
accuracy | see Trimm accuracy types | No | Specifies accuracy type in trimming operaion |
compatibility | see Compatibility types | No | Specifies graph compatibility option for operation |
flags | see Trimm flags for details | No | Specifies coma separated options used in trimming operation. See Trimm flags for details |
Trimm accuracy types:
frame - Frame
accuracy
gop - K-frame (GOP) accuracy
Parent/Child Information:
Parent | Children |
group | clip |
clip Element
The clip specifies the media source.
Example:
<clip src="..." index="..." video="..." audio="..." text="..."
start="..." stop="..." timeFormat="..." flags="..."/>
Attributes:
Attribute name | Possible values | Required | Description |
src | string with file path name | Yes | Specifies the path name of the input media file |
index | string with index file path name | No | Specifies the path name of the input media file' index |
video | any number | No | Specifies the number of video stream. The 0 value means no video stream. The -1 value means - all video streams |
audio | any number | No | Specifies the number of audio stream. The 0 value means no audio stream. The -1 value means - all audio streams |
text | any number | No | Specifies the number of text stream. The 0 value means no audio stream. The -1 value means - all text streams |
start | time string | No | The start time of the fragment. See time format types for details |
stop | time string | No | The stop time of the fragment. See time format types for details |
timeFormat | 100ns_units, time10ms, position |
No | Specifies time format for start, stop attributes. If not specified - 'time10ms'. See time format types for details |
flags | see Trimm flags for details | No | Specifies coma separated options used in trimming operation. See Trimm flags for details |
Time format types:
100ns_units - Value
is interpreted as 100ns Units ( 1 sec = 1e7 UNITS)
time10ms - Value is set in format "HH:MM:SS.mS"
position - Value is set using key words: "begin",
"end"
bytes - Value is interpreted as bytes count
parts - Value is interpreted as parts count
Trimm flags:
audio_silence - audio will be muted on fragment
interlaced_fields_alignment - enable navigation to interlaced fields on AVC video
mpeg2_padding - enable padding on MPEG2 streams
keep_mpeg_closedcaptions - saving MPEG2 closed captions data on re-encoded frames
keep_mpeg2ts_pids - keep MPEG TS PIDs
singlethread_mpeg2encoder - enable single thread mode in elecard mpeg2 encoder
write_rtp_hint_tracks - MP4 files streaming made compatible with Darwin Streaming Server by creating RTP hint tracks
keep_rtp_hint_tracks - MP4 files streaming made compatible with Darwin Streaming Server by keeping RTP hint tracks
Parent/Child Information:
Parent | Children |
track | no |
XTL batch file samples
Trimming
<timelines version="2" > <timeline> <group output="C:\Base\output\2a2v_0001.avi" > <track video="1" audio="2" accuracy="frame" > <clip src="C:\Base\avi\2a2v.avi" start="00:00:00.00" stop="00:12:32.00" /> <clip src="C:\Base\avi\2a2v.avi" start="00:32:41.00" stop="00:42:02.00" /> <clip src="C:\Base\avi\2a2v.avi" start="00:54:09.00" stop="01:08:51.00" /> </track> </group> </timeline> <timeline> <group output="C:\Base\output\2a2v_0002.avi" > <track video="1" audio="1" accuracy="frame" > <clip src="C:\Base\avi\2a2v.avi" start="00:00:00.00" stop="00:12:32.00" /> <clip src="C:\Base\avi\2a2v.avi" start="00:32:41.00" stop="00:42:02.00" flags="audio_silence" /> <clip src="C:\Base\avi\2a2v.avi" start="00:54:09.00" stop="01:08:51.00" /> </track> </group> </timeline> <timeline> <group output="C:\Base\output\H263_PCM_0001.avi" > <track video="1" audio="0" accuracy="gop" > <clip src="C:\Base\avi\H263_PCM.avi" start="00:11:48.08" stop="00:20:14.52"/> </track> </group> </timeline> </timelines> |
3 files will be created as a result:
- C:\video\result\2a2v_0001.avi - the file will consist of three sequential fragments from C:\video\2a2v.avi
Start Time | End Time |
00:00:00.00 | 00:12:32.00 |
00:32:41.00 | 00:42:02.00 |
00:54:09.00 | 01:08:51.00 |
- C:\video\result\2a2v_0002.avi - the file will consist of three sequential fragments from C:\video\2a2v.avi as for the first timeline but the second fragment audio will be muted.
- C:\video\result\H263_PCM_0001.avi - the file will consist of one fragment from C:\video\H263_PCM.avi
Start Time | End Time |
00:11:48.08 | 00:20:14.52 |
The file will contain only the video stream. Total duration of the output file may be different, because the trimming is GOP-accurate.
Indexation
<timelines version="2"> <timeline> <group output="C:\video\a.mpg.mlmix" > <task type="indexation"/> <track > <clip src="C:\video\a.mpg" /> </track> </group> </timeline> </timelines> |
As a result, the index file would be created for the corresponding MPEG-2 file specified in the clip
Joining
<timelines version="2" > <timeline> <group output="C:\Test_full.mp3"> <task type="joining" /> <trackvideo="-1" audio="-1" > <clip src="C:\Test_part0.mp3" /> <clip src="C:\Test_part1.mp3" /> <clip src="C:\Test_part2.mp3" /> </track> </group> </timeline> </timelines> |
As a result, a file containing all parts specified in each clip in the specified order will be created
Slicing
<timelines version="2" > <timeline> <group outdir="C:\Base\output\" outmask="[source]_[n:4]" > <task type="autosplit" time="900000000" timeFormat="100ns_units" /> <trackvideo="1" audio="1" > <clip src="C:\Base\avi\a.avi" start="begin" stop="end" timeFormat="position" /> </track> </group> </timeline> </timelines> |
As a result, media file a.avi will be splitted into parts by time (1.5 minutes each one) and saved to C:\Base\output\ as separate files
File with multiple audio streams trimming
<timelines version="2" > <timeline> <group output="G:\output\Video_with_multiple_audio_tracks_0001.avi" > <track video="1" audio="1" text="0" accuracy="gop" > <clip src="C:\Users\olga\Videos\Video_with_multiple_audio_tracks.avi" start="128400000" stop="182800000" timeFormat="100ns_units" /> </track> <additional_param audio="2"/> </group> </timeline> </timelines> |
As a result, a file containing one video track and two audio tracks will
be created and saved to G:\output\.
The file consist of one fragment with the start time position
00:00:12;21 and end time position 00:00:18;07.
File with external subtitles trimming
<timelines version="2" > <timeline> <group output="G:\output\Video_0001.mp4" > <track video="1" audio="1" text="0" accuracy="frame" > <clip src="C:\Users\olga\Videos\Video.mp4" start="3410490416" stop="7623449166" timeFormat="100ns_units" /> </track> </group> <group output="G:\output\Video_0001.HUNTA & Fratelli.ass" > <track video="0" audio="0" text="1" > <clip src="C:\Users\olga\Videos\Video.HUNTA & Fratelli.ass" start="3410490416" stop="7623449166" timeFormat="100ns_units"/> </track> </group> </timeline> </timelines> |
As a result, a file containing fragment with start time 00:05:41;00 and end time 00:12:42;03 and external ASS subtitles will be created.