Video Source File Path from .txt file

khaver

Member
We fixed the scrub issue (starting the media file playback from a time after the beginning of the video) by using a web browser source to play the video. You can specify a playback start position by adding variables to the end of the url. If I recall, something like file://FilePath/File.mp4#t=x.x The x.x is seconds.
 

bcoyle

Member
We fixed the scrub issue (starting the media file playback from a time after the beginning of the video) by using a web browser source to play the video. You can specify a playback start position by adding variables to the end of the url. If I recall, something like file://FilePath/File.mp4#t=x.x The x.x is seconds.
wow. this is good to know. I've just used the traditional vlc source and hadn't thought about others. It's nice to be able to think outside the box. Another problem I found with vlc is that if you reuse the same source, it will sometimes show one frame from the previous video as a flash, before starting the new requested one. Thank you for the FYI!
 

Jordiz64

New Member
Is there also a possibility to alter the script to read a txt file with just artist and song title, and to match this to a folder with music video MP4's and have it play the file?
 

khaver

Member
Is there also a possibility to alter the script to read a txt file with just artist and song title, and to match this to a folder with music video MP4's and have it play the file?
Yes, it shouldn't be too hard. Describe exactly how you would want this to work. The current script checks for a change in the text contents (the video file name and the required starting position) in a certain text file every second. The content is changed by a separate program whenever a new music video is required to play. Would your text file contain a single artist and song title entry, or a list of artists and titles? If it's a list of artists and titles, would the script just need to read this once when the script is set to run or OBS starts, or will the list change at some time while OBS is running? Describe in detail exactly what you want.
 

bcoyle

Member
Yes, it shouldn't be too hard. Describe exactly how you would want this to work. The current script checks for a change in the text contents (the video file name and the required starting position) in a certain text file every second. The content is changed by a separate program whenever a new music video is required to play. Would your text file contain a single artist and song title entry, or a list of artists and titles? If it's a list of artists and titles, would the script just need to read this once when the script is set to run or OBS starts, or will the list change at some time while OBS is running? Describe in detail exactly what you want.
If you have looked at some of my other posts, you will know that I'm writing a full 24/7 broadcast and or playout app. In the test stage right now. I decided at the start, that the file name should contain meta data with this info in it.

The following is my music video directory.
1663701978085.png




The meta data is in the form of :

"[album = over the moon, artist= r.e.m., song = Paradise is around the Corner, key = etc...] and other non meta data name . mp4. Also the meta data can be earlier in the file path name. You can therefore move it into different directories and still retain the info.


The advantage is that the meta data is carried along with the file name and doesn't require any database type scripts. You just look for [] brackets and key=data pairs. Allows you to expand your meta data any way that you wish to define it.

This is an example of one of my music videos. I use a cartoon for the background, muted. Could be anything, such as a slidshow.

 

Jordiz64

New Member
Yes, it shouldn't be too hard. Describe exactly how you would want this to work. The current script checks for a change in the text contents (the video file name and the required starting position) in a certain text file every second. The content is changed by a separate program whenever a new music video is required to play. Would your text file contain a single artist and song title entry, or a list of artists and titles? If it's a list of artists and titles, would the script just need to read this once when the script is set to run or OBS starts, or will the list change at some time while OBS is running? Describe in detail exactly what you want.
My audio files are ARTIST - SONG TITLE. The now playing info is outputted in the exact same way. In the text file it is ARTIST- SONG TITLE.

My video files are in a seperate folder. There I have them named the exact same way as the MP3 and cut the length of the video to match the radio edit of the song. So the OBS script will have to match the content of the now playing txt with the right music video in my music video folder. This will obviously have to happen with every new song that is being played.

So when my now playing txt file contains: Toto - Hold The Line, the script should check the folder for a video file that is named the exact same way, and play it.

Hopefully this is detailed enough!
 

Mikheil

New Member
My audio files are ARTIST - SONG TITLE. The now playing info is outputted in the exact same way. In the text file it is ARTIST- SONG TITLE.

My video files are in a seperate folder. There I have them named the exact same way as the MP3 and cut the length of the video to match the radio edit of the song. So the OBS script will have to match the content of the now playing txt with the right music video in my music video folder. This will obviously have to happen with every new song that is being played.

So when my now playing txt file contains: Toto - Hold The Line, the script should check the folder for a video file that is named the exact same way, and play it.

Hopefully this is detailed enough!
I have the impression that @khaver did not take your request to heart or maybe he doesn't have time, and I understand that.
 

