FAQ  •  Register  •  Login

Watching while recording

<<

sla

Serviio newbie

Posts: 4

Joined: Mon Nov 28, 2011 6:11 pm

Post Mon Nov 28, 2011 6:28 pm

Watching while recording

Hi,

I have a PVR recorder that can record to my NAS/Linux server. On the same server I have Serviio running. Serviio scans for new files every 2 mins.
Serviio publish the files normally, but only the first few minutes is available. I guess that Serviio finds the length on the files when scanning.

Is it possible to watch the recording while it is recorded?
<<

moltra

DLNA master

Posts: 1871

Joined: Thu Mar 24, 2011 11:00 pm

Location: Ohio USA

Post Mon Nov 28, 2011 6:33 pm

Re: Watching while recording

You might be able to do that once live streaming is completed.
Mark
Beta Tester Group
http://www.serviidb.com Online media resource repository

Netgear EVA2000 | Samsung BD-D5300 | XBOX 360 | Windows 7 | Mint Debian 12 | Raxz Maxx
HowTo: Provide supported formats of a device HowTo: Record a new ticket on Bitbucket
HowTo: Provide details of a video file that doesn't play HowTo: Turn on detailed logging
<<

zip

User avatar

Serviio developer / Site Admin

Posts: 17212

Joined: Sat Oct 24, 2009 12:24 pm

Location: London, UK

Post Mon Nov 28, 2011 6:34 pm

Re: Watching while recording

I think you are right. It could be the file size, as Serviio doesn't know the file is not complete.
<<

sla

Serviio newbie

Posts: 4

Joined: Mon Nov 28, 2011 6:11 pm

Post Mon Nov 28, 2011 6:58 pm

Re: Watching while recording

zip wrote:I think you are right. It could be the file size, as Serviio doesn't know the file is not complete.


Then what about let Serviio check for changed file size and scan again if changed?
<<

zip

User avatar

Serviio developer / Site Admin

Posts: 17212

Joined: Sat Oct 24, 2009 12:24 pm

Location: London, UK

Post Mon Nov 28, 2011 9:10 pm

Re: Watching while recording

Too much work for a niche functionality. You might be able to set up transcoding of that file and then Serviio can deal with growing file size.
<<

sla

Serviio newbie

Posts: 4

Joined: Mon Nov 28, 2011 6:11 pm

Post Mon Nov 28, 2011 9:41 pm

Re: Watching while recording

zip wrote:Too much work for a niche functionality. You might be able to set up transcoding of that file and then Serviio can deal with growing file size.


I see, but could you get me a hint on how to do that?
<<

Illico

User avatar

DLNA master

Posts: 4646

Joined: Fri Jul 23, 2010 8:08 am

Location: France

Post Tue Nov 29, 2011 2:21 pm

Re: Watching while recording

sla wrote:I see, but could you get me a hint on how to do that?

Could you provide information about your PVR file format (ffmpeg -i or Mediainfo result) , and the serviio profile you used?
Illico
Sony 2010 KDL-46EX501 | BDP-S373 | SMP-N100 | Windows 8-i7 | Network DD HD-CE1.5TLU2 | Livebox2-UHD86 | ServiiDroid | ServiiGo | BubbleUPnP
Serviio beta tester - Moderator
<<

sla

Serviio newbie

Posts: 4

Joined: Mon Nov 28, 2011 6:11 pm

Post Sat Dec 10, 2011 4:58 pm

Re: Watching while recording

Illico wrote:
sla wrote:I see, but could you get me a hint on how to do that?

Could you provide information about your PVR file format (ffmpeg -i or Mediainfo result) , and the serviio profile you used?


Hi, sorry for the late response.

Input #0, mpegts, from '11-12-02 - Disney XD - Et Par Konger - Da de 16-årige tveæggede tvillinger Brady og Boomer finder .ts':
Duration: 00:25:10.57, start: 15495.998978, bitrate: 5088 kb/s
Program 3207
Stream #0.0[0x209]: Video: mpeg2video (Main), yuv420p, 544x576 [PAR 24:17 DAR 4:3], 10000 kb/s, 25 fps, 25 tbr, 90k tbn, 50 tbc
Stream #0.1[0x2a4](swe): Audio: mp2, 48000 Hz, stereo, s16, 256 kb/s
Stream #0.2[0x2a5](nor): Audio: mp2, 48000 Hz, stereo, s16, 256 kb/s
Stream #0.3[0x2a6](dan): Audio: mp2, 48000 Hz, stereo, s16, 256 kb/s
Stream #0.4[0x2a7](fin): Audio: mp2, 48000 Hz, stereo, s16, 256 kb/s
Stream #0.5[0x246](swe): Subtitle: [6][0][0][0] / 0x0006
Stream #0.6[0x1ffe]: Data: [5][0][0][0] / 0x0005
Stream #0.7[0x350]: Data: [192][0][0][0] / 0x00C0
Stream #0.8[0x8fb]: Data: [11][0][0][0] / 0x000B
At least one output file must be specified


I'm using the Toshiba Regza profile.
<<

skug67

Serviio newbie

Posts: 4

