make playlist more simple

This commit is contained in:
jb_alvarado 2018-02-03 20:49:36 +01:00
parent f92a43cb33
commit b6ed000228
2 changed files with 14 additions and 14 deletions

View File

@ -30,19 +30,19 @@ XML Playlist Example
```xml
<playlist>
<head>
<meta name="author" content="example"/>
<meta name="title" content="Live Stream"/>
<meta name="copyright" content="(c)2018 example.org"/>
<meta name="date" content="2018-02-03"/>
</head>
<body>
<video src="/path/clip_01.mkv" begin="21600" dur="18.000000" in="0.00" out="18.000000"/>
<video src="/path/clip_02.mkv" begin="21618" dur="18.111000" in="0.00" out="18.111000"/>
<video src="/path/clip_03.mkv" begin="21636.1" dur="247.896000" in="0.00" out="247.896000"/>
<video src="/path/clip_04.mkv" begin="21884" dur="483.114000" in="0.00" out="483.114000"/>
<video src="/path/clip_05.mkv" begin="22367.1" dur="20.108000" in="0.00" out="20.108000"/>
<video src="/path/clip &amp; specials.mkv" begin="22387.2" dur="203.290000" in="0.00" out="203.290000"/>
<video src="/path/clip_06.mkv" begin="22590.5" dur="335.087000" in="300.00" out="335.087000"/>
<meta name="author" content="example"/>
<meta name="title" content="Live Stream"/>
<meta name="copyright" content="(c)2018 example.org"/>
<meta name="date" content="2018-02-03"/>
</head>
<body>
<video src="/path/clip_01.mkv" begin="21600" dur="18.000000" in="0.00" out="18.000000"/>
<video src="/path/clip_02.mkv" begin="21618" dur="18.111000" in="0.00" out="18.111000"/>
<video src="/path/clip_03.mkv" begin="21636.1" dur="247.896000" in="0.00" out="247.896000"/>
<video src="/path/clip_04.mkv" begin="21884" dur="483.114000" in="0.00" out="483.114000"/>
<video src="/path/clip_05.mkv" begin="22367.1" dur="20.108000" in="0.00" out="20.108000"/>
<video src="/path/clip &amp; specials.mkv" begin="22387.2" dur="203.290000" in="0.00" out="203.290000"/>
<video src="/path/clip_06.mkv" begin="22590.5" dur="335.087000" in="300.00" out="335.087000"/>
</body>
</playlist>
```

View File

@ -42,7 +42,7 @@ while read -r line; do
clipPath=$(echo "$line" | sed 's/&/&amp;/g')
clipDuration=$( ffprobe -v error -show_format "$line" | awk -F= '/duration/{ print $2 }' )
printf '\t<video src="%s" begin="%s" dur="%s" in="%s" out="%s"/>\n' "$clipPath" "$listStart" "$clipDuration" "0.0" "$clipDuration" >> "$trunk/$playlist"
printf '\t\t<video src="%s" begin="%s" dur="%s" in="%s" out="%s"/>\n' "$clipPath" "$listStart" "$clipDuration" "0.0" "$clipDuration" >> "$trunk/$playlist"
# add start time
listStart="$( awk -v lS="$listStart" -v cD="$clipDuration" 'BEGIN{ print lS + cD }' )"