1
0
mirror of https://github.com/mpv-player/mpv synced 2024-12-23 23:32:26 +00:00
Command line video player
Go to file
Uoti Urpala 968154ba77 EDL: add support for new EDL file format
The timeline code previously added to support Matroska ordered
chapters allows constructing a playback timeline from segments picked
from multiple source files. Add support for a new EDL format to make
this machinery available for use with file formats other than Matroska
and in a manner easier to use than creating files with ordered
chapters.

Unlike the old -edl option which specifies an additional file with
edits to apply to the video file given as the main argument, the new
EDL format is used by giving only the EDL file as the file to play;
that file then contains the filename(s) to use as source files where
actual video segments come from. Filename paths in the EDL file are
ignored. Currently the source files are only searched for in the
directory of the EDL file; support for a search path option will
likely be added in the future.

Format of the EDL files

The first line in the file must be "mplayer EDL file, version 2".
The rest of the lines belong to one of these classes:
1) lines specifying source files
2) empty lines
3) lines specifying timeline segments.

Lines beginning with '<' specify source files. These lines first
contain an identifier used to refer to the source file later, then the
filename separated by whitespace. The identifier must start with a
letter. Filenames that start or end with whitespace or contain
newlines are not supported.

On other lines '#' characters delimit comments. Lines that contain
only whitespace after comments have been removed are ignored.

Timeline segments must appear in the file in chronological order. Each
segment has the following information associated with it:
- duration
- output start time
- output end time (= output start time + duration)
- source id (specifies the file the content of the segment comes from)
- source start time (timestamp in the source file)
- source end time (= source start time + duration)
The output timestamps must form a continuous timeline from 0 to the
end of the last segment, such that each new segment starts from the
time the previous one ends at. Source files and times may change
arbitrarily between segments.

The general format for lines specifying timeline segments is
[output time info] source_id [source time info]
source_id must be an identifier defined on a '<' line. Both the time
info parts consists of zero or more of the following elements:
1) timestamp
2) -timestamp
3) +duration
4) *
5) -*
, where "timestamp" and "duration" are decimal numbers (computations
are done with nanosecond precision). Whitespace around "+" and "-" is
optional. 1) and 2) specify start and end time of the segment on
output or source side. 3) specifies duration; the semantics are the
same whether this appears on output or source side. 4) and 5) are
ignored on the output side (they're always implicitly assumed). On the
source side 4) specifies that the segment starts where the previous
segment _using this source_ ended; if there was no previous segment
time 0 is used. 5) specifies that the segment ends where the next
segment using this source starts.

Redundant information may be omitted. It will be filled in using the
following rules:
- output start for first segment is 0
- two of [output start, output end, duration] imply third
- two of [source start, source end, duration] imply third
- output start = output end of previous segment
- output end = output start of next segment
- if "*", source start = source end of earlier segment
- if "-*", source end = source start of a later segment

As a special rule, a last zero-duration segment without a source
specification may appear. This will produce no corresponding segment
in the resulting timeline, but can be used as syntax to specify the
end time of the timeline (with effect equal to adding -time on the
previous line).

Examples:
----- begin -----
mplayer EDL file, version 2
< id1 filename

  0 id1 123
100 id1 456
200 id1 789
300
-----  end  -----
All segments come from the source file "filename". First segment
(output time 0-100) comes from time 123-223, second 456-556, third
789-889.

----- begin -----
mplayer EDL file, version 2
< f filename
f  60-120
f 600-660
f  30- 90
-----  end  -----
Play first seconds 60-120 from the file, then 600-660, then 30-90.

----- begin -----
mplayer EDL file, version 2
< id1 filename1
< id2 filename2

+10 id1 *
+10 id2 *
+10 id1 *
+10 id2 *
+10 id1 *
+10 id2 *
-----  end  -----
This plays time 0-10 from filename1, then 0-10 from filename1, then
10-20 from filename1, then 10-20 from filename2, then 20-30 from
filename1, then 20-30 from filename2.

----- begin -----
mplayer EDL file, version 2
< t1 filename1
< t2 filename2

