Naming of recorded files

Ir abajo

Naming of recorded files

Mensaje  alfred.fent el Sáb Oct 23, 2010 9:52 pm

Hi all,

I notice a small inconvenience with regards to naming of recorded files... when a program is recorded, the filename on the harddisk is like "Name_YYYYMMDD_HHMM.ts", so for example "The Simpsons_20101023_1830".

The problem now is in the "name" part of it (i.e. "The Simpsons" in the example above), which seems to be extracted directly from the broadcasted program. Typically, I start recordings some minutes ahead of the "official" start time of a program (so, if the Simpsons are scheduled for 18:30, I would program the start for 18:25). However, this leads to a wrong naming of the file, because it now gets the name of the program before the one I wanted to record (so, if there is "News" before the Simpsons, the file would be called "News_20101023_1825.ts"). So I always have to know what was broadcasted before my recording, in order to watch it...

Is there any way around this? Ideally, the name of the file would not be determined by what is broadcasted at the beginning of the recording time, but in the middle of the recording time... but this would mean that you have to know in the beginning (when the file is created) what will be broadcasted in e.g. 30min (assuming this is "the middle")... I don't know if this is (easily) possible...

Any thoughts on this?

Thanks and regards

Alfred

alfred.fent

Mensajes : 13
Fecha de inscripción : 17/10/2010

Ver perfil de usuario

Volver arriba Ir abajo

Re: Naming of recorded files

Mensaje  vic1972 el Dom Oct 24, 2010 9:59 am

yes, we are aware of that issue.
unfortunately is under lg's control.
it will be very nice if some tricks could be applied as you state, but we do not have access to lg source code, neither the EPG info frames.
regards
avatar
vic1972

Mensajes : 2260
Fecha de inscripción : 09/12/2009
Edad : 46
Localización : Malaga

Ver perfil de usuario

Volver arriba Ir abajo

Re: Naming of recorded files

Mensaje  alfred.fent el Dom Oct 24, 2010 11:02 am

Hi Vic,

vic1972 escribió:yes, we are aware of that issue.
Phew, then I am not the only one, and my bad conscience for being so picky is a little bit better...

vic1972 escribió:
unfortunately is under lg's control.
it will be very nice if some tricks could be applied as you state, but we do not have access to lg source code, neither the EPG info frames.
Then just to throw an idea into the arena for a semi-automatic workaround:
  • Add name entry field to scheduling page (besides date, time, program, etc). I.e., user enters not only "record on Oct 24, 18:30 - 19:00, program 3, to HDD", but adds "program is called The Simpsons"
  • When scheduling is over (i.e. one minute after the end time), a new name is created from the name entered on the scheduling page, plus date/time as normal. I.e. new name is "The Simpsons_20101024_1830".
  • Then the "original" file is renamed to the new name, i.e. "mv *_20101024_1830 'The Simpsons_20101024_1830'" (I know this will only work as planned if there is exactly one recording starting at that particular time...)

Would something like this work? Prerequisite would be to run a command at a certain time (cron/at job?)...

Possible changes / additional features
  • original file is not renamed to new name, but it keeps intact and only a symbolic link or hard link with the new name is created (symlink posing challenges when original file is deleted... and: does the file system on the LG support links at all?)
  • in addition to a name, also a category can be entered on the scheduling page, and the new name will contain this category as a directory name; so, recordings (or links to recordings) would automatically be sorted


Just some crazy ideas on Sunday morning... tongue

Thanks and regards

Alfred

alfred.fent

Mensajes : 13
Fecha de inscripción : 17/10/2010

Ver perfil de usuario

Volver arriba Ir abajo

Re: Naming of recorded files

Mensaje  Keltek el Lun Oct 25, 2010 1:31 am

This is really crazy idea Smile
If you schedule two shows started at same time on different channel, you are impossible to detect which should be renamed to "a" and which to "b".
For second - detection of ended scheduling is little sophisticated and I can't imagine how to do it (maybe from the DvdPlayer output).
avatar
Keltek

Mensajes : 291
Fecha de inscripción : 10/03/2010
Edad : 40
Localización : Praha - Czech Republic

Ver perfil de usuario http://www.fozona.cz/

Volver arriba Ir abajo

Re: Naming of recorded files

Mensaje  vic1972 el Lun Oct 25, 2010 8:06 am

I like the second idea, automatic move of RECS to named folders.
I will write this in my investigate list. thanks for the idea.
avatar
vic1972

Mensajes : 2260
Fecha de inscripción : 09/12/2009
Edad : 46
Localización : Malaga

Ver perfil de usuario

Volver arriba Ir abajo

Re: Naming of recorded files

Mensaje  Seb@stien el Lun Oct 25, 2010 10:12 am

Hello,

Keltek and victor, just to give you an other idea :

Records have the EPG Frame include into.
For example, if you read a record with VLC (latest version), you can see the title (window title and flux propertie)
The idea is to develop a script/prg to rename a record when it was finished by the web interface using the EPG frame
I work on it but without success Sad

What do you think about it ?

Seb@stien

Seb@stien

Mensajes : 93
Fecha de inscripción : 15/12/2009

Ver perfil de usuario

Volver arriba Ir abajo

Re: Naming of recorded files

Mensaje  vic1972 el Lun Oct 25, 2010 11:11 am

