Author Topic: Stream Videos Mod and DOS Batch file for Video auto thumbnailing and playlist.  (Read 5490 times)

0 Members and 1 Guest are viewing this topic.

Offline BC_Man

  • Pre-Newbie
  • Posts: 6
  • Ug!
    • View Profile
    • Portal
Ug,

I was going to put this in the Mod forum, but wasn't sure if it really qualifies. First time I've posted here.

This is for MPEG video's, but could be adapted for other vid types (?).

Edit: 4images/templates/default/media/mpg.html

Code: [Select]
<!-- Template file for MPEG Movies -->
<embed src="{media_src}" border="0" width="352" height="288" type="application/x-mplayer2"></embed><br />
<a href="{media_src}.pls">Stream PLS</a><br />
<a href="{media_src}.m3u">Stream M3U</a><br />

Run this batch file (actually there are two). It will batch all the mpg's in the directory it is run in. You need to have Imagemagick and ffmpeg installed, and in your path.

makevidthumbs.bat
Code: [Select]
@echo off

echo You must include 4images media file path as command line option Example: http://djbarney.silentflame.com/4images/data/media/6/
echo "Continue?"
pause

:: Make thumbs AND playlists for all mpg video's in current directory by calling another batch file.

for %%i in (*.mpg) do makevidthumbs_1.bat %%~ni %1

makevidthumbs_1.bat

NOTE: "iconvert", is actually Imagemagick "convert". I renamed it because it conflicts with a Windows XP utility.

Code: [Select]
ffmpeg -i %1.mpg -an -ss 00:00::00 -t 00:00:01 -r 1 -y %1_%%d.png
del %1_2.png
iconvert %1_1.png -resize 200 -quality 80 %1.jpg
del %1_1.png

:: Make PLS

echo [playlist] > %1.mpg.pls
echo numberofentries=1 >> %1.mpg.pls
echo File1=%2%1.mpg >> %1.mpg.pls
echo Title1=%1 >> %1.mpg.pls
echo Version=2 >> %1.mpg.pls

:: Make M3U

echo %2%1.mpg > %1.mpg.m3u

Now upload videos to the usual /media/<id> directory. Also put the playlists in that directory.

Upload thumbnails to /thumbnails/<id> directory.

Check for new images and you should have video / thumb / playlists ready for each entry.

BC_Man

PS.. Note I corrected this message today (14/02/08). I changed the title sent to the playlist to "%1" instead of one of my games "Breed" ! ;)
« Last Edit: February 14, 2008, 02:58:21 AM by BC_Man »
Making pictures since the Paleolithic.

Offline GaYan

  • Sr. Member
  • ****
  • Posts: 301
  • ♫ | G2 | ♫
    • View Profile
    • Ziramagic
can we set this for FLV Videos as well ? And How to setup ffmpeg in a server ? :S
I'm Back :)

Offline BC_Man

  • Pre-Newbie
  • Posts: 6
  • Ug!
    • View Profile
    • Portal
It should, have you tried ? Ffmpeg can decode FLV.

If you have a host with SSH access then on some of them you can install programs in your home directory.
Making pictures since the Paleolithic.

Offline GaYan

  • Sr. Member
  • ****
  • Posts: 301
  • ♫ | G2 | ♫
    • View Profile
    • Ziramagic
Any Demo ? :S Any Way this is a Great Mode !
I'm Back :)