t1 * +2            # segment 1
+2 t2 100          # segment 2
t1 *               # segment 3
t2 *-*             # segment 4
t1 3 -*            # segment 5
+0.111111 t2 102.5 # segment 6
7.37 t1 5 +1       # segment 7
-----  end  -----
This rather pathological example illustrates the rules for filling in
implied data. All the values can be determined by recursively applying
the rules given above, and the full end result is this:
+2         0-2                 t1  0-2              # segment 1
+2         2-4                 t2  100-102          # segment 2
+0.758889  4-4.758889          t1  2-2.758889       # segment 3
+0.5       4.4758889-5.258889  t2  102-102.5        # segment 4
+2         5.258889-7.258889   t1  3-5              # segment 5
+0.111111  7.258889-7.37       t2  102.5-102.611111 # segment 6
+1         7.37-8.37           t1  5-6              # segment 7
2011-04-05 06:26:17 +03:00
debian
DOCS options: drop support for numeric -demuxer values 2011-02-22 15:16:41 +02:00
drivers
etc codecs.conf: Add FFmpeg WC4 xan decoder 2011-02-15 19:30:57 +02:00
ffmpeg_files ffmpeg_files/taglists.c: add new FFmpeg values 2011-02-05 03:38:50 +02:00
input input: accept Shift modifier for Enter and Tab keys 2011-02-05 02:16:17 +02:00
libaf fix compilation with old FFmpeg versions 2011-02-08 19:07:10 +02:00
libao2 vo_dxr2, ao_dxr2: drop dxr2 support 2011-01-31 16:03:10 +02:00
libdvdcss libdvdcss: Sync some minor changes from upstream, up to r237 2010-11-02 04:18:07 +02:00
libmenu sub/OSD: move some related files to sub/ 2011-01-26 20:39:05 +02:00
libmpcodecs ad_qtaudio: fix use with the libavformat mov demuxer 2011-02-15 19:23:52 +02:00
libmpdemux EDL: add support for new EDL file format 2011-04-05 06:26:17 +03:00
libvo x11_common: fix for reconfig with pos/xineramascreen set 2011-02-03 21:49:12 +02:00
loader loader: Remove __ptr32 and __ptr64 typedefs 2011-01-29 04:05:28 +02:00
mp3lib mp3lib/dct64_sse.c: fix compilation with clang 2010-11-14 12:23:56 +02:00
osdep tl_matroska.c: move the find_files() function here 2011-03-03 21:38:52 +02:00
rpm tremor: drop internal tremor library 2011-02-01 21:28:03 +02:00
stream stream.[ch], ass_mp: new stream function for whole-file reads 2011-03-03 21:39:24 +02:00
sub stream.[ch], ass_mp: new stream function for whole-file reads 2011-03-03 21:39:24 +02:00
timeline EDL: add support for new EDL file format 2011-04-05 06:26:17 +03:00
TOOLS TOOLS/: minor fixes in tool code 2011-01-31 16:03:10 +02:00
.gitignore .gitignore: add /po and /locale 2011-02-15 21:28:57 +02:00
access_mpcontext.h
asxparser.c cleanup: don't check for NULL before free() 2010-11-08 18:05:12 +02:00
asxparser.h
AUTHORS documentation: remove Changelog, rewrite README 2011-02-15 12:04:32 +02:00
av_log.c build: enable/disable all FFmpeg libraries together 2010-11-02 04:16:55 +02:00
av_log.h
av_opts.c
av_opts.h
bstr.c bstr.[ch], path.[ch]: add string and path handling functions 2011-02-26 16:40:31 +02:00
bstr.h bstr.[ch], path.[ch]: add string and path handling functions 2011-02-26 16:40:31 +02:00
cfg-common.h Merge branch 'sub' 2011-01-26 20:42:15 +02:00
cfg-mplayer-def.h
cfg-mplayer.h options: remove CONF_OLD option flag 2011-01-31 21:53:05 +02:00
codec-cfg.c vo_zr2: drop Zoran support 2011-01-31 16:03:11 +02:00
codec-cfg.h
command.c cleanup: define ROUND() macro in mpcommon.h 2011-01-31 16:03:10 +02:00
command.h
configure build: change version number generation 2011-02-19 19:07:12 +02:00
Copyright tremor: drop internal tremor library 2011-02-01 21:28:03 +02:00
cpudetect.c Move code to avoid forward declarations in top-level .c files 2010-11-02 04:18:08 +02:00
cpudetect.h loader: Reuse do_cpuid from cpudetect.c in loader/win32.c 2010-11-02 04:15:01 +02:00
cpuinfo.c
defaultopts.c Merge branch 'sub' 2011-01-26 20:42:15 +02:00
defaultopts.h cleanup: remove unused MEncoder-related code 2011-01-25 02:29:31 +02:00
edl.c
edl.h
fmt-conversion.c
fmt-conversion.h
LICENSE
m_config.c options: remove CONF_OLD option flag 2011-01-31 21:53:05 +02:00
m_config.h m_config.[ch]: mark some function parameters const 2010-11-02 04:18:08 +02:00
m_option.c options: remove unused "func_full" option type 2011-01-31 16:03:11 +02:00
m_option.h options: remove CONF_OLD option flag 2011-01-31 21:53:05 +02:00
m_property.c cleanup: define ROUND() macro in mpcommon.h 2011-01-31 16:03:10 +02:00
m_property.h
m_struct.c
m_struct.h
Makefile EDL: add support for new EDL file format 2011-04-05 06:26:17 +03:00
mangle.h
metadata.h
mixer.c
mixer.h
mp_core.h EDL: add support for new EDL file format 2011-04-05 06:26:17 +03:00
mp_fifo.c
mp_fifo.h
mp_msg.c mp_msg: avoid mangling other output with status line 2010-11-02 04:14:43 +02:00
mp_msg.h mp_msg: Remove uses of MSGT_MENCODER 2011-01-25 03:15:18 +02:00
mp_osd.h options: more mplayer.c options moved to option struct 2010-11-14 00:14:56 +02:00
mpbswap.h
mpcommon.c cleanup: remove unused MEncoder-related code 2011-01-25 02:29:31 +02:00
mpcommon.h tl_matroska.c: move the find_files() function here 2011-03-03 21:38:52 +02:00
mplayer.c EDL: add support for new EDL file format 2011-04-05 06:26:17 +03:00
mplayer.h core: move most mpcommon.c contents to mplayer.c 2011-01-15 18:45:43 +02:00
options.h options: move -noconfig to option struct, simplify 2011-01-11 17:28:10 +02:00
parser-cfg.c
parser-cfg.h
parser-mpcmd.c
parser-mpcmd.h
path.c bstr.[ch], path.[ch]: add string and path handling functions 2011-02-26 16:40:31 +02:00
path.h bstr.[ch], path.[ch]: add string and path handling functions 2011-02-26 16:40:31 +02:00
playtree.c cleanup: don't check for NULL before free() 2010-11-08 18:05:12 +02:00
playtree.h
playtreeparser.c playtreeparser.c: Add playlist parser for .nsc files 2010-12-16 06:22:53 +02:00
playtreeparser.h
pnm_loader.c vo_gl: Move the read_pnm function into a separate file 2010-11-02 04:18:37 +02:00
pnm_loader.h vo_gl: Move the read_pnm function into a separate file 2010-11-02 04:18:37 +02:00
README documentation: remove Changelog, rewrite README 2011-02-15 12:04:32 +02:00
subopt-helper.c cleanup: don't check for NULL before free() 2010-11-08 18:05:12 +02:00
subopt-helper.h
talloc.c
talloc.h
version.sh build: change version number generation 2011-02-19 19:07:12 +02:00

Compiling with full features requires development files for several
external libraries. Below is a list of some important requirements. For
more information see the output of './configure --help' for a list of options,
or look at the list of enabled and disabled features printed after running
'./configure'. If you think you have support for some feature installed
but configure fails to detect it, the file config.log may contain information
about the reasons for the failure.

Libraries specific to particular video output methods
(you'll want at least one of VDPAU, GL or Xv):
 - libvdpau (for VDPAU output, best choice for NVIDIA cards)
 - libGL (OpenGL output)
 - libXv (XVideo output)
general:
 - libasound   (ALSA audio output)
 - various general X development libraries
 - libfreetype
 - libfontconfig
 - libass
 - FFmpeg libraries (libavutil libavcodec libavformat libswscale libpostproc)

Most of the above libraries are available in suitable versions on normal
Linux distributions. However FFmpeg is an exception (distro versions may be
too old to work at all or work well). For that reason you may want to use
the separately available build wrapper that first compiles FFmpeg libraries
and libass, and then compiles the player statically linked against those.