NextPVR Forums

Full Version: Import recorded tv shows to NPVR
You're currently viewing a stripped down version of our content. View the full version with proper formatting.
Hi,

I have a couple shows recorded in wtv format from Media Center. I have converted them to ts and attempted to import them to NPVR but the import dialog says there is no metadata...so no recordings are imported. I tried Vid Import and it did work...but it didn't group my series recordings together (I am also using the TV Listings plugin). The Vid Import wiki has lots of commands to output various data in the xml, however there are no clear instructions on how to use it. I accidentally figured out that dragging the video file onto the Vid Import.exe generated an xml that would import the tv shows. However, again, it doesn't group the shows together.

So, is it possible to have the imported shows grouped together with others in the same series? And are there clearer directions somewhere for Vid Import?

Thanks!
That's what I use the video folder for. I have a lot of downloaded video files and I put them in a hard drive directory (C:/Videos, for example) then name that direcctory in the Media Folders/Video Folder. If your videos are in a Series folder, they will be grouped together like you want. There's no need to convert them to .ts files.
A question for SUB maybe.
What determines the displayed grouping of imported recordings?
I imported Series 1-3 of "The 100" using an manually prepared xml file.
Although the fields look consistent Name, Title etc. (and so do entries in the database), NPVR shows two separate groups of The 100 in the recording listings
1 group contains Series 1-2 and the other Series 3.
Bobins Wrote:A question for SUB maybe.
What determines the displayed grouping of imported recordings?
I imported Series 1-3 of "The 100" using an manually prepared xml file.
Although the fields look consistent Name, Title etc. (and so do entries in the database), NPVR shows two separate groups of The 100 in the recording listings
1 group contains Series 1-2 and the other Series 3.
Grouped in the Recordings screen? Just the name of the show. If you've got two groups, then you must have slight difference in the name, like "the" vs "The"
mattman1968 Wrote:I have a couple shows recorded in wtv format from Media Center. I have converted them to ts and attempted to import them to NPVR but the import dialog says there is no metadata...
When importing a .ts file, it expects it'll be a NextPVR created file, which includes metadata, like show name and description, channel etc.

Your best bet to create an xml file in the same format as c:\users\public\npvr\record-backup.xml, edited to have the correct paths to your file, and names/descriptions etc, and then import that file.
SUB.

I couldn't see any difference till I went to text edit the name field in the database and discovered an errant space after the 100 in the series 1 & 2 name field. Doh!
Fixed it now :-)
sub Wrote:When importing a .ts file, it expects it'll be a NextPVR created file, which includes metadata, like show name and description, channel etc.

Your best bet to create an xml file in the same format as c:\users\public\npvr\record-backup.xml, edited to have the correct paths to your file, and names/descriptions etc, and then import that file.

Thanks for the assist. This got the shows all grouped together nicely. However, the imported shows don't have any program description even though I included it in the xml. The record-backup.xml has OID identifiers that don't make any sense to me. I think that since I don't have those it may be part of the reason. Anyway, I can live without a couple shows that don't have the program info. Having them grouped correctly was more important to me.
Attached is an old batch file that will scan a directory and subdirectories for video files and build an importable .xml file. It will extract metadata in the file, if it was written by GB-PVR/NextPVR in the first place.

You'll have to modify it to include .wtv files (the FOR loop command after the 6 echo commands contains the extension list).

It was written for GB-PVR, but the format is still compatible. The automatic import at the end won't work of course, you just hit Ctrl-C and then import it from NextPVR Settings.

I didn't write it, I have no recollection who did as it was a very long time ago.

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 (
set line=%%p
if "!line:filename=!" NEQ "!line!" (    
    echo       ^<filename^>%~1^</filename^> >> "%~dp0recording-dump.xml"
    ) else (echo    %%p >> "%~dp0recording-dump.xml")
)
goto :eof
@ johnsonx42
Thanks for the program but I could not figure out how to use it. I placed it in the folder with the files and ran it...but it ran within a nano-second and didn't produce any results. No problems though. I manually reviewed/edited my xml with the recording-backup.xml, and was able to import my few shows correctly after editing. Now I have a template should I have to import anything else.
I have written a PowerShell script at the following link to do this. It's worked a treat on our library of .wtv files!

https://forums.nextpvr.com/showthread.php?tid=60142