NextPVR Forums
  • ______
  • Home
  • New Posts
  • Wiki
  • Members
  • Help
  • Search
  • Register
  • Login
  • Home
  • Wiki
  • Members
  • Help
  • Search
NextPVR Forums Information Community Announcements v
« Previous 1 … 8 9 10 11 12 … 56 Next »
New wiki entry: RecoverRecordings

 
  • 0 Vote(s) - 0 Average
New wiki entry: RecoverRecordings
pBS
Offline

Posting Freak

Posts: 4,829
Threads: 182
Joined: Aug 2005
#1
2010-01-14, 08:09 AM (This post was last modified: 2010-01-14, 08:45 AM by pBS.)
Since my old recover recordings.bat file got deleted in forum maintenance, i made a wiki entry for a more premanent home..

It basically imports lost recording's metadata from the metadata.xml on each file and makes a recording-dump.xml file and mports that into pvrx2...A poor man's Vidimport...Smile The data will look just like it did before as it's same data as it used to be.

A nice new feature is that i added is that it adjusts paths on the fly, so if you for example, changed recording dirs, it will adjust the filename inside to the new path automatically..Big Grin

run from a network drive, it will make them network paths...Big Grin

Enjoy, for times of crisis...Wink
http://gbpvr.com/pmwiki/pmwiki.php/Utili...ction=view
Hardware: HDHR Prime, HDPVR 1212, Raspberry pi2, VFD display w/LCDSmartie
martint123
Offline

Posting Freak

UK, East Yorkshire
Posts: 4,658
Threads: 208
Joined: Nov 2005
#2
2010-01-14, 11:50 AM
pBS Wrote:Enjoy, for times of crisis...Wink

Cries of Joy - thanks for this. (now how to store metadata on networked drives???).
pBS
Offline

Posting Freak

Posts: 4,829
Threads: 182
Joined: Aug 2005
#3
2010-01-14, 08:02 PM
hmmm, what do you mean? you can save shows to network drives and they will get metadata.. [not sure about a NAS tho, may need to be a windows box]
Hardware: HDHR Prime, HDPVR 1212, Raspberry pi2, VFD display w/LCDSmartie
martint123
Offline

Posting Freak

UK, East Yorkshire
Posts: 4,658
Threads: 208
Joined: Nov 2005
#4
2010-01-14, 08:43 PM
pBS Wrote:hmmm, what do you mean? you can save shows to network drives and they will get metadata.. [not sure about a NAS tho, may need to be a windows box]

I was thinking of non-NTFS networked drives like nas, linux, PCH or whatever.

Out of curiosity, does gbpvr actually use the metadata for anything ??, if not, I wonder why it was generated for in the first place ??
pBS
Offline

Posting Freak

Posts: 4,829
Threads: 182
Joined: Aug 2005
#5
2010-01-14, 09:01 PM
it's just a backup for the original data...
but it does get used for info display in video library...Smile

to use on a nas non-ntfs drive, convert to a mymovies style xml and store alongside the movie..
Hardware: HDHR Prime, HDPVR 1212, Raspberry pi2, VFD display w/LCDSmartie
Jaggy
Offline

Posting Freak

Carterton, NZ
Posts: 3,639
Threads: 148
Joined: Mar 2006
#6
2010-01-14, 11:04 PM
I had a few minutes spare so I thought I would give it a go.

pBS Wrote:run from a network drive, it will make them network paths...Big Grin

This doesn't work for me....assuming I am doing it right....from my development PC I copied the batch to the recording directory on my server & then ran it from my development PC but it did nothing apart from open a dos window & then close very soon afterward?

Then I tried running it from the server & this time it created a recording-dump.xml but it never finished collecting all the data & seemed to die when it got to the directory "Immortal (Ad Vitam)" or the recording "Immortal (Ad Vitam)_20091208_02200410.ts" I assume it didn't like the "()"?
pBS
Offline

Posting Freak

Posts: 4,829
Threads: 182
Joined: Aug 2005
#7
2010-01-15, 03:34 AM
yea, i wouldn't recommend it with renamed files...pretty sure those chars are not dos compatible..tho i may be able to get around it..

try this one, no adjustments..
i just wanna see if it works this way..
Code:
@echo off
setlocal ENABLEDELAYEDEXPANSION
echo.
echo. Generating Recording Import data for all .mpg's in
echo.     %~dp0recording-dump.xml
echo.
echo ^<?xml version="1.0" encoding="UTF-8"?^> > %~dp0recording-dump.xml
echo ^<recordings^> >>%~dp0recording-dump.xml
FOR /R %~dp0 %%f IN (*.mpg *.ts *.dvr-ms *.avi) DO (call :extract "%%~f")
echo ^</recordings^> >> %~dp0recording-dump.xml

echo.
echo Done.
echo.
echo Hit any key to import into database or 'Control-c' to exit and edit recording-dump.xml.
pause
for /f "usebackq skip=4 tokens=1,2,3,* " %%a in (`reg query hklm\SOFTWARE\devnz /v "GBPVR InstallDir"`) do set gbpvrdir=%%d
"%gbpvrdir%pvrx2.exe" -import:"%~dp0recording-dump.xml"
echo Importing....
echo Done.
goto :eof

:extract
echo ""
for /f "usebackq tokens=* skip=1 delims=*" %%p in ("%~1:metadata.xml") do echo       %%p >> "%~dp0recording-dump.xml"
goto :eof
Hardware: HDHR Prime, HDPVR 1212, Raspberry pi2, VFD display w/LCDSmartie
pBS
Offline

