logo

Live Production Software Forums


Welcome Guest! To enable all features please Login or Register.

Notification

Icon
Error

Options
Go to last post Go to first unread
dasmedienatelier  
#1 Posted : Tuesday, February 18, 2020 4:35:40 AM(UTC)
dasmedienatelier

Rank: Advanced Member

Groups: Registered
Joined: 8/5/2015(UTC)
Posts: 49
Man
Location: Germany

Thanks: 11 times
Was thanked: 3 time(s) in 3 post(s)
I am using nodejs to write data into a text file which I want to use as a datasource. When trying to add the text file via the datasource manager I always get the error:

"Error: process cannot access the file since it is in use by another process" (translated from German)

As soon as the nodejs app stops vmix will access the file and refresh the data.

Other programs (i.e. Atom, Texteditors) can access the file while it is being written. What am I doing wrong??

Any insights much appreciated!!

Thanks,

Knut
xaver  
#2 Posted : Tuesday, February 18, 2020 4:58:04 AM(UTC)
xaver

Rank: Advanced Member

Groups: Registered
Joined: 11/11/2016(UTC)
Posts: 378
Man
Location: Europe

Thanks: 23 times
Was thanked: 38 time(s) in 32 post(s)
nodejs should open the file, write into the file and close/unlock the file
dasmedienatelier  
#3 Posted : Tuesday, February 18, 2020 5:27:53 AM(UTC)
dasmedienatelier

Rank: Advanced Member

Groups: Registered
Joined: 8/5/2015(UTC)
Posts: 49
Man
Location: Germany

Thanks: 11 times
Was thanked: 3 time(s) in 3 post(s)
But why can other applications load the file while it's in use by nodejs and vMix can not? I am simply using fs.writeFile().
xaver  
#4 Posted : Tuesday, February 18, 2020 6:50:45 AM(UTC)
xaver

Rank: Advanced Member

Groups: Registered
Joined: 11/11/2016(UTC)
Posts: 378
Man
Location: Europe

Thanks: 23 times
Was thanked: 38 time(s) in 32 post(s)
you are sure, you can write with other editors at the same time?

if you open a file with excel, other programs can't write to the same file at the same time,
but most editors can open it, but not save the changes you made in the editor
dasmedienatelier  
#5 Posted : Tuesday, February 18, 2020 5:07:39 PM(UTC)
dasmedienatelier

Rank: Advanced Member

Groups: Registered
Joined: 8/5/2015(UTC)
Posts: 49
Man
Location: Germany

Thanks: 11 times
Was thanked: 3 time(s) in 3 post(s)
ah, so vmix needs write access? Isnt it possible, to have it only reading the source? Like an option: „Datasource open read-only“
xaver  
#6 Posted : Tuesday, February 18, 2020 6:01:36 PM(UTC)
xaver

Rank: Advanced Member

Groups: Registered
Joined: 11/11/2016(UTC)
Posts: 378
Man
Location: Europe

Thanks: 23 times
Was thanked: 38 time(s) in 32 post(s)
I'm not sure
never tested it

we have to ask Martin
dasmedienatelier  
#7 Posted : Tuesday, February 18, 2020 8:41:34 PM(UTC)
dasmedienatelier

Rank: Advanced Member

Groups: Registered
Joined: 8/5/2015(UTC)
Posts: 49
Man
Location: Germany

Thanks: 11 times
Was thanked: 3 time(s) in 3 post(s)
Well, Martin? :)
doggy  
#8 Posted : Tuesday, February 18, 2020 9:59:16 PM(UTC)
doggy

Rank: Advanced Member

Groups: Registered
Joined: 12/27/2012(UTC)
Posts: 5,095
Belgium
Location: Belgium

Thanks: 284 times
Was thanked: 922 time(s) in 761 post(s)
Originally Posted by: dasmedienatelier Go to Quoted Post
Well, Martin? :)


Yes, Martin is checking this forum 24/7 (so timezone doesn't matter)

why not message support ?
admin  
#9 Posted : Tuesday, February 18, 2020 11:43:12 PM(UTC)
admin

Rank: Administration

Groups: Administrators
Joined: 1/13/2010(UTC)
Posts: 5,162
Man
Location: Gold Coast, Australia

Was thanked: 4173 time(s) in 1498 post(s)
I am everywhere!

Reading a file while it is in use by another program is a very bad idea!
Consider if the program only half finished writing to the file when vMix updated, you would end up with scrambled
or incomplete text in your titles!

Instead, all file data sources should save to file when updates are made and not keep the file open.
(Excel and Notepad do this for example).
Thus when vMix reads the file successfully it can always be sure the data is complete.

Regards,

Martin
vMix
dasmedienatelier  
#10 Posted : Wednesday, February 19, 2020 12:12:47 AM(UTC)
dasmedienatelier

Rank: Advanced Member

Groups: Registered
Joined: 8/5/2015(UTC)
Posts: 49
Man
Location: Germany

Thanks: 11 times
Was thanked: 3 time(s) in 3 post(s)
Thanks for replying, I really appreciate that.

I am using google's speech API for transcribing and generating subtitles. Currently, I am writing the returned transcription into a textfile which I tried to use as a datasource. Since the results are coming in pretty fast I need to rewrite the file very often. Maybe too often, so it seems, that the file is always locked.

I guess I have to find a different way of sending subtitles to vMix, then. Since I don't know if there is a way of sending subtitles as metadata along with a livestream?

Thanks,

Knut
dasmedienatelier  
#11 Posted : Wednesday, February 19, 2020 5:00:17 AM(UTC)
dasmedienatelier

Rank: Advanced Member

Groups: Registered
Joined: 8/5/2015(UTC)
Posts: 49
Man
Location: Germany

Thanks: 11 times
Was thanked: 3 time(s) in 3 post(s)
Found a solution: I'm now using vMix's web API. I'm simply sending the subtitles via http/tcp instead of writing to a file.

Furthermore, I have found a nodejs vmix module which makes it pretty easy to send commands to the vmix webinterface.

Thanks again to all,

Knut
Users browsing this topic
Guest
Forum Jump  
You cannot post new topics in this forum.
You cannot reply to topics in this forum.
You cannot delete your posts in this forum.
You cannot edit your posts in this forum.
You cannot create polls in this forum.
You cannot vote in polls in this forum.