Sorry your browser is not supported!

You are using an outdated browser that does not support modern web technologies, in order to use this site please update to a new browser.

Browsers supported include Chrome, FireFox, Safari, Opera, Internet Explorer 10+ or Microsoft Edge.

DarkBASIC Professional Discussion / Making a simulated TV

Author
Message
DARKBASIC PRO 3d WORLD EDITOR
14
Years of Service
User Offline
Joined: 2nd May 2012
Location:
Posted: 29th Mar 2015 07:16
Im trying to make a TV inside of a room that has 20 channels and is time based. Like it would have a program every 30 min. So I want to know how I can get the value of where the video is currently playing and can I play the video from a certain position?

- Infinity is Simplicity -
DARKBASIC PRO 3d WORLD EDITOR
14
Years of Service
User Offline
Joined: 2nd May 2012
Location:
Posted: 30th Mar 2015 00:45
I ended up playing 5 animations at one time lowering all volumes to 0 except the selected one and bringing the selected animation to a box object put i was hoping to get 20.. This way seems taxing on the systems resources

- Infinity is Simplicity -
Cescano
11
Years of Service
User Offline
Joined: 4th Sep 2014
Location: Italy
Posted: 30th Mar 2015 08:53
Why playing 5 animations at the same time when you need just 1?
Just use a timer and after it reaches the 30 minutes delete the old animation and load the new one.

something like this:

DARKBASIC PRO 3d WORLD EDITOR
14
Years of Service
User Offline
Joined: 2nd May 2012
Location:
Posted: 31st Mar 2015 07:54
Ok... So will all 20 channels start at the same time and end after 30 minutes bringing the next couple of 20 shows? Like if I want to change channels so that the show is still going on but its just Im not watching it.. as opposed to watching one show for 30 minutes and it loading up another show after... just like a real TV.. so far my program works but I can image when I load 10 or 15 at a time...

- Infinity is Simplicity -
Cescano
11
Years of Service
User Offline
Joined: 4th Sep 2014
Location: Italy
Posted: 31st Mar 2015 08:25 Edited at: 31st Mar 2015 08:32
For channels you mean videos you have to load right? 20 different videos to stream on your tv object?

By the way if you want to change channel before that the 30 minutes passed, just make another function similar to the one i wrote in the previous message, but without to check that the timer is passed,so remove:

- "if timer()> timerAnimation + maximumTime"
- the endif before endfunction

By doing this you will have several lines of duplicate code, so you could think of doing another function where to put this code shared by the 2 functions, removing it from the 2 functions and calling the new function instead


Edit:

I think i misunderstood what you wanted to do, you want them all starting at the same time and change channel but not from the start, in this case you must load and play them all, but that will be way heavier for your computer to handle, in the darkbasic there is no documentation about starting an animation from a certain position, so there is no way to do what you want to do without loading them all.
mr Handy
18
Years of Service
User Offline
Joined: 7th Sep 2007
Location: out of TGC
Posted: 4th Apr 2015 01:03
Easy. You just need to cut your videos to small 10 seconds chunks.

By the way, guys, what video codec has 100% compatibility with from XP to W10?

Cescano
11
Years of Service
User Offline
Joined: 4th Sep 2014
Location: Italy
Posted: 4th Apr 2015 01:30
Cutting 20 videos of maybe 30 minutes each (or less I don't know if he meant they are 30 minutes each or looping them for 30 minutes) in pieces of 10 seconds will end up having thousands of files that probably he will ends to cut in 2030 year.

A "start animation at position" command would be really helpful for him, but sadly there are very few commands to handle videos
Ortu
DBPro Master
18
Years of Service
User Offline
Joined: 21st Nov 2007
Location: Austin, TX
Posted: 4th Apr 2015 05:30
if you are playing the animation to an object, does set object frame have any effect?

Cescano
11
Years of Service
User Offline
Joined: 4th Sep 2014
Location: Italy
Posted: 4th Apr 2015 06:17
isn't that command for the animation of the model only? (animation intended as walking, running etc, here he is using a video intended as animation)
mr Handy
18
Years of Service
User Offline
Joined: 7th Sep 2007
Location: out of TGC
Posted: 4th Apr 2015 18:08 Edited at: 4th Apr 2015 18:09
ffmpeg

bat file or you can write small app with DBP

ffmpeg -i input.avi -vcodec copy -acodec copy -ss 00:00:00 -t 00:10:00 output1.avi
ffmpeg -i input.avi -vcodec copy -acodec copy -ss 00:10:00 -t 00:20:00 output2.avi
etc...

DARKBASIC PRO 3d WORLD EDITOR
14
Years of Service
User Offline
Joined: 2nd May 2012
Location:
Posted: 4th Apr 2015 20:26
Quote: "ffmpeg

bat file or you can write small app with DBP

ffmpeg -i input.avi -vcodec copy -acodec copy -ss 00:00:00 -t 00:10:00 output1.avi
ffmpeg -i input.avi -vcodec copy -acodec copy -ss 00:10:00 -t 00:20:00 output2.avi
etc..."


how would you go about doing that? and what language is that and how would I implement it in darkbasic pro?

- Infinity is Simplicity -
mr Handy
18
Years of Service
User Offline
Joined: 7th Sep 2007
Location: out of TGC
Posted: 4th Apr 2015 21:39 Edited at: 4th Apr 2015 21:46
It is not a language, it is Windows command line arguments, also used for batch file (https://en.wikipedia.org/wiki/Batch_file)

Those lines are what you need. Also you need to download ffmpeg.exe for Windows (https://en.wikipedia.org/wiki/FFmpeg)

Put video and ffmpeg.exe in same place like c:\
Your lines for batch file will be:
start ffmpeg -i input.avi -vcodec copy -acodec copy -ss 00:00:00 -t 00:10:00 output1.avi
start ffmpeg -i input.avi -vcodec copy -acodec copy -ss 00:10:00 -t 00:20:00 output2.avi
and so on...

Batch file is a simple text file but with .bat extension

Note, that in batch file you need to add "start" before command line arguments.
You can also execute those lines from DBP (EXECUTE EXECUTABLE "cmd.exe", arguments same but without "start")

You can write batch file in the notepad. Or better use DBP to generate all lines with incremental numbers instead of manual typing them in the notepad.

Login to post a reply

Server time is: 2026-07-06 04:29:44
Your offset time is: 2026-07-06 04:29:44