fsphil / hacktv

Analogue TV transmitter for the HackRF
GNU General Public License v3.0
713 stars 84 forks source link

Autoplay feature? #22

Open SAUCYSOUP76 opened 5 years ago

SAUCYSOUP76 commented 5 years ago

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

fsphil commented 5 years ago

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?

SAUCYSOUP76 commented 5 years ago

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 commented 5 years ago

@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.

neo7530 commented 5 years ago

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

neo7530 commented 5 years ago

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

SAUCYSOUP76 commented 5 years ago

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

neo7530 commented 5 years ago

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.

SAUCYSOUP76 commented 5 years ago

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

neo7530 commented 5 years ago

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 commented 5 years ago

type the ffmpeg as one-liner...

SAUCYSOUP76 commented 5 years ago

@neo7530 getting command not found.

SAUCYSOUP76 commented 5 years ago

@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 commented 5 years ago

@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

neo7530 commented 5 years ago

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

SAUCYSOUP76 commented 5 years ago

@neo7530 yeah still getting broken pipe

SAUCYSOUP76 commented 5 years ago

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

neo7530 commented 5 years ago

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

wsygog commented 5 years ago

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.

fsphil commented 5 years ago

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.

captainjack64 commented 5 years ago

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

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

SAUCYSOUP76 commented 5 years ago

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.