bcoyle

Member
@Mikheil @Jordiz64 @khaver Lack of time, I understand. I was a professional project in my previous life. By definition, this thread is about controlling obs with some app that monitors a text file. In programmer terms, this is like a function call "play_mp3_with_associated_mp4 ( audio_file_Name.mp3, video_file_Name.mp4,Video_file_in_point_in_seconds). So, this thread is really about the "point of the Spear". The rest of it is much harder and way bigger to do. So manually, you wouldn't want to stream this. Maybe the thought is to record the combined video and music and develop a library. ffmeg can do that. Using obs would allow you to add overlays,etc. But the main point of this is that what ever method you choose, you need to keep in mind the layers of programming or scripting on top of this point of the spear and make it easy to make the ending app have a easy upward path. Anyway, in this discussion, you might want to discuss the app that will use the info in this thread??? LOL Am I blowing smoke?
 

Laczkó

New Member
Hi,


I have a problem possibly can be solved with reading file paths from a txt, so I think this thread could be a good starting point.

I use txt files to give a text description for the viewers about upcoming videos of the stream. The xyz.txt is belong to the xyz.mpg and they are in the same directory. When I change a video source, e.g. xyz.mpg to abc.mpg I also have to change a text source from xyz.txt to abc.txt. This is a task susceptible to human errors (forget to change one or the other) and should be able to automatized.

Logics of solution that I can imagine:
— Put the path into a txt like "D:\onair\xyz" and a script reads this file and put "D:\onair\xyz.mpg" to one source and "D:\onair\xyz.txt" to the other, so I just need to put the path into the txt and both source will be set automatically.
— I set the video source only and a script reads the path of that, change the mpg extension to txt and set the text source for it
— Not automation but a warning if a human error appears: a script compare the two source and if they are not the same (except the extension) it does somthing that can be detected by an Advanced Scene Switcher macro (e.g. write "warning" into a txt and change the text in it to "OK" if the sources get the same, so I can make a macro that sends me a warning based on the content of that text file).

All above solutions are good for me whichever easier to do (or if there any other idea).
 

bcoyle

Member
Hi,


I have a problem possibly can be solved with reading file paths from a txt, so I think this thread could be a good starting point.

I use txt files to give a text description for the viewers about upcoming videos of the stream. The xyz.txt is belong to the xyz.mpg and they are in the same directory. When I change a video source, e.g. xyz.mpg to abc.mpg I also have to change a text source from xyz.txt to abc.txt. This is a task susceptible to human errors (forget to change one or the other) and should be able to automatized.

Logics of solution that I can imagine:
— Put the path into a txt like "D:\onair\xyz" and a script reads this file and put "D:\onair\xyz.mpg" to one source and "D:\onair\xyz.txt" to the other, so I just need to put the path into the txt and both source will be set automatically.
— I set the video source only and a script reads the path of that, change the mpg extension to txt and set the text source for it
— Not automation but a warning if a human error appears: a script compare the two source and if they are not the same (except the extension) it does somthing that can be detected by an Advanced Scene Switcher macro (e.g. write "warning" into a txt and change the text in it to "OK" if the sources get the same, so I can make a macro that sends me a warning based on the content of that text file).

All above solutions are good for me whichever easier to do (or if there any other idea).
Are you using advanced scene switcher now? Are you doing live stuff or using pre-recorded videos/mp3s etc for n automated channel?
 

Laczkó

New Member
Are you using advanced scene switcher now? Are you doing live stuff or using pre-recorded videos/mp3s etc for n automated channel?
Yes, I'm using Advanced Scene Switcher and doing automated channel with pre-recorded videos.
 

bcoyle

Member
This is a video stream, not an app, and I don't know how it would solve my problem.
Hi. Sorry, when you said you used pre-recorded videos , i thought that you were talking about an automated tv station.I assumed that you were using the switcher to schedule a list or something. It sounds like you have a "live" use, not a schedule it and turn it loose over the next month. I.E. a shoot and forget application. Am I getting this right??
 

Gora

New Member
Thanks for clarifying! For my current needs, I'm happy with the flexibility and control Advanced Scene Switcher offers for my live stream with pre-recorded elements. But I'll definitely keep your app in mind for future projects that might require a more automated approach!
 

bcoyle

Member
Thanks for clarifying! For my current needs, I'm happy with the flexibility and control Advanced Scene Switcher offers for my live stream with pre-recorded elements. But I'll definitely keep your app in mind for future projects that might require a more automated approach!
gotta. have fun
 
Top