Welcome to our forums! Please take a few moments to read through our Community Guidelines (also conveniently linked in the header at the top of each page). There, you'll find guidelines on conduct, tips on getting the help you may be searching for, and more!

Scanner for enigma2 .ts files

Hi,

 

I'd like to use my Sat-TV recordings with Plex. Unfortunately my Dreambox receiver saves the recordings in a strange way: 20121119 0116 - RTL2 HD - V wie Vendetta.ts

 

The first numbers are sort of a time code followed by the channel name any by the movie name. The built-in Plex Movie Scanner recognizes the .ts files and loads them but unfortunately the correct movie name is not extracted. As a result, no corresponding metadata is found.

 

Is there already a scanner for Dreambox enigma2 recordings or could anybody help me in getting started programming such a scanner?

 

Thanks in advance!

«134

Comments

  • wally007wally007 Posts: 1,164Members, Plex Pass Plex Pass
    edited May 2013

    As far as I know .ts files can not have any metadata embedded so Dreambox must be storing metadata for the recordings ( like Programme description, Title, Sub-Title, Time of recording, genre etc ... ) some place else. 

    If this information is easily accessible ( maybe there's an xml file with the same name as .ts on Dreambox ? ) then you'll be able to write an scanner/agent combo to get the recordings show up in Plex. If is not, then you wont get any further then name of the file (Maybe if you set up your regex right, title and date of recording but that's it.)

    I'm also using Dreambox to record Sky UK channels but I'm using Windows MCE7 & DVBlink Dreambox plugin ( so Dreambox is actually used only as a tuner and card decrypter  while MCE7 does recording to the HTPC )

    Then I have MCEBuddy to automatically convert/rename those recordings (wtv files ) into Plex friendly format along with all metadata that's available from EPG.

    This way I have EXACTLY same programmes in MCE7 and in Plex ( usually delayed by 30 - 60 minutes , depending on runtime of the show ) Also MCEBuddy keeps tab on location of the files, so whenever I delete anything in MCE7, MCEBuddy will remove it from Plex. ( you can disable this feature )

    Here is what the Recorded TV episodes look like in Plex ( i put the recording date in-between the wildcards, because thats how my kids remember their shows ):

    06.jpg

  • QuintenQuinten Posts: 43Members ✭✭

    I have just added my Vu+ Duo/Enigma2 based recording location as a directory on my NAS on which PMS runs and added it to the PMS.  Meta data from recordings is present in the .eit files that go with each recordings.  I tried to find a file format for it, but it's mainly a header of some sort along with a description of the recording.

    Now I've only just started to look at this, but I am correct in saying that an Agent is all that is needed for it, right?

  • QuintenQuinten Posts: 43Members ✭✭
    edited May 2013

    Ok, so I know a bit more now, and an Agent is not what we need (not until we want to add the meta data), but a scanner...  so I took a copy of the Plex Movie Scanner.py file and put it into the /var/lib/plexmediaserver/Library/Application Support/Plex Media Server/Scanners directory and named it Enigma2.py

    I then started to tweak and debug it and although I am not a python developer, I know enough of development to find the point that mattered and added the following

    # Enigma2 files look like: YYYYMMDD HHMM - Channel - Programmename.ts
    qfile = os.path.splitext(file)[0]
    (qdatetime,qchannel,qprogramme) = qfile.split(' - ',2)
    (qdate,qtime) = qdatetime.split(' ')
    # Construct as: Programmename (Channel) DD/MM/YYYY HH:MM
    name = qprogramme+" ("+qchannel+") "+qdate[6:8]+"/"+qdate[4:6]+"/"+qdate[0:4]+" "+qtime[0:2]+":"+qtime[2:4]
    print "Name =", name
    year = qdate[0:4]
     

    and commented out the part that would normally get the 'clean' filename

    #(name, year) = VideoFiles.CleanName(os.path.splitext(file)[0])
     

    Then set your scanner to 'Enigma2', your Agent to 'Personal Media' and that should be it :)

    edit 30/05/2013 - .zip file removed, see further down

  • nickdiacrenickdiacre Posts: 56Members, Plex Pass Plex Pass

    Sorry to butt in! Total python non expert here, so I can't assisst with zany programming etc... but I have tested this out.

    This is awesome, however the each recording title is now given as "YYYYMMDD Name" with the other file name data stripped.

    I've tried it in the following sections

    Movies

    Series

    Home Movies

    All using enigma2 as teh scanner

    It'd be awesome if this worked for me like your screen shot. A I being daft?

    Many thanks, so glad I stumbled across this little beaut! Fingers crossed I can get it to work OK.

  • QuintenQuinten Posts: 43Members ✭✭

    Hi DogBoy,

    Can you do an list of the actual filename that your recordings have?  Mine look exactly like the one christianrodesh posted:

    YYYYMMDD HHMM - Channel - Programme name.ts

    quinten@hp:/mnt/vu/movie/Movies$ ls -la *.ts
    -rw-r--r-- 1 root root 7392845824 Mar 20 22:15 20130320 1933 - RTL7 HD - The Fifth Element.ts
    -rw-r--r-- 1 root root 5977882624 Apr  7 21:08 20130407 1856 - RTL7 HD - Alex Rider - Operation Stormbreaker.ts
    -rw-r--r-- 1 root root 6531162300 May 19 21:29 20130519 1901 - RTL7 HD - The Siege.ts
    -rw-r--r-- 1 root root 7292354560 May 19 23:48 20130519 2111 - RTL7 HD - Lucky Number Slevin.ts

     

    Q.

  • nickdiacrenickdiacre Posts: 56Members, Plex Pass Plex Pass

    Heres the paste:

    Nicks-iMac:VUplus nickdiacre$ ls -la *.ts
    -rw-r--r--  1 root  staff   796614844 18 Apr 07:56 20130418 0727 - CBeebies - Postman Pat_ SDS.ts
    -rw-r--r--  1 root  staff  5831188480 18 Apr 22:54 20130418 2158 - ITV2 HD - Celebrity Juice.ts
    -rw-r--r--  1 root  staff   730390528 19 Apr 07:54 20130419 0728 - CBeebies - Postman Pat_ SDS.ts
    -rw-r--r--  1 root  staff   720764928 20 Apr 07:54 20130420 0728 - CBeebies - Postman Pat.ts
    -rw-r--r--  1 root  staff   570990592 21 Apr 07:54 20130421 0728 - CBeebies - Postman Pat.ts
    -rw-r--r--  1 root  staff   684572672 22 Apr 07:54 20130422 0728 - CBeebies - Postman Pat_ SDS.ts
     
    Seems just the same no?
     
    [attachment=17043:Screen Shot 2013-05-29 at 16.15.48.JPG]
     
    [attachment=17044:Screen Shot 2013-05-29 at 16.11.33.JPG]
     
     
    what do you reckon the problem is?
     
    Thanks for looking at it, much appreciated!
  • QuintenQuinten Posts: 43Members ✭✭

    It looks like you haven't cleaned your section as that is the normal naming convention given to items parsed through the Plex Video Scanner.  Or maybe you need a deep scan, instead of Turbo?

  • nickdiacrenickdiacre Posts: 56Members, Plex Pass Plex Pass

    I tried the old deep scan, how would I clean the section?

  • QuintenQuinten Posts: 43Members ✭✭

    I'm surprised the deep scan didn't work, but with cleaning the section I meant to delete and re-add it.  Or maybe try it on a new section with a small set of files first?  I double checked the .zip file above and it definitely contains my amendment, so if this does not work, I am at a loss...

  • nickdiacrenickdiacre Posts: 56Members, Plex Pass Plex Pass

    My bad, I had been fiddling with the naming system, so a couple of the files were in the "long" format and a couple in the "short" format... this obviously stopped the scanner working entirely for the files that were named correctly.

    So to fix... I went through and made up the missing, but in the correct format, and it worked a-ok!

    Thanks for your help, fab scanner, I hope more enigma2 users find this!

  • QuintenQuinten Posts: 43Members ✭✭

    Pfew, glad you got it working now.  When I got some more time again I will also investigate the Agent option to see if we can get the programme descriptions out of the .eit files.

  • nickdiacrenickdiacre Posts: 56Members, Plex Pass Plex Pass

    Thanks, still ran into a few teething problems, it looked OK last night, but by the time it finished the scan it had reverted to the old format. I deleted the section and cleaned/optimised and then re-added under a new name and it worked a little better.

    Is there a way of making plex group the recordings by program name? Much like in the TV series sections? That'd make browsing the recordings easier...

    This solution is brilliant, my enigma box [Vu+ Solo2] was unable to share .TS content with any of my TVs over DLNA, nor stream recordings using the XBMC PVR backend on ATV2 [fine on SD files but not HD files, a known problem] so using Plex as a transcoder really helps...

  • QuintenQuinten Posts: 43Members ✭✭
    DogBoy wrote on May 30 2013, 7:28 AM: »

    Is there a way of making plex group the recordings by program name? Much like in the TV series sections? That'd make browsing the recordings easier...

    Well, there may be a way, but I have not looked into it at all.  I agree that it would be nice to do so, so I may have a peek and a poke later and see how that works.

  • nickdiacrenickdiacre Posts: 56Members, Plex Pass Plex Pass

    that's be amazing, wish I could offer some support, but I don't know much about python [I know nothing in fact]

    If you need me to test stuff, however :)

  • QuintenQuinten Posts: 43Members ✭✭

    Not finished yet, but first signs are promising ;)  To be continued

  • QuintenQuinten Posts: 43Members ✭✭
    edited June 2013

    Version 2 :)

    This time you have the choice between a Movie scanner or a Series scanner.  The Movie scanner has been tidied up a bit but is largely the same as before in the sense that you can not group shows.  The Series scanner will group shows by using the Programme name and puts them in a season (year) and arranges them by episode (the absolute day number within the season year).

    Next on the list will be the meta-data agent...  I have already got bits for the .eit structure reading, just need to investigate the Agent methods

    Enjoy!

    edit 04/06/2013 - .zip file removed, see further down

  • nickdiacrenickdiacre Posts: 56Members, Plex Pass Plex Pass

    wowsers, fast work... I'll check it out now! Do I need to redo the section as "Series"?

    Nick

  • QuintenQuinten Posts: 43Members ✭✭

    Yes, but maybe do a small (new) section first?  I have two sections, both using the same directory, one for the Movie scanner and one for the TV scanner...  that will give you a good idea which one you'll prefer in the long run

  • nickdiacrenickdiacre Posts: 56Members, Plex Pass Plex Pass

    all working pretty well... only tried the series scanner though... exactly what I needed. GF-friendly and all...

    Part of the problem here is that [at least my] enigma2 box uses tags for organising recordings, rather than folders.

    Separating into folders is a bit laborious, but it'd be good to be able to auto split movies and tv-shows, that way you could apply a different scanner to each folder - disco!

    However, everyone seems happy with the tag system, so it's not a priority I think [I use ViX]. I'll have another sniff round the forums and see if anyone has a view on it...

    Another suggestion, can you copy the code from the existing Plex agent for TV-series enigma2 scanner so it scrapes the TV show artwork [and music?] for the folders on your TV-scanner? I'm probably being basic, but would the same code not work? Or create an enigma2 agent using similar code. Might need to adjust the "Title" for the episodes as it shows the channel and time at the moment...

    You'll have to excuse me, I really have no idea what I am talking about, so it's probably way more complex than that... I should learn python really.

  • QuintenQuinten Posts: 43Members ✭✭
    DogBoy wrote on May 31 2013, 8:07 AM: »

    all working pretty well... only tried the series scanner though... exactly what I needed. GF-friendly and all...
     
    Part of the problem here is that [at least my] enigma2 box uses tags for organising recordings, rather than folders.
     
    Separating into folders is a bit laborious, but it'd be good to be able to auto split movies and tv-shows, that way you could apply a different scanner to each folder - disco!

    This is (AFAIK) not possible. Plex has been designed from the ground up to have seperate sections for Movie content or Series content. It does not group Movies, and Series require a Season/Episode for the grouping. The two are mutually exclusive I'm afraid. The only way to go about it is to split your recordings logically too and have two sections in Plex.
     
    DogBoy wrote on May 31 2013, 8:07 AM: »

    However, everyone seems happy with the tag system, so it's not a priority I think [I use ViX]. I'll have another sniff round the forums and see if anyone has a view on it...
     
    Another suggestion, can you copy the code from the existing Plex agent for TV-series enigma2 scanner so it scrapes the TV show artwork [and music?] for the folders on your TV-scanner? I'm probably being basic, but would the same code not work? Or create an enigma2 agent using similar code. Might need to adjust the "Title" for the episodes as it shows the channel and time at the moment...

    You can try this already yourself. Instead of using Personal Media Shows, set it to TheTVDB. I am going to write an Agent for the .eit files (which contains the EPG description for the recording), but this may take some time
     
    DogBoy wrote on May 31 2013, 8:07 AM: »

    You'll have to excuse me, I really have no idea what I am talking about, so it's probably way more complex than that... I should learn python really.

    No worries, I didn't know how all this worked on Monday, and look where we are now ;)
«134
Sign In or Register to comment.