Joined: Wed Jan 25, 2012 1:02 am

Post Wed Feb 01, 2012 2:03 pm

Re: Watching while recording

I'd love to figure this out also -- and I'm not sure it's such a "niche" functionality. I don't know that much about how the Serviio community uses their installations, but this functionality is certainly one of the most used aspects of TiVo. It's also available within the MythTV frontend setup. It would be tremendous if we could get the same functionality to an arbitrary DLNA-enabled advice that may be in a different room from a TiVo/MythTV box.
<<

Geers

Serviio newbie

Posts: 1

Joined: Sat Feb 04, 2012 8:27 pm

Post Mon Feb 13, 2012 5:17 pm

Re: Watching while recording

Does it slow down the recording speed when you're watching this file at the same time?
<<

Illico

User avatar

DLNA master

Posts: 4646

Joined: Fri Jul 23, 2010 8:08 am

Location: France

Post Mon Feb 13, 2012 7:14 pm

Re: Watching while recording

Could we considering an "in recording" file like a live stream media ?
Illico
Sony 2010 KDL-46EX501 | BDP-S373 | SMP-N100 | Windows 8-i7 | Network DD HD-CE1.5TLU2 | Livebox2-UHD86 | ServiiDroid | ServiiGo | BubbleUPnP
Serviio beta tester - Moderator
<<

SpiderDawg

User avatar

Serviio newbie

Posts: 4

Joined: Fri Apr 20, 2012 1:22 pm

Post Sat Apr 28, 2012 6:05 pm

Re: Watching while recording

My search for a DLNA media server with this functionality is what brought me to Serviio; to date I've not found any media server capable of this. The best alternative I've found is to use vlc to stream the file via http and Serviio to send the live stream to my PS3, but that does not allow pause, ff, rw etc. I'm using an hdHomerun to record, and would love to be able to use the PS3's remote to control playback while recording. I have all the hardware, the only thing missing is appropriate software but I fear that a continued search is futile.

Is this even possible with DLNA? It would seem that someone would have already done it if it were possible.

Anyway, much thanks to Zip for creating Serviio, it's my favorite of all the media servers I've tried.
<<

mavack

Streaming enthusiast

Posts: 25

Joined: Sun Aug 05, 2012 12:35 pm

Post Sun Jul 28, 2013 9:54 am

Re: Watching while recording

I've just started doing this myself recording to file on the server and having serviio pick the file up.

It does refresh eventually but i have no idea on what interval it does see the change in the file? Is there anyway to force a refresh on the files to pick up file size changes?

I do like the idea of having a live folder or something any chance of some sort of implementation?

Or has anyone else come up with a work around?
<<

mavack

Streaming enthusiast

Posts: 25

Joined: Sun Aug 05, 2012 12:35 pm

Post Mon Aug 12, 2013 8:15 am

Re: Watching while recording

Well i've started using the cli method to trigger a database refresh via curl ...

This means that when the show is finished i can watch the completed recording, before it would refresh somewhere in the middle and then not refresh again until much later so the length would never update.

Would it be possible to directly hit the database with a minor class file?

Maybe implement some minor search functions? Maybe delete entry to force a re-discover? And maybe a method to overwrite the length so that serviio will continue to serve the file as its being written?

It would probably break DLNA standards or something but only allow it to be executed via CLI

java file.class search 12435

java file.class delete 12435

or
java file.class set attrib length 7200

I can write a batch/bash script in front to deal with the logic but some basic commands might be better since they are lesser used and you don't want them in the guy anyway.
<<

mavack

Streaming enthusiast

Posts: 25

Joined: Sun Aug 05, 2012 12:35 pm

Post Tue Aug 13, 2013 11:09 am

Re: Watching while recording

ok i'm just going to put notes of my investigations while i try and work it out myself.

derby provides the sql interface you can use to do sql queries, i guess i should bursh up on my SQL, however derby database in embedded mode means you need to shut down serviio in order to connect to the database, another step :S

Having to kill the server makes it rather annoying. Can the code be modified to allow serviio to run in server mode and allow connections while its running? Wouldn't you just need to change your connect string? And i would need to setup server, i know its not for all users but there have been some asking for database access.
<<

mavack

Streaming enthusiast

Posts: 25

Joined: Sun Aug 05, 2012 12:35 pm

Post Fri Aug 16, 2013 5:16 am

Re: Watching while recording

For those playing at home.

database access is actually pretty easy, using the ij utility from http://db.apache.org/derby/derby_downloads.html

you then connect to the database, since serviio runs in embedded mode you need to shutdown serviio before you can connect else it will error. I've copied mine to a different folder while i play.

  Code:
connect 'jdbc:derby:d:\tmp\db\db';


  Code:
HELP;


will give you a command reference but the ones you need to know.

  Code:
SHOW TABLES;


You can take a pretty good guess on what each of them hold, the one that i have been interested at the moment is MEDIA_ITEM

You can view the entire media database with

  Code:
SELECT * FROM MEDIA_ITEM;


you might want to widen your command prompt window as well to make it easier to read. This will output every file and every column.

you can get the column names with

  Code:
