Reputation: 674
We are using RMTP for our video server, however we must create a SMIL (Synchronized Multimedia Integration Language) file per a video. If you have 1 video, no problem, however we have over 2000 +.
Below you can see a perfect SMIL file. This one is saved as video-test.smil
<smil>
<head>
<meta base="rtmp://xxx.cloudfront.net:1935/cfx/st/" />
</head>
<body>
<switch>
<video src="video-streaming/video-test-720.mp4" height="720" system-bitrate="2000000" width="1280" />
<video src="video-streaming/video-test-360.mp4" height="360" system-bitrate="800000" width="640" />
<video src="video-streaming/video-test-180.mp4" height="180" system-bitrate="300000" width="320"/>
</switch>
</body>
</smil>
My idea would be to make a batch script to do the following:
Special feature would be to SKIP if file exsits.
Questions:
Can this even be done with a SCRIPT. Can someone help..
Thanks
Upvotes: 0
Views: 435
Reputation: 80113
@ECHO OFF
SETLOCAL
SET targetdir=.
FOR /f %%i IN ('dir /b/a-d *.mp4') DO (
IF NOT EXIST %targetdir%\%%~ni.smil (
FOR /f "tokens=1*delims=#" %%s IN (smiltemplate.txt) DO (
SET subs=%%t
IF DEFINED subs (ECHO %%s%%~ni%%t) ELSE (ECHO %%s)
)
) >%targetdir%\%%~ni.smil
)
save your perfect smil file as smiltemplate.txt
- with the string video-test
replaced by #
change the target directory to where you want to generate the .smil
s and all's done!
Upvotes: 2