Posting Freak

Posts: 4,829
Threads: 182
Joined: Aug 2005
#8
2010-01-15, 04:02 AM
hmm,got it working by using quotes...now just need to find out if that messes anything up..
Hardware: HDHR Prime, HDPVR 1212, Raspberry pi2, VFD display w/LCDSmartie
Jaggy
Offline

Posting Freak

Carterton, NZ
Posts: 3,639
Threads: 148
Joined: Mar 2006
#9
2010-01-15, 04:44 AM
pBS Wrote:yea, i wouldn't recommend it with renamed files...pretty sure those chars are not dos compatible..tho i may be able to get around it..

It isn't a renamed file, that is as it is when it was recorded by GB-Pvr.

Quote:try this one, no adjustments..
i just wanna see if it works this way..

Yep that one didn't die & went right through & it also ran when I invoked it across the network but it didn't put network paths in the resulting recording-dump.xml.

Interesting when I was running it from my development PC it was a lot slower & I was able to see a few couldn't find metadata files error messages while it was running....might be nice if it could log these so you know they haven't been imported if possible?
pBS
Offline

Posting Freak

Posts: 4,829
Threads: 182
Joined: Aug 2005
#10
2010-01-15, 06:01 AM (This post was last modified: 2010-01-15, 08:24 PM by pBS.)
ahh,after some major tweaking, fixed...

but this one won't be as bulletproof as it makes some assumptions about the order of lines in xml..
[line 3 has to always be filename]
problem with logging is, you can't test for presence of an alt-stream, so hard to log..
the one i had on here that got deleted had logging...
Code:
@echo off
echo.
echo. Generating Recording Import data for all .mpg's in
echo.     %~dp0recording-dump.xml
echo.
echo ^<?xml version="1.0" encoding="UTF-8"?^> > %~dp0recording-dump.xml
echo ^<recordings^> >>%~dp0recording-dump.xml
FOR /R %~dp0 %%f IN (*.mpg *.ts *.dvr-ms *.avi) DO (call :extract "%%~f")
echo ^</recordings^> >> %~dp0recording-dump.xml

echo.
echo Done.
echo.
echo Hit any key to import into database or 'Control-c' to exit and edit recording-dump.xml.
pause
for /f "usebackq skip=4 tokens=1,2,3,* " %%a in (`reg query hklm\SOFTWARE\devnz /v "GBPVR InstallDir"`) do set gbpvrdir=%%d
rem  "%gbpvrdir%pvrx2.exe" -import:"%~dp0recording-dump.xml"
echo Importing....
echo Done.
goto :eof


:extract
for /f "usebackq tokens=* skip=1 delims=*" %%a in ("%~1:metadata.xml") do if "%%a"=="" goto :not  
for /f "usebackq tokens=* skip=3 delims=*" %%b in ("%~1:metadata.xml") do if not "%%b"=="" echo  ^<Recording^> >> "%~dp0recording-dump.xml" && goto :file
:file
for /f "usebackq tokens=* skip=2 delims=*" %%m in ("%~1:metadata.xml") do echo   ^<filename^>%~1^</filename^> >> "%~dp0recording-dump.xml" && goto :next
:next
for /f "usebackq tokens=* skip=3 delims=*" %%p in ("%~1:metadata.xml") do echo  %%p >> "%~dp0recording-dump.xml"
goto :eof

:not
echo No metadata for %1

now should be safe for any filename that can exist on disk...network access too..Smile
[i could echo out the name, just not while in a ( ), so had to do it all separately..]
Hardware: HDHR Prime, HDPVR 1212, Raspberry pi2, VFD display w/LCDSmartie
« Next Oldest | Next Newest »

Users browsing this thread: 1 Guest(s)

Pages (2): 1 2 Next »


Possibly Related Threads…
Thread Author Replies Views Last Post
  Wiki updates for NextPVR 2.3.6 McBainUK 3 2,656 2012-02-19, 10:18 AM
Last Post: Grampz
  MpegImport utility added to wiki sixgun 66 23,458 2010-05-25, 01:48 PM
Last Post: carpeVideo
  WIKI Status fhmanas 3 1,923 2009-03-04, 02:06 PM
Last Post: McBainUK
  BurndvdX2 Version 1.0.1.8 posted to wiki pastro 1 1,470 2009-02-04, 03:50 AM
Last Post: pbb
  Wiki Plugin/Skin housekeeping. Fatman_do 14 4,521 2008-12-11, 02:46 AM
Last Post: Fatman_do
  updated recoverrecordings.bat pBS 10 5,435 2008-11-14, 01:16 PM
Last Post: pBS
  New version 0.47 of XRecord is available on the wiki fla 35 9,358 2007-05-26, 10:39 PM
Last Post: fla
  GameZone V0.2 now in the Wiki idkpmiller 2 1,373 2006-12-31, 12:30 AM
Last Post: idkpmiller
  2 New Plugins added to Wiki rwmech 0 1,339 2006-10-16, 05:16 PM
Last Post: rwmech
  New wiki page Fatman_do 6 2,256 2006-05-25, 09:16 PM
Last Post: Fatman_do

  • View a Printable Version
  • Subscribe to this thread
Forum Jump:

© Designed by D&D, modified by NextPVR - Powered by MyBB

Linear Mode
Threaded Mode