DESCRIBE MEDIA_ITEM;


Now lets build a custom table since you don't really care about all the data.
Lets say for what i'm interested in i want file_name title duration and file_size

  Code:
SELECT
id,file_name,title,duration,file_size
FROM media_item
where FILE_NAME like 'MasterChef%';


This outputs a table with only those columns as indicated by SELECT, and anything that starts with MasterChef the % is a wildcard, it can be used at the start or the end or both if you want, or without to find exact matches. Feel free to look at other columns for different information etc.

and now what i want to do edit/change something. you may have noticed above i included the id column, this is a unique value to a table like a line item so its easier to identify stuff.

So say i want to update the file_size and the duration as is my plan to allow a file to be played even while its being written.

  Code:
UPDATE media_item
SET duration = 10000
where id=31112;

UPDATE media_item
SET file_size = 9000000000
where id=31112;


and check that changes have happened

  Code:
select
id,file_name,title,duration,file_size
FROM media_item
WHERE id=31112;


you then have to commit i think, i'm not sure if autocommit is on by default but no harm. i believe you can also rollback changes as well via rollback and haven't tried that.

  Code:
COMMIT;



obviously this is messing with serviio at a low level so at your own risk is in order, currently i have only messed with a duplicate database, i have not yet loaded the database back to serviio.

Some things i will aim to find on the weekend
Is changing Duration/File size enough to allow uninterrupted playback of a file currently being written?
What happens if you do hit end of real file instead of fake file size?
It probably also breaks DLNA standards so no set correct action for this type of event?
When does serviio overwrite the changes?
What does serviio use as the reference to know if a file is currently in the database file_name? Or do multiple fields have to match?


If this works i then need to work out a way to script it, probably perl or bash via cygwin to stop service make changes start serviio.

If that works then maybe see if i can get class files that are compiled with a different JDBC string that links to a local database instead of an embedded, i can setup the derby database myself and link to that. And then make changes without stop/starting serviio.
<<

zip

User avatar

Serviio developer / Site Admin

Posts: 17212

Joined: Sat Oct 24, 2009 12:24 pm

Location: London, UK

Post Fri Aug 16, 2013 10:04 am

Re: Watching while recording

Note that Serviio also caches data, so the DB change might not be visible until the cache is invalidated (usually when files are added / updated)
<<

atc98092

User avatar

DLNA master

Posts: 5205

Joined: Fri Aug 17, 2012 10:22 pm

Location: Washington (the state)

Post Sat Aug 17, 2013 1:26 am

Re: Watching while recording

Zip, is the DB connectivity hard coded in Serviio, or is there something in a config or jar file that could edited to redirect to a different DB, either a full Derby install or perhaps MySQL? That would provide a way to build a DB maintenance application. I can completely understand your desire to keep it as simple as possible for most users, but it would be nice for us few tech heads to play around with something like that.
Dan

LG NANO85 4K TV, Samsung JU7100 4K TV, Sony BDP-S3500, Sharp 4K Roku TV, Insignia Roku TV, Roku Ultra, Premiere and Stick, Nvidia Shield, Yamaha RX-V583 AVR.
Primary server: Intel i5-6400, 16 gig ram, Windows 10 Pro, 22 TB hard drive space | Test server Windows 10 Pro, AMD Phenom II X4 965, 8 gig ram

HOWTO: Enable debug logging HOWTO: Identify media file contents
<<

mavack

Streaming enthusiast

Posts: 25

Joined: Sun Aug 05, 2012 12:35 pm

Post Sat Aug 17, 2013 10:54 am

Re: Watching while recording

I've done some reading the embedded is slightly different to the server, and the JDBC drivers are not compatible, however there appears to be a 3rd mode, embedded server

http://db.apache.org/derby/papers/Derby ... ded+Server

and discussed here

http://www.coderanch.com/t/467789/open- ... ork-Server

A bit of best of both worlds, comes with some additional overhead but will allow people that want to read the database. I don't know how much additional overhead is and if it is worth it for the masses, but potentially if the changes are minor enough you could put a simple config flag that changes the operation, 1 checkbox in the gui or hide it in one of the xml files and make it change on reload or something.

Otherwise work out which class file needs to change and maybe just provide that to those that want it, and we can push it into the jar files ourselves since the ones that want it can surely work that out
<<

zip

User avatar

Serviio developer / Site Admin

Posts: 17212

Joined: Sat Oct 24, 2009 12:24 pm

Location: London, UK

Post Sat Aug 17, 2013 6:53 pm

Re: Watching while recording

atc98092 wrote:Zip, is the DB connectivity hard coded in Serviio, or is there something in a config or jar file that could edited to redirect to a different DB, either a full Derby install or perhaps MySQL? That would provide a way to build a DB maintenance application. I can completely understand your desire to keep it as simple as possible for most users, but it would be nice for us few tech heads to play around with something like that.

There is dbURL system property, where you could pass an external Derby server URL.
Next

Return to General discussion

Who is online

Users browsing this forum: No registered users and 21 guests

Powered by phpBB © 2000, 2002, 2005, 2007 phpBB Group.
Designed by ST Software for PTF.