in reply to Installing SDL::SMPEG
Unfortunately, most Linux distributions strip SDL to the minimum point where "we installed SDL" is just about still true. SDL itself isn't that hard to compile, you could just install your own version into /user/local or something similar.
The other option (the one i recommend because it is more flexible in the long run) is to use a minimal webserver and display the video in a video element. On the bonus side, the playback device doesn't need any special software installed, just a browser.
With a bit more work (converting the video into a M3U8 stream) and using something like the hls.js javascript library, the client doesn't need to load the WHOLE video, but loads it in 5/10/whatever second increments in the background while you play. And it's easy to manipulate the M3U8 file on the fly, so you can stream multiple videos, livestream etc. (Even give your significant other the ability to insert ads/reminders to feed the trash and take out the dog).
At the moment, i don't have a very nice example of this, only the stuff i did some time ago that's integrated into my own web framework.
Not sure if this still works, but here's a snipped from the one-off converter i used to convert my youtube export videos to M3U8 files:
... my $dirpath = '/media/blogvideos/youtube/ffmpegconverted/' . $line- +>{video_id}; $line->{video_path} =~ s/^\.\///g; my $command = 'ffmpeg -i "/media/blogvideos/youtube/' . $line->{vi +deo_path} . '" -hls_list_size 0 "' . $dirpath . '/takeout.m3u8"'; my $mvcommand = 'mv ' . $dirpath . '/takeout.m3u8 ' . $dirpath . ' +/index.m3u8'; print "ID: ", $line->{video_id}, "\n"; print "DIR: ", $dirpath, "\n"; print "CMD: ", $command, "\n"; print "MV: ", $mvcommand, "\n"; mkdir $dirpath; `$command`; `$mvcommand`; print "\n\n"; ...
The index (text) file will look something like this:
#EXTM3U #EXT-X-VERSION:3 #EXT-X-TARGETDURATION:10 #EXT-X-MEDIA-SEQUENCE:0 #EXTINF:5.840000, /XXXPATHXXX/takeout0.ts #EXTINF:1.400000, /XXXPATHXXX/takeout1.ts #EXTINF:3.600000, /XXXPATHXXX/takeout2.ts #EXTINF:9.400000, /XXXPATHXXX/takeout3.ts #EXTINF:3.960000, /XXXPATHXXX/takeout4.ts ...
The XXXPATHXXX path is just a convenient placeholder for my scripts, because file access maps different that URLs, and the corresponding scripts replace as required. This is the index file that gets regularly reloaded by the player, and makes it decide with video segment to play next. The player pretends that the whole list is one single big video, but on the backend you can mix&match as you please.
#EXTM3U #EXT-X-VERSION:3 #EXT-X-TARGETDURATION:10 #EXT-X-MEDIA-SEQUENCE:0 #EXTINF:5.840000, /XXXPATHXXX/takeout0.ts #EXTINF:1.400000, /XXXPATHXXX/takeout1.ts #EXTINF:10.00000, /wife/reminders/feedthedog.ts #EXTINF:9.400000, /XXXPATHXXX/takeout3.ts #EXTINF:60.00000, /wife/reminders/take_out_the_trash_NOW.ts #EXTINF:3.960000, /XXXPATHXXX/takeout4.ts ...
Hope that helps.
|
---|