|
|
AsfBin Version 1.7.14
Quick Links: What's New | Command Line | Sample usage
AsfBin is an old Asfcut successor. That means, no newer version of AsfCut will
be realeased. Because AsfCut was using Windows Media Format SDK, which
contained quite serious bugs which I wasn't able to work around, I decided to
write my own, so to say, SDK. ;-)
AsfBin is a command line utility for cutting out fragments, joining, editing
and repairing ASF files. AsfBin can be applied to any ASF file, that is, not only
to those with ASF extension but also those with WMV and WMA extensions.
Precision, speed and the maximum fidelity was my top priorities in desing of the AsfBin
software. Not to mention, of course, reliabilty of this tool.
The whole operation is performed without recompression of the whole file. On a user demand,
only a couple of first samples may be recompressed to give the ultimate precision in cutting.
Because of that, the video quality is not degraded and the resulting file
remains as unchanges as possible.
In the previous versions of the result of an operation was always one media
file. But since version 1.5 a -sep option was introduced to allow a user to
save each selected range to a separate file. Other unique feature is
the ability to recreate key frames basing on progressive ones, thus
allowing to cut the video at any desired time position.
Because AsfBin do not rely on ASF file index, it can skip damaged area
and repair the data stream starting from first good samples.
Features:
- cutting fragments out of all ASF files (*.asf, *.wmv,...),
- precise file joining,
- repairing damaged and/or unseekable ASF files (*),
- loseless processing,
- creating loops,
- ability to remove streams,
- adjusting packet size,
- adjusting buffer window,
- ability to removing scripts, markers,
- saving segments to a separate ASF files,
- inverting selection, so you can easily point the fragment to be deleted,
- adding markers and commands,
- delaying selected streams (not necessarily audio streams),
- printing out information on key frames location and index entries,
- control over the type of indexing,
- cutting fragments adjusted precisely to key frames locations,
- optimizing packet size,
- debugging ASF files,...
*) For all people who could not repair or process their asf files:
If you tried all possible ways using AsfBin and the tool couldn't do what you needed,
or it just simply crashed, go to the AsfBin Bugs section.
There you can find latest release information and maybe the issue is already
described there. You will find out how to contact me, so I could get the problematic
file and work on how to improve AsfBin.
This tool is FREE for non-commercial use.
If you want use it for business purposes, please proceed to a Licencing section.
Back to top
What's new in version 1.7.14
- Corrected issue with processing over 4GB files.
- Corrected problem with scripts not beeing copied from the original
file if copying range was not specified.
- Corrected the issue with the script samples distance limitation that
was set to 65s. Now it can be unlimited.
What's new in version 1.7.1
- Totally rewritten sample packing algorithm so even multiaudio
files with no video are packed optimally. This will also fix
problems with files containing script commands and some issues with
streaming ASF files via Windows Media Server.
- Finally added DMO support when recompressing video. By using one
of two new switches -vcm and -dmo a desired technology can be
selected. By default it is VCM.
- Added -infohdr switch to show all info from ASF header.
- Added -optps switch that calculates the optimal size of the packet
to minimize data padding.
- Corrected timing of script commands and markers stored in the header
after cutting out fragments from an original file when actual start
time differs from demanded time due to distand key frame location.
- Removed size limitation of record data in metadata objects in header.
What's new in version 1.6.1
- The total file size info kept in the ASF header was not properly
updated. This resulted in lack of seeking possibilities when streaming
processed file via Windows Media Server.
- Bug connected with processing files containing script command stream
corrected. The total time spread of all samples gathered in a single
packet could go beyond 65536 ms, what was against ASF specification.
- Asfbin was losing last script command sample. This bug is corrected
in this version.
What's new in version 1.6.0
- FINALLY! After 3 years! Solved the mistery behind the old tape effect
in the Windows Media Player - defeated buggy jitter correction algorithm
in the MS WMPlayer produtcs! It was possible by adding audio
decompression feature to asfbin and thus real sample duration measurement
became possible. An advanced junction optimization algorithm was implement
resulting in smooth connections between audio tracks of joined
ASF files.
- Added new switches allowing to set creation time of a resulting file
to the time of the source file properly corrected by the start time
offset (-act). Second related switch is -nots which causes all sample
times remain as in original files.
- Added possibility to process files still recorded by live stream
recording software or WMS archive plugin.
Other corrections was made in order to repair almost all cases of
damaged files.
- Optimized file processing. Time spared thanks to those optimizations
is used to calculate precise audio junctions (this needs some audio
samples to be uncompressed).
- Some minor issues with segment cutting and joining were corrected.
- Thousands of tests was performed to find and correct any existing
bugs.
What's new in version 1.5
- New quality in cutting ASF files! AsfBin is capable to cut files
at any position with the accuracy to one video frame regardless
there is a key frame or not, while maintaining maximum fidelity
to the original. To enable this feature use -rkf switch. This is
not enabled by default because so far not all video formats are
supported.
- To perform system configuration check in order to enable as many
codecs as possible for AsfBin use -cfg switch. AsfBin performs
this check anyway, but only once for given Windows configuration.
- Improved recovery of damaged ASF files.
What's new in version 1.1
- Ability to save each segment to a separate ASF file using -sep switch.
- Inverting selection, so you can easily point the fragment to be deleted.
- Adding markers and commands specified by a text file.
- Delaying selected streams (not necessarily audio streams). Information
on stream numbers can be obtained by using -info switch.
- New version can list all key frames with their time time location.
This allows to select more precisely the cutting time of segments.
- Control over the type of the created index. New switch -sionly and
improved -forceindex.
- A new switch -ebkf causes a fragment to end precisely just before the
next key frame.
- Major improvements in parsing engine as I received a number of ASFs
which couldn't be repaired by the version 1.0.3, so I was able to corrent
problems and finally make a new asfbin be able to repair them all.
Of course some files were so damaged that even with an expert support
it could be hard to do this, if possible at all.
- Speed improvements especially for improperly build ASF files.
- Code review also unveiled quite many bugs that wasn't reported yet.
What's new in version 1.0.3
- Improved packet data repair routines. Some damages (1-3 bytes long)
withing packet or sample data can be repaired.
- Improved searching for time range withing data packets when
some packets are damaged or not conforming ASF specification.
- Removed bug causing script commands not to be written.
- Correcting bug causing bad padding data handling. Speeding up
packets reading.
- Other improvements of data packets reading.
- Improved header reading routines. Asfbin is much more error-proof
when it comes to header parsing.
- Asfbin can now index files larger than 4GB.
- When connecting a file with the script commands or markers with
a file having no such objects, asfcut was crashing. This bug
is removed.
What's new in version 1.0.2
- Major Win95, 98, Me incompatibilities fixed. The function for opening
files were Unicode version only. That caused no input file could be
opened by asfbin in the Win9x. That proofs clearly that asfbin 1.0.1
wasn't "strongly" tested under Win9x enviroment. ;-)
- Major improvements in a header parsing code. Now some errors in the header
will cause only minimal loss of data.
- Code review detected many weak points, where application might crash.
- Limit to pack only one audio sample in a packet was removed.
The limit was introduced because some players were loosing audio
when playing resulting files. And I supposed that the lack of this
limitation was causing such a behavior. It was not true.
Also processing of some files could be very slow.
- Files with empty streams (with no samples in it) were processed
terribly slow. This bug is already removed.
- Removed a bug connected with indexing of files having hidded streams.
- When removing a stream the information on bitrate mutual exclusion
wasn't updated. Now it is correct.
- In some very rare case packets were built inefficiently breaching
ASF specification. Also for some very large packet sizes, payload
count could overflow the limit of 64 payload per packet.
Already correct.
What's new in version 1.0.1
- Corrected minor bug in the displaying duration of processed
segments. The on-screen message said alway that duration was
to the end. The output files weren't affected by this bug.
- Corrected bugs when reading segments from segments file.
- Corrected bug cousing file not to be written when the first sample
time was smaller than the preroll time.
Back to top
Usage:
asfbin [INPUT MEDIA FILES] -o <out_file> [SWITCHES]
[INPUT MEDIA FILES] are as follow:
| -i <infile>
|
<infile> is an input windows media file.
Switch -i can be repeated many times. E.g.:
asfbin -i test01.asf -i test02.asf -i D:\video\append\test03.asf -o joined.asf
|
| -l <in_file_list>
|
<in_file_list> is a file containing list of file paths to join.
List file is a text file containing subsequent files to join/cut. E.g.:
D:\Video\test01.asf
D:\Video\test02.asf
D:\Video\append\test.asf
All files have to be of the same video and audio format!
|
[SWITCHES] are as follow:
| -s (or -sep)
|
write each segment to a separate file.
Output file name will be treated like a name template
where all occurences of {000} or { } are replaced by
the segment number. If {0} is not present, a number will
be inserted right before the file name extension.
E.g. "MyName0001.asf". "{000}" is replaced by e.g. "001",
and "{ }" is replaced by " 1".
|
| -s <segments_list>
|
<segments_list> file containing list of segments to extract,
|
-a <attrib_list> (or -attr)
|
file containing list of attributes to set. |
-m <marker_list> (or -markers)
|
<marker_list> is a name of a file containing a list of markers to set.
Each line of this file should consists of a pair:
<time> <marker text>
E.g.
0:00:45 The fourty fifth second.
Allowed time formats are explainded below.
|
-k <script_list> (or -scripts)
|
<script_list> is a file name containing a list of scripts to set.
Each line of this file should consists of:
<time> <type> <command>
E.g.
15 URL http://www.radioactivepages.com
This script command will cause that at 15th second a default internet
browser will run with a url set to http://www.radioactivepages.com.
Apart from the "URL" type, there is also other type of command supported
by WMP, namely "FILENAME". This causes WMP to open a specified file
after reaching specified timestamp.
Allowed time formats are explainded below.
|
| -cfg (or -config) |
forces codecs configuration check. By default AsfBin performs it only once on a given
system.
|
| -start <times> |
starts copying from specified time,
|
| -dur <times> |
copies segment of specified time,
these two switches can be repeated many times,
each pair defining a new segment to extract,
|
-stop <times> (or -end)
|
stops copying at specified time, |
-invert (or -invertsel, -invsel)
|
inverts selection. Specified segments will be removed |
| -repeat <n> |
repeats the entire resulting file <n> times. |
| -istart |
doesn't wait for key frame. Files are joined without any
advanced fitting. Can be used for files previously cut.
By default copying starts after finding a key frame. |
| -cvb |
copies very beginning of an input file
discarding even finding key frame
when joining too or more files, |
-brkaud (or -breakaudio, -ba)
|
audio streams junctions will be marked as gap.
Since version 1.6 this option is turned off by default.
If still some problems with audio are experinced when
playing with MS WMPlayer (any version) then please turn
this option on. Other players like Media Player Classis
are free from this bug.
|
| -brkvid (or -breakvideo, -bv) |
video streams junctions will be marked as gap. This option may be
usefull when joining two files encoded by slightly different versions of codec what
may cause artefacts appear on segment junctions. |
| -ebkf |
streams will end before nearest past key frame, |
| -uniq (or -unique, -u) |
makes resulting files unique by changing original ASF file identificators
into unique ones. May be useful when using playlist capability of Windows Media Player
which appears to take into consideration only this ID when distinguishing media files. |
| -act (or -aft) |
adjusts creation time of the file to the time of
creation of the original file plus start time. |
| -nots |
leaves sample times and packet times unchanged. |
| -rkf (or -recreatekf) |
enables a single frame accuracy by turning on recreation of key frames whenever it is necessary.
This mode does not guarantee correct results. While it is highly likely that WMV3, MP42 and MP43
video formats will be correctly handled, all other formats will not be probably recognized, |
| -dmo |
forces using DMO when recompressing video samples, |
| -vcm |
forces using VCM when recompressing video samples (in a current version VCM is used by default), |
| -noindex |
doesn't index output file, |
| -forceindex |
forces writting advanced index, |
| -sionly |
simple index only, |
| -nomarkers |
doesn't copy markers, |
| -noscripts |
doesn't copy script command, |
-nostr <numbers> (or -nostream, -excludestr, -exclstr, -removestr)
|
doesn't copy selected streams. <numbers> are stream numbers separated by space or
comma. This switch can be used many times. |
| -q |
quiet mode - only few information are presented, |
| -v |
verbose mode - turned on by default, |
| -details |
stronger verbose mode - shows many details about
copying process, among other things key frames, |
| -debug |
strongest verbose mode - debug mode, |
| -y |
overwrites without asking, |
| -bw <milliseconds> |
forces setting of the initial play delay. This value
has direct impact on the internal bucket size.
Selecting too small value may cause sample losing. |
| -ps <bytes> |
forces size of data packets. |
| -optps <bytes> |
calculates optimized packet size to minimize data padding. |
| -rmgaps |
big time gaps are removed(*)
*)This option is not yet active! |
| -adelay [-] <time> |
Delays audio streams by the a specified time. The time value can be negative. |
| -sdelay <number> [-] <time> |
Delays selected stream by a specified time. The time value can be negative. |
| -info |
just shows information on input sources. |
| -infokf |
just shows information on input sources and locations
of key frames in selected time range. |
| -infohdr |
shows detailed information on an input ASF file header. |
| -infoidx |
- shows detailed information on indices appended to a
processed file. Add -details switch to get additional information on any eventual errors. |
| -h |
shows this help screen. |
<time> in general is given in seconds, but it accepts following formats as well:
1:59:45.35 = 1 h, 59 min, 45s, 35 hundredths, 3:30 = 3 min, 30 sec.,
1023.101 = 1023 sec. and 101 thousandths, etc.
Back to top
Examples of usage:
- To join two ASF files into one big please type:
asfbin -i first.asf -i second.asf -o big.asf
- To cut out a fragment from a bigger ASF file please type:
asfbin -i big.asf -o part.asf -start 10:03.045 -duration 30.01
- To cut some fragment from a file that begins in the middle and lasts to the end of file simply give only -start parameter without duration.
asfbin -i big.asf -o endpart.asf -start 5:45
- To extract two segments from one bigger ASF file and put in a one file please type:
asfbin -i big.asf -o smaller.asf -start 1:15 -dur 4:00 -start 10:15 120
- To join many ASF files into one big You can also use input file list:
asfbin -l files.lst -o bigone.asf
- To work on the list of ASF files like on the one big file and to cut some fragments from it, please specify:
asfbin -l files.lst -o parts.asf -s segments.lst
- To delay audio stream by 350ms type:
asfbin -i input.asf -o output.asf -adelay 0.35
- To advance stream number 4 by 250ms type:
asfbin -i input.asf -o output.asf -sdelay 4 -0.25
- To join two ASF files into one big please type knowing that the second file
may contain progressive frames that are a continuation of the first file, type:
(E.g. your encoder software may save streams in segmented file, each of size 50MB.
In that case using -cvb may be helpful.)
asfbin -i first.asf -i second.asf -o big.asf -cvb
- To remove low bitrate audio and video streams assuming that those are respectively
streams number 1 and 3, invoke command:
asfbin -i input.asf -o output.asf -nostr 1,3
- To extract 10 time ranges from the long input file and save them
under names: short01.asf, short02.asf and so on, assuming that
time ranges are kept in timeranges.txt file, invoke the command below.
We also want each file to be unique.
asfbin -i long.asf -l timeranges.txt -sep -o short{00}.asf -unique
- To print out the information on precise location of all key frames
in the input file please run:
asfbin -i input.asf -infokf
- To repeat a selected time range two times please run the command:
asfbin -i test.asf -o big.asf -start 10 -dur 15 -repeat 1
- To print out the information on index entries in the input file
please run:
asfbin -i input.asf -infoidx -details > some.log
- If you want to divide file into several segments, send it via e-mail
or in any other way and then join it together with no losses follow
the instructions:
asfbin -i large.wmv -o partA.wmv -y -start 0 -dur 10 -ebkf
asfbin -i large.wmv -o partB.wmv -y -start 10 -dur 10 -ebkf
asfbin -i large.wmv -o partC.wmv -y -start 20 -dur 10 -ebkf
asfbin -i large.wmv -o partD.wmv -y -start 30 -dur 10 -ebkf
and join it together again:
asfbin -i partA.wmv -i partB.wmv -i partC.wmv -i partD.wmv -o large.wmv -y -istart
Copyright Radek Strugalski 1999-2009. Duplication of content is strictly prohibited.
Read my Privacy Statement.
|
|