Yeah Smile
very interesting.

We need now some information on how to extract his info from a .ts file.
Hopefully we can find a library or utilities, with easy conversion into mipsel ...
ideas... links .... ???
Thanks


avatar
vic1972

Mensajes : 2260
Fecha de inscripción : 09/12/2009
Edad : 46
Localización : Malaga

Ver perfil de usuario

Volver arriba Ir abajo

Re: Naming of recorded files

Mensaje  alfred.fent el Lun Oct 25, 2010 10:47 pm

Hello all,

Keltek escribió:This is really crazy idea Smile
Sunday morning, brain just booted up after a shutdown day, ... Smile

Keltek escribió:
If you schedule two shows started at same time on different channel, you are impossible to detect which should be renamed to "a" and which to "b".
Correct, but should be easy to detect, assuming you know the start time: just do a (bash) "ls *YYYYMMDD_HHMM.ts | wc -l", and if the result is not 1, then better do nothing than do something wrong...

Or, add some checks to scheduling interface: if user wants to provide his own name for the recording (because only then it is relevant), then no two recordings must start at the same time. If user tries to schedule two recordings at the same time, then he either gets an error, or the interface changes one start time to one minute earlier (e.g. 18:29 instead of 18:30) and shows the respective notification to the user.

Keltek escribió:
For second - detection of ended scheduling is little sophisticated and I can't imagine how to do it (maybe from the DvdPlayer output).

Two ideas on how to do it with Unix-shell only means:
  1. when a new scheduling is entered via the web interface, also add a cron job which runs one minute after the end of the scheduled recording; this cron job takes care of the renaming, i.e. the web interface will generate the to-be-name, and add a call to a script like "rename_recording <start-date-time> <to-be-name> <hdd location>" . For example, scheduling from 18:30 - 19:00 will add a cron job for 19:01 (or 19:02, in case a recording which ends on 19:00 in fact ends at 19:00:59) with an entry like "rename_recording 20101026_1830 'The Simpsons' HDD+", and the script will be like (pseudo-code)
    Código:
    from=$1
    to=$2
    dir=$3
    cd  ´convert $dir to real directory´
    if ´ls *$from | wc -l´ == 1 then
      mv *$from $to_$from  # or ln -s or whatever...
    else
      # do nothing
    fi
    Of course this would mean that the web interface will have to take care not only about entering these into crontab, but also modification of crontab if a program is changed. In essence, crontab would have to mirror the scheduling database...

  2. Alternative approach, if permanent entering/modifying/deleting from the crontab is too complicated: if I am not mistaken, during a recording the (still incomplete) recording file has a name which ends in "_R00.ts". So, an approach could be to run a job every 5 minutes or so (either via a simple cronjob, or via an endless loop with a "sleep 5m" in it) which looks for files with the "R00.ts" in the end in the recording locations; when such file exists, a recording is going on. If it disappears, recording is over. So, again pseudo-code:
    Código:
    while true do  # endless loop
      sleep 5m
      for dir in <possible REC directories> do
          if exists *R00.ts file then
            extract date and time of recording from R00.ts file name
            get "target filename" from scheduling database using date and time of R00.ts file name
            write into buffer file "name of R00.ts file" and "target filename"
          fi
          if buffer file contains some file name then
            for each R00.ts file listed in the buffer file do
                if file name from buffer file (i.e. R00.ts file detected earlier) still exists then
                  # do nothing
                else
                  remove _R00 extension from file name which was read from the buffer file
                  rename resulting file to target file name (which was also read from buffer file)
                  remove R00.ts file name from buffer file
                fi
            done
          fi
      done
    done

    Of course, this also has its downsides... harddisk is accessed every 5 min... recordings shorter than 5 min could be overlooked, etc...


Again, just some crazy ideas... :-)

Thanks and regards

Alfred

alfred.fent

Mensajes : 13
Fecha de inscripción : 17/10/2010

Ver perfil de usuario

Volver arriba Ir abajo

Re: Naming of recorded files

Mensaje  matthelas el Mar Oct 26, 2010 12:59 pm

vic1972 escribió:Yeah Smile
very interesting.

We need now some information on how to extract his info from a .ts file.
Hopefully we can find a library or utilities, with easy conversion into mipsel ...
ideas... links .... ???

Hi guys ^^
If that's in the .ts, then it is in the EIT table, should be current/following. Have a look at EN 300468 for more information about the table itself, it is not a really hard one (but beware character codes, etc.). The issue is then to extract the right table (not the first one since it has the wrong name in it, or you have to check the following event then, or just get an EIT from some minutes ahead, or check all EIT, when they are sent and make a decision about the name to keep, etc. Smile ) from the TS packets. That is not an obvious task since you have to read a lot of other information to locate the EITs, and since you need to browse within the file. If there are DVB libraries that could be ported to the LG, this could help.

If you need further info about EIT, I can further dig in.

Cheers,
Matt

matthelas

Mensajes : 145
Fecha de inscripción : 08/02/2010

Ver perfil de usuario

Volver arriba Ir abajo

Re: Naming of recorded files

Mensaje  Contenido patrocinado


Contenido patrocinado


Volver arriba Ir abajo

Volver arriba

- Temas similares

 
Permisos de este foro:
No puedes responder a temas en este foro.