hacktv icon indicating copy to clipboard operation
hacktv copied to clipboard

Autoplay feature?

Open SAUCYSOUP76 opened this issue 5 years ago • 21 comments

Could an autoplay feature be added? Would like it to play all the videos in my directory. Or even an EPG styled kind of editor to play a video/clip at a certain time. Thanks

SAUCYSOUP76 avatar Jan 27 '19 23:01 SAUCYSOUP76

I've been considering adding a playlist function. It wouldn't be hard to generate a playlist for all the files in a directory.

For the EPG, do you mean having a UI on the video output?

fsphil avatar Jan 28 '19 08:01 fsphil

For the EPG i meant a GUI themed application that you could choose when a video plays at a certain time of the day.

SAUCYSOUP76 avatar Jan 28 '19 12:01 SAUCYSOUP76

@fsphil got to say though this is a great piece of software been having fun with it! Will you be adding a playlist function? If so when do you predict it'' be pushed out by? I ask as it's a pain dragging and dropping each video file when the stream ends as well as the CRT making a loud pop at the end.

SAUCYSOUP76 avatar Jan 30 '19 20:01 SAUCYSOUP76

you can do a "playlist" with ffmpeg...

neo7530 avatar Jan 31 '19 07:01 neo7530

sorry, forgot the link: https://stackoverflow.com/questions/11647868/using-ffmpeg-to-stream-continuously-videos-files-to-a-rtmp-server

neo7530 avatar Jan 31 '19 07:01 neo7530

@neo7530 I will be honest i have no idea how to implement that into hacktv.

SAUCYSOUP76 avatar Jan 31 '19 15:01 SAUCYSOUP76

You have to write a batch / Shell Script and pipe the output into hacktv via stdin. Give me some time, i will test it tomorrow and will write a manual.

neo7530 avatar Jan 31 '19 17:01 neo7530

Also another possible feature, having compatibility with open broadcast studio.

SAUCYSOUP76 avatar Jan 31 '19 19:01 SAUCYSOUP76

for the playlist-feature: generate two txt-files:

files1.txt: ffconcat version 1.0 file trailers.mkv file a_movie.mkv file trailer.mkv file 'files2.txt'

files2.txt: ffconcat version 1.0 file anothermovie.mkv file commercials.mkv file athirdmovie.mkv file files1.txt

then generate a shell-command file:

eg: play.sh

ffmpeg
-f concat -i files1.txt
-c copy
-f mpegts - | hacktv -f 799250000 -m i -g 47 -

execute the shell... while playing the content of 'files1.txt' you can edit 'files2.txt'...

neo7530 avatar Feb 01 '19 14:02 neo7530

type the ffmpeg as one-liner...

neo7530 avatar Feb 01 '19 14:02 neo7530

@neo7530 getting command not found.

SAUCYSOUP76 avatar Feb 01 '19 17:02 SAUCYSOUP76

@neo7530 ran the command ffmpeg -f concat -i files1.txt -c copy -f mpegts - | hacktv -f 471250000 -m i -g 47 - as a command and says unsafe filename and files.txt: Operation not permitted

SAUCYSOUP76 avatar Feb 01 '19 17:02 SAUCYSOUP76

@neo7530 added -safe 0 before the -i and i now get this av_interleaved_write_frame(): Broken pipe Error writing trailer of pipe:: Broken pipe

SAUCYSOUP76 avatar Feb 01 '19 17:02 SAUCYSOUP76

Have you wrote the full path in files.txt? /path/to/Video.mkv? Try to write files in Single quotes. '/path/to/Video.mkv'

neo7530 avatar Feb 01 '19 17:02 neo7530

@neo7530 yeah still getting broken pipe

SAUCYSOUP76 avatar Feb 01 '19 17:02 SAUCYSOUP76

@neo7530 file 'files2.txt' is it suppose to be in ' '? as i notice file files1.txt is different

SAUCYSOUP76 avatar Feb 01 '19 17:02 SAUCYSOUP76

Hmm, try it... I have to work.

neo7530 avatar Feb 01 '19 18:02 neo7530

I think it is better to leave playlist to ffmpeg pipe. Although for the user it might be a little complicated, example can be given easily, and ffmpeg has already done the hard work.

wsygog avatar Feb 01 '19 22:02 wsygog

It's probably easier to use xargs: $ cat playlist.txt | xargs -d "\n" ./hacktv -f 855250000 -g 47 I'd still like a proper playlist function within hacktv, but this does the job for now.

fsphil avatar Feb 03 '19 15:02 fsphil

Alternatively, you can supply wildcards or limited regexp in filenames.

./hacktv -f 855250000 -g 47 somedir/[L-P]*.mkv

captainjack64 avatar Feb 05 '19 14:02 captainjack64

It's probably easier to use xargs: $ cat playlist.txt | xargs -d "\n" ./hacktv -f 855250000 -g 47 I'd still like a proper playlist function within hacktv, but this does the job for now.

Thanks that worked! Though would like it built into hacktv, but this will work for the time being.

SAUCYSOUP76 avatar Feb 06 '19 13:02 SAUCYSOUP76