Advertisement
Guest User

mplayer EDL file format, version 2

a guest
Jul 21st, 2015
3,076
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 5.22 KB | None | 0 0
  1. http://devel.mplayer2.org/changeset/968154ba77f8e8974d6dd36d1109a473b3ff5b6c/
  2.  
  3. EDL: add support for new EDL file format
  4. The timeline code previously added to support Matroska ordered
  5. chapters allows constructing a playback timeline from segments picked
  6. from multiple source files. Add support for a new EDL format to make
  7. this machinery available for use with file formats other than Matroska
  8. and in a manner easier to use than creating files with ordered
  9. chapters.
  10. Unlike the old -edl option which specifies an additional file with
  11. edits to apply to the video file given as the main argument, the new
  12. EDL format is used by giving only the EDL file as the file to play;
  13. that file then contains the filename(s) to use as source files where
  14. actual video segments come from. Filename paths in the EDL file are
  15. ignored. Currently the source files are only searched for in the
  16. directory of the EDL file; support for a search path option will
  17. likely be added in the future.
  18. Format of the EDL files
  19. The first line in the file must be "mplayer EDL file, version 2".
  20. The rest of the lines belong to one of these classes:
  21. 1) lines specifying source files
  22. 2) empty lines
  23. 3) lines specifying timeline segments.
  24. Lines beginning with '<' specify source files. These lines first
  25. contain an identifier used to refer to the source file later, then the
  26. filename separated by whitespace. The identifier must start with a
  27. letter. Filenames that start or end with whitespace or contain
  28. newlines are not supported.
  29. On other lines '#' characters delimit comments. Lines that contain
  30. only whitespace after comments have been removed are ignored.
  31. Timeline segments must appear in the file in chronological order. Each
  32. segment has the following information associated with it:
  33. duration
  34. output start time
  35. output end time (= output start time + duration)
  36. source id (specifies the file the content of the segment comes from)
  37. source start time (timestamp in the source file)
  38. source end time (= source start time + duration)
  39. The output timestamps must form a continuous timeline from 0 to the
  40. end of the last segment, such that each new segment starts from the
  41. time the previous one ends at. Source files and times may change
  42. arbitrarily between segments.
  43. The general format for lines specifying timeline segments is
  44. [output time info] source_id [source time info]
  45. source_id must be an identifier defined on a '<' line. Both the time
  46. info parts consists of zero or more of the following elements:
  47. 1) timestamp
  48. 2) -timestamp
  49. 3) +duration
  50. 4) *
  51. 5) -*
  52. , where "timestamp" and "duration" are decimal numbers (computations
  53. are done with nanosecond precision). Whitespace around "+" and "-" is
  54. optional. 1) and 2) specify start and end time of the segment on
  55. output or source side. 3) specifies duration; the semantics are the
  56. same whether this appears on output or source side. 4) and 5) are
  57. ignored on the output side (they're always implicitly assumed). On the
  58. source side 4) specifies that the segment starts where the previous
  59. segment _using this source_ ended; if there was no previous segment
  60. time 0 is used. 5) specifies that the segment ends where the next
  61. segment using this source starts.
  62. Redundant information may be omitted. It will be filled in using the
  63. following rules:
  64. output start for first segment is 0
  65. two of [output start, output end, duration] imply third
  66. two of [source start, source end, duration] imply third
  67. output start = output end of previous segment
  68. output end = output start of next segment
  69. if "*", source start = source end of earlier segment
  70. if "-*", source end = source start of a later segment
  71. As a special rule, a last zero-duration segment without a source
  72. specification may appear. This will produce no corresponding segment
  73. in the resulting timeline, but can be used as syntax to specify the
  74. end time of the timeline (with effect equal to adding -time on the
  75. previous line).
  76. Examples:
  77. mplayer EDL file, version 2
  78. < id1 filename
  79. 0 id1 123
  80. 100 id1 456
  81. 200 id1 789
  82. 300
  83. All segments come from the source file "filename". First segment
  84. (output time 0-100) comes from time 123-223, second 456-556, third
  85. 789-889.
  86. mplayer EDL file, version 2
  87. < f filename
  88. f 60-120
  89. f 600-660
  90. f 30- 90
  91. Play first seconds 60-120 from the file, then 600-660, then 30-90.
  92. mplayer EDL file, version 2
  93. < id1 filename1
  94. < id2 filename2
  95. +10 id1 *
  96. +10 id2 *
  97. +10 id1 *
  98. +10 id2 *
  99. +10 id1 *
  100. +10 id2 *
  101. This plays time 0-10 from filename1, then 0-10 from filename1, then
  102. 10-20 from filename1, then 10-20 from filename2, then 20-30 from
  103. filename1, then 20-30 from filename2.
  104. mplayer EDL file, version 2
  105. < t1 filename1
  106. < t2 filename2
  107. t1 * +2 # segment 1
  108. +2 t2 100 # segment 2
  109. t1 * # segment 3
  110. t2 *-* # segment 4
  111. t1 3 -* # segment 5
  112. +0.111111 t2 102.5 # segment 6
  113. 7.37 t1 5 +1 # segment 7
  114. This rather pathological example illustrates the rules for filling in
  115. implied data. All the values can be determined by recursively applying
  116. the rules given above, and the full end result is this:
  117. +2 0-2 t1 0-2 # segment 1
  118. +2 2-4 t2 100-102 # segment 2
  119. +0.758889 4-4.758889 t1 2-2.758889 # segment 3
  120. +0.5 4.4758889-5.258889 t2 102-102.5 # segment 4
  121. +2 5.258889-7.258889 t1 3-5 # segment 5
  122. +0.111111 7.258889-7.37 t2 102.5-102.611111 # segment 6
  123. +1 7.37-8.37 t1 5-6 # segment 7
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement