Re: Restoring recordings from image
vdr user #7 <[email protected]> Mon, 3 Jul 2023 15:44:37 +0200
| Newsgroups | gmane.linux.vdr |
|---|---|
| Message-ID | <[email protected]> |
This is a multi-part message in MIME format.
--===============0481228051463661279==
Content-Type: multipart/alternative;
boundary="------------5ALCnqKTh1M2ri3dp7MuYPBf"
Content-Language: en-US
This is a multi-part message in MIME format.
--------------5ALCnqKTh1M2ri3dp7MuYPBf
Content-Type: text/plain; charset=UTF-8; format=flowed
Content-Transfer-Encoding: quoted-printable
Hi,
15 years ago I've accidently deleted an XFS drive full of recordings.
And even in those (*.vdr) days foremost wasn't the most successful tool
in order to recover recordings.
What I've done:
=C2=A0=C2=A0=C2=A0 1. I've made an (dd-) image
=C2=A0=C2=A0=C2=A0 2. I used a modified version of genindex to scan the i=
mage
The result where thousands of small video files (the number depends on
the degree of fragmentation of your drive).
This was working fairly well, but most of the recordings were not worth
recovering because I had to solve the puzzle of concatinating dozens of
files (out of the thousands) in the correct order.
But if it helps you here is my patch:
diff -ur genindex-0.1.3.orig/file.c genindex-0.1.3/file.c
=2D-- genindex-0.1.3.orig/file.c=C2=A0=C2=A0=C2=A0 2006-06-01 22:09:10.000=
000000 +0200
+++ genindex-0.1.3/file.c=C2=A0=C2=A0=C2=A0 2008-11-19 14:59:52.000000000 =
+0100
@@ -181,16 +181,20 @@
=C2=A0cFileName::~cFileName()
=C2=A0{
+=C2=A0 printf("=3D=3D=3D=3D>close %s<=3D=3D=3D=3D\n", filename);
=C2=A0=C2=A0 close(fd);
=C2=A0}
-int cFileName::Open(void)
+int cFileName::Open(off64_t xxx =3D 0)
=C2=A0{
=C2=A0=C2=A0 close(fd); fd=3D-1;
=C2=A0=C2=A0 cString filename;
=C2=A0=C2=A0 if(input) filename=3Dinput;
=C2=A0=C2=A0 else filename=3DcString::sprintf(FILENAME,fileno);
=C2=A0=C2=A0 fd=3Dopen64(filename,O_RDONLY);
+=C2=A0 if (xxx > 0) {
+=C2=A0=C2=A0=C2=A0 lseek64(fd,xxx,SEEK_SET);
+=C2=A0 }
=C2=A0=C2=A0 if(fd>=3D0) {
=C2=A0=C2=A0=C2=A0=C2=A0 struct stat64 st;
=C2=A0=C2=A0=C2=A0=C2=A0 if(fstat64(fd,&st)=3D=3D0) {
diff -ur genindex-0.1.3.orig/file.h genindex-0.1.3/file.h
=2D-- genindex-0.1.3.orig/file.h=C2=A0=C2=A0=C2=A0 2006-06-01 17:12:25.000=
000000 +0200
+++ genindex-0.1.3/file.h=C2=A0=C2=A0=C2=A0 2008-11-19 15:01:15.000000000 =
+0100
@@ -54,12 +54,13 @@
=C2=A0public:
=C2=A0=C2=A0 cFileName(const char *Input, bool LargeOK);
=C2=A0=C2=A0 ~cFileName();
-=C2=A0 int Open(void);
+=C2=A0 int Open(off64_t);
=C2=A0=C2=A0 int NextFile(void);
=C2=A0=C2=A0 int OpenWrite(void);
=C2=A0=C2=A0 int NextWriteFile(void);
=C2=A0=C2=A0 int Skip(int nr, int off);
=C2=A0=C2=A0 int FileNumber(void) { return fileno; }
+=C2=A0 void SetFileNumber(int i) {fileno =3D i;}
=C2=A0=C2=A0 long long FileSize(void) { return size; }
=C2=A0=C2=A0 };
Only in genindex-0.1.3: file.o
Only in genindex-0.1.3: genindex
diff -ur genindex-0.1.3.orig/genindex.c genindex-0.1.3/genindex.c
=2D-- genindex-0.1.3.orig/genindex.c=C2=A0=C2=A0=C2=A0 2006-06-02 15:44:31=
.000000000 +0200
+++ genindex-0.1.3/genindex.c=C2=A0=C2=A0=C2=A0 2008-11-19 15:00:58.000000=
000 +0100
@@ -41,6 +41,8 @@
=C2=A0char *destdir=3D0;
=C2=A0char *input=3D0;
=C2=A0int splitsize=3D2000;
+long long startat=3D0;
+int firstnum=3D1;
=C2=A0bool rewrite=3Dfalse;
=C2=A0bool quiet=3Dfalse;
@@ -61,6 +63,7 @@
=C2=A0=C2=A0 //
=C2=A0=C2=A0 unsigned int sSize;
=C2=A0=C2=A0 int splitOffset;
+=C2=A0 long long startOffset;
=C2=A0=C2=A0 bool pstart;
=C2=A0=C2=A0 //
=C2=A0=C2=A0 unsigned char buff[KILOBYTE(256)];
@@ -77,7 +80,7 @@
=C2=A0public:
=C2=A0=C2=A0 cGenIndex(void);
=C2=A0=C2=A0 ~cGenIndex();
-=C2=A0 void Work(void);
+=C2=A0 void Work(off64_t);
=C2=A0=C2=A0 void Skip(int type);
=C2=A0=C2=A0 };
@@ -86,6 +89,7 @@
=C2=A0=C2=A0 index=3Dnew cIndex(destdir);
=C2=A0=C2=A0 fileName=3Dnew cFileName(input,input && rewrite);
=C2=A0=C2=A0 writeName=3Dnew cFileName(destdir,true);
+=C2=A0 writeName->SetFileNumber(firstnum);
=C2=A0=C2=A0 if(rewrite) {
=C2=A0=C2=A0=C2=A0=C2=A0 SetDefaultRule(prSkip);
@@ -124,7 +128,7 @@
=C2=A0=C2=A0 return replayFile>=3D0;
=C2=A0}
-void cGenIndex::Work(void)
+void cGenIndex::Work(off64_t startat =3D 0)
=C2=A0{
=C2=A0=C2=A0 eof=3Derror=3Dpstart=3Dfalse;
=C2=A0=C2=A0 memset(fileSize,0,sizeof(fileSize));
@@ -137,14 +141,16 @@
=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0 }
=C2=A0=C2=A0=C2=A0=C2=A0 }
-=C2=A0 replayFile=3DfileName->Open();
+=C2=A0 readOffset=3Dstartat;
+
+=C2=A0 replayFile=3DfileName->Open(readOffset);
=C2=A0=C2=A0 readNo=3DfileName->FileNumber();
=C2=A0=C2=A0 fileSize[readNo]=3DfileName->FileSize();
-=C2=A0 readOffset=3D0;
=C2=A0=C2=A0 fileNo=3Drewrite ? 1 : readNo;
=C2=A0=C2=A0 fileOffset=3D0;
=C2=A0=C2=A0 splitOffset=3Dsplitsize*MEGABYTE(1);
+=C2=A0 startOffset=3Dstartat*MEGABYTE(1);
=C2=A0=C2=A0 sSize=3D0;
=C2=A0=C2=A0 if(replayFile>=3D0) {
@@ -236,7 +242,7 @@
=C2=A0=C2=A0=C2=A0=C2=A0 }
=C2=A0=C2=A0 if(rewrite) {
-=C2=A0=C2=A0=C2=A0 if(scan && fileOffset>=3DsplitOffset && (pstart || sSi=
ze)) {
+=C2=A0=C2=A0=C2=A0 if(scan && (fileOffset>=3DsplitOffset || nextFile) && =
(pstart ||
sSize)) {
=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0 if(sSize+len>sizeof(store)) {
=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0 printf("Oops! Packet buf=
fer overflow\n");
=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0 error=3Dtrue;
@@ -246,7 +252,7 @@
=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0 sSize+=3Dlen;
=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0 }
=C2=A0=C2=A0=C2=A0=C2=A0 else {
-=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0 if(fileOffset>=3DsplitOffset && sSize && f=
type=3D=3DI_FRAME) {
+=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0 if((fileOffset>=3DsplitOffset || nextFile)=
&& sSize &&
ftype=3D=3DI_FRAME) {
=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0 writeFile=3DwriteName->N=
extWriteFile();
=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0 if(writeFile<0) {
=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0 printf("Fail=
ed to open output file(s)\n");
@@ -254,6 +260,7 @@
=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0 return -1;
=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0 }
=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0 packetNo=3DfileNo=3Dwrit=
eName->FileNumber();
+=C2=A0=C2=A0=C2=A0 nextFile=3Dfalse;
=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0 packetOffset=3D0;
=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0 fileOffset=3DsSize;
=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0 }
@@ -343,6 +350,8 @@
=C2=A0{
=C2=A0=C2=A0 static struct option long_options[] =3D {
=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0 { "rewrite",=C2=A0 no_argument,=C2=
=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0 NULL, 'r' },
+=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0 { "startat",=C2=A0 required_argument, NULL=
, 'a' },
+=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0 { "firstnum", required_argument, NULL, 'f'=
},
=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0 { "quiet",=C2=A0=C2=A0=C2=A0 no_argu=
ment,=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0 NULL, 'q' },
=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0 { "dest",=C2=A0=C2=A0=C2=A0=C2=A0 re=
quired_argument, NULL, 'd' },
=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0 { "split",=C2=A0=C2=A0=C2=A0 require=
d_argument, NULL, 's' },
@@ -353,8 +362,14 @@
=C2=A0=C2=A0 int s=3D0, str[MAX_STR];
=C2=A0=C2=A0 int c;
- while((c=3Dgetopt_long(argc,argv,"rqd:s:i:",long_options,NULL))!=3D-1) {
+ while((c=3Dgetopt_long(argc,argv,"rqd:s:i:a:f:",long_options,NULL))!=3D-=
1) {
=C2=A0=C2=A0=C2=A0=C2=A0 switch (c) {
+=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0 case 'a':
+=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0 startat=3Datoll(optarg);
+=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0 break;
+=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0 case 'f':
+=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0 firstnum=3Datoi(optarg);
+=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0 break;
=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0 case 'r':
=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0 rewrite=3Dtrue;
=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0 break;
@@ -396,6 +411,8 @@
=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0 about();
=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0 printf("\nUsage: geninde=
x [-r] [-d DIR] [-s SIZE]\n\n"
=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=
=C2=A0=C2=A0=C2=A0 "=C2=A0 -i FILE, --input FILE=C2=A0 use a single input =
file\n"
+=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=
=C2=A0=C2=A0 "=C2=A0 -a,=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0 --startat=C2=A0=C2=
=A0=C2=A0=C2=A0 start reading input file at
position\n"
+=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=
=C2=A0=C2=A0 "=C2=A0 -f,=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0 --firstnum=C2=A0=C2=
=A0=C2=A0 start numbering output file at
num\n"
=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=
=C2=A0=C2=A0=C2=A0 "=C2=A0 -r,=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0 --rewrite=C2=
=A0=C2=A0=C2=A0=C2=A0 rewrite video files\n"
=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=
=C2=A0=C2=A0=C2=A0 "=C2=A0 -d DIR,=C2=A0 --dest=3DDIR=C2=A0=C2=A0=C2=A0 se=
t destination dir\n"
=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=
=C2=A0=C2=A0=C2=A0 "=C2=A0 -s SIZE, --split=3DSIZE=C2=A0 split files at me=
gabyte count\n"
@@ -421,6 +438,6 @@
=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0 }
=C2=A0=C2=A0=C2=A0=C2=A0 if(!quiet) printf("\n\n");
=C2=A0=C2=A0=C2=A0=C2=A0 }
-=C2=A0 gi.Work();
+=C2=A0 gi.Work(startat);
=C2=A0=C2=A0 return 0;
=C2=A0}
Only in genindex-0.1.3: genindex.o
diff -ur genindex-0.1.3.orig/pes.c genindex-0.1.3/pes.c
=2D-- genindex-0.1.3.orig/pes.c=C2=A0=C2=A0=C2=A0 2003-07-26 23:55:21.0000=
00000 +0200
+++ genindex-0.1.3/pes.c=C2=A0=C2=A0=C2=A0 2008-10-26 23:32:44.000000000 +=
0100
@@ -11,7 +11,7 @@
=C2=A0#include "pes.h"
=C2=A0#include "ringbuffer.h"
-#define DEBUG(x...) printf(x)
+#define DEBUG(x...) fprintf(stderr, x)
=C2=A0//#define DEBUG(x...)
=C2=A0//#define PD(x...) printf(x)
@@ -23,6 +23,7 @@
=C2=A0{
=C2=A0=C2=A0 rb=3Dnew cRingBufferFrame(KILOBYTE(50));
=C2=A0=C2=A0 defaultRule=3Dru;
+=C2=A0 nextFile=3Dfalse;
=C2=A0=C2=A0 Reset();
=C2=A0}
@@ -109,6 +110,7 @@
=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0 }
=C2=A0=C2=A0=C2=A0=C2=A0 }
=C2=A0=C2=A0 else if(skipped) {
+=C2=A0=C2=A0 nextFile=3Dtrue;
=C2=A0=C2=A0=C2=A0 totalSkipped+=3Dskipped;
=C2=A0=C2=A0=C2=A0 if(skipped=3D=3Dzeros) totalZeros+=3Dzeros;
=C2=A0=C2=A0=C2=A0 else DEBUG("PES: skipped %d bytes\n",skipped);
diff -ur genindex-0.1.3.orig/pes.h genindex-0.1.3/pes.h
=2D-- genindex-0.1.3.orig/pes.h=C2=A0=C2=A0=C2=A0 2003-07-26 23:54:51.0000=
00000 +0200
+++ genindex-0.1.3/pes.h=C2=A0=C2=A0=C2=A0 2008-10-26 18:59:26.000000000 +=
0100
@@ -25,6 +25,7 @@
=C2=A0class cPES : public cMutex {
=C2=A0protected:
=C2=A0=C2=A0 enum eRule { prPass, prSkip, prAct1, prAct2, prAct3, prAct4,=
prAct5,
prAct6, prAct7, prAct8 };
+=C2=A0 bool nextFile;
=C2=A0private:
=C2=A0=C2=A0 eRule rules[NUM_RULESETS][NUM_RULES], *currRules, currRule, =
defaultRule;
=C2=A0=C2=A0 int currNum;
Only in genindex-0.1.3: pes.o
Only in genindex-0.1.3: ringbuffer.o
Only in genindex-0.1.3: thread.o
Christian.
On 2023-07-03 14:34, Kartsa wrote:
> Hi
>
> I=E2=80=99ve had VDR running for almost 20 years now. Not continuously o=
f course and occasionally I have updated the system and added more disk an=
d new MB and CPU and so.
>
> My problem is that I had an external disk for saving recordings which di=
d not fit on the internal hard disk and now the external disk has failed. =
I had XFS on the disk and I have been able to create an image of the disk =
(probably with big chunks missing) but I have not been able to restore any=
of the recordings from the image. I have tried with foremost but the prob=
lem is the ts files. Foremost does not recognise them out of the box and I=
would need some header/footer information of the files. But to my underst=
anding the ts files have no special footer which would indicate the ending=
of a file. Have tried to recognise from current recordings the header and=
tried with that. Foremost has been able to restore the info files but tho=
se are not a big help.
>
> Anyway I was wondering if there are any tools that I could try to restor=
e the recordings. I have tried a lot of different tools (including testdis=
k and photorec) but have not had any real luck. So any instructions and/or=
pointers would be appreciated :)
>
> BR
> \\Kartsa
>
>
> _______________________________________________
> vdr mailing list
> [email protected]
> https://www.linuxtv.org/cgi-bin/mailman/listinfo/vdr
--------------5ALCnqKTh1M2ri3dp7MuYPBf
Content-Type: text/html; charset=UTF-8
Content-Transfer-Encoding: quoted-printable
<html>
<head>
<meta http-equiv=3D"Content-Type" content=3D"text/html; charset=3DUTF-=
8">
</head>
<body>
Hi,<br>
15 years ago I've accidently deleted an XFS drive full of
recordings. And even in those (*.vdr) days foremost wasn't the most
successful tool in order to recover recordings.<br>
<br>
What I've done:<br>
<br>
=C2=A0=C2=A0=C2=A0 1. I've made an (dd-) image<br>
=C2=A0=C2=A0=C2=A0 2. I used a modified version of genindex to scan th=
e image<br>
<br>
The result where thousands of small video files (the number depends
on the degree of fragmentation of your drive).<br>
This was working fairly well, but most of the recordings were not
worth recovering because I had to solve the puzzle of concatinating
dozens of files (out of the thousands) in the correct order.<br>
<br>
But if it helps you here is my patch:<br>
<font size=3D"2" face=3D"Courier New, Courier, monospace"
color=3D"#330099">diff -ur genindex-0.1.3.orig/file.c
genindex-0.1.3/file.c<br>
--- genindex-0.1.3.orig/file.c=C2=A0=C2=A0=C2=A0 2006-06-01 22:09:10=
.000000000
+0200<br>
+++ genindex-0.1.3/file.c=C2=A0=C2=A0=C2=A0 2008-11-19 14:59:52.0000=
00000 +0100<br>
@@ -181,16 +181,20 @@<br>
=C2=A0<br>
=C2=A0cFileName::~cFileName()<br>
=C2=A0{<br>
+=C2=A0 printf("=3D=3D=3D=3D>close %s<=3D=3D=3D=3D\n", filenam=
e);<br>
=C2=A0=C2=A0 close(fd);<br>
=C2=A0}<br>
=C2=A0<br>
-int cFileName::Open(void)<br>
+int cFileName::Open(off64_t xxx =3D 0)<br>
=C2=A0{<br>
=C2=A0=C2=A0 close(fd); fd=3D-1;<br>
=C2=A0=C2=A0 cString filename;<br>
=C2=A0=C2=A0 if(input) filename=3Dinput;<br>
=C2=A0=C2=A0 else filename=3DcString::sprintf(FILENAME,fileno);<br>
=C2=A0=C2=A0 fd=3Dopen64(filename,O_RDONLY);<br>
+=C2=A0 if (xxx > 0) {<br>
+=C2=A0=C2=A0=C2=A0 lseek64(fd,xxx,SEEK_SET);<br>
+=C2=A0 }<br>
=C2=A0=C2=A0 if(fd>=3D0) {<br>
=C2=A0=C2=A0=C2=A0=C2=A0 struct stat64 st;<br>
=C2=A0=C2=A0=C2=A0=C2=A0 if(fstat64(fd,&st)=3D=3D0) {<br>
diff -ur genindex-0.1.3.orig/file.h genindex-0.1.3/file.h<br>
--- genindex-0.1.3.orig/file.h=C2=A0=C2=A0=C2=A0 2006-06-01 17:12:25=
.000000000
+0200<br>
+++ genindex-0.1.3/file.h=C2=A0=C2=A0=C2=A0 2008-11-19 15:01:15.0000=
00000 +0100<br>
@@ -54,12 +54,13 @@<br>
=C2=A0public:<br>
=C2=A0=C2=A0 cFileName(const char *Input, bool LargeOK);<br>
=C2=A0=C2=A0 ~cFileName();<br>
-=C2=A0 int Open(void);<br>
+=C2=A0 int Open(off64_t);<br>
=C2=A0=C2=A0 int NextFile(void);<br>
=C2=A0=C2=A0 int OpenWrite(void);<br>
=C2=A0=C2=A0 int NextWriteFile(void);<br>
=C2=A0=C2=A0 int Skip(int nr, int off);<br>
=C2=A0=C2=A0 int FileNumber(void) { return fileno; }<br>
+=C2=A0 void SetFileNumber(int i) {fileno =3D i;}<br>
=C2=A0=C2=A0 long long FileSize(void) { return size; }<br>
=C2=A0=C2=A0 };<br>
=C2=A0<br>
Only in genindex-0.1.3: file.o<br>
Only in genindex-0.1.3: genindex<br>
diff -ur genindex-0.1.3.orig/genindex.c genindex-0.1.3/genindex.c<br=
>
--- genindex-0.1.3.orig/genindex.c=C2=A0=C2=A0=C2=A0 2006-06-02
15:44:31.000000000 +0200<br>
+++ genindex-0.1.3/genindex.c=C2=A0=C2=A0=C2=A0 2008-11-19 15:00:58.=
000000000
+0100<br>
@@ -41,6 +41,8 @@<br>
=C2=A0char *destdir=3D0;<br>
=C2=A0char *input=3D0;<br>
=C2=A0int splitsize=3D2000;<br>
+long long startat=3D0;<br>
+int firstnum=3D1;<br>
=C2=A0bool rewrite=3Dfalse;<br>
=C2=A0bool quiet=3Dfalse;<br>
=C2=A0<br>
@@ -61,6 +63,7 @@<br>
=C2=A0=C2=A0 //<br>
=C2=A0=C2=A0 unsigned int sSize;<br>
=C2=A0=C2=A0 int splitOffset;<br>
+=C2=A0 long long startOffset;<br>
=C2=A0=C2=A0 bool pstart;<br>
=C2=A0=C2=A0 //<br>
=C2=A0=C2=A0 unsigned char buff[KILOBYTE(256)];<br>
@@ -77,7 +80,7 @@<br>
=C2=A0public:<br>
=C2=A0=C2=A0 cGenIndex(void);<br>
=C2=A0=C2=A0 ~cGenIndex();<br>
-=C2=A0 void Work(void);<br>
+=C2=A0 void Work(off64_t);<br>
=C2=A0=C2=A0 void Skip(int type);<br>
=C2=A0=C2=A0 };<br>
=C2=A0<br>
@@ -86,6 +89,7 @@<br>
=C2=A0=C2=A0 index=3Dnew cIndex(destdir);<br>
=C2=A0=C2=A0 fileName=3Dnew cFileName(input,input && rewrite=
);<br>
=C2=A0=C2=A0 writeName=3Dnew cFileName(destdir,true);<br>
+=C2=A0 writeName->SetFileNumber(firstnum);<br>
=C2=A0<br>
=C2=A0=C2=A0 if(rewrite) {<br>
=C2=A0=C2=A0=C2=A0=C2=A0 SetDefaultRule(prSkip);<br>
@@ -124,7 +128,7 @@<br>
=C2=A0=C2=A0 return replayFile>=3D0;<br>
=C2=A0}<br>
=C2=A0<br>
-void cGenIndex::Work(void)<br>
+void cGenIndex::Work(off64_t startat =3D 0)<br>
=C2=A0{<br>
=C2=A0=C2=A0 eof=3Derror=3Dpstart=3Dfalse;<br>
=C2=A0=C2=A0 memset(fileSize,0,sizeof(fileSize));<br>
@@ -137,14 +141,16 @@<br>
=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0 }<br>
=C2=A0=C2=A0=C2=A0=C2=A0 }<br>
=C2=A0<br>
-=C2=A0 replayFile=3DfileName->Open();<br>
+=C2=A0 readOffset=3Dstartat;<br>
+<br>
+=C2=A0 replayFile=3DfileName->Open(readOffset);<br>
=C2=A0=C2=A0 readNo=3DfileName->FileNumber();<br>
=C2=A0=C2=A0 fileSize[readNo]=3DfileName->FileSize();<br>
-=C2=A0 readOffset=3D0;<br>
=C2=A0<br>
=C2=A0=C2=A0 fileNo=3Drewrite ? 1 : readNo;<br>
=C2=A0=C2=A0 fileOffset=3D0;<br>
=C2=A0=C2=A0 splitOffset=3Dsplitsize*MEGABYTE(1);<br>
+=C2=A0 startOffset=3Dstartat*MEGABYTE(1);<br>
=C2=A0=C2=A0 sSize=3D0;<br>
=C2=A0<br>
=C2=A0=C2=A0 if(replayFile>=3D0) {<br>
@@ -236,7 +242,7 @@<br>
=C2=A0=C2=A0=C2=A0=C2=A0 }<br>
=C2=A0<br>
=C2=A0=C2=A0 if(rewrite) {<br>
-=C2=A0=C2=A0=C2=A0 if(scan && fileOffset>=3DsplitOffset =
&&
(pstart || sSize)) {<br>
+=C2=A0=C2=A0=C2=A0 if(scan && (fileOffset>=3DsplitOffset=
|| nextFile)
&& (pstart || sSize)) {<br>
=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0 if(sSize+len>sizeof(store)) =
{<br>
=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0 printf("Oops! Packe=
t buffer overflow\n");<br>
=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0 error=3Dtrue;<br>
@@ -246,7 +252,7 @@<br>
=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0 sSize+=3Dlen;<br>
=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0 }<br>
=C2=A0=C2=A0=C2=A0=C2=A0 else {<br>
-=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0 if(fileOffset>=3DsplitOffset &=
;& sSize &&
ftype=3D=3DI_FRAME) {<br>
+=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0 if((fileOffset>=3DsplitOffset || =
nextFile) &&
sSize && ftype=3D=3DI_FRAME) {<br>
=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0 writeFile=3DwriteNa=
me->NextWriteFile();<br>
=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0 if(writeFile<0) =
{<br>
=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0 printf(=
"Failed to open output file(s)\n");<br>
@@ -254,6 +260,7 @@<br>
=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0 return =
-1;<br>
=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0 }<br>
=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0 packetNo=3DfileNo=
=3DwriteName->FileNumber();<br>
+=C2=A0=C2=A0=C2=A0 nextFile=3Dfalse;<br>
=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0 packetOffset=3D0;<b=
r>
=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0 fileOffset=3DsSize;=
<br>
=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0 }<br>
@@ -343,6 +350,8 @@<br>
=C2=A0{<br>
=C2=A0=C2=A0 static struct option long_options[] =3D {<br>
=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0 { "rewrite",=C2=A0 no_argument,=
=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0 NULL, 'r' },<br>
+=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0 { "startat",=C2=A0 required_argument=
, NULL, 'a' },<br>
+=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0 { "firstnum", required_argument, NUL=
L, 'f' },<br>
=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0 { "quiet",=C2=A0=C2=A0=C2=A0 no=
_argument,=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0 NULL, 'q' },<br>
=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0 { "dest",=C2=A0=C2=A0=C2=A0=C2=
=A0 required_argument, NULL, 'd' },<br>
=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0 { "split",=C2=A0=C2=A0=C2=A0 re=
quired_argument, NULL, 's' },<br>
@@ -353,8 +362,14 @@<br>
=C2=A0<br>
=C2=A0=C2=A0 int s=3D0, str[MAX_STR];<br>
=C2=A0=C2=A0 int c;<br>
-=C2=A0
while((c=3Dgetopt_long(argc,argv,"rqd:s:i:",long_options,NULL))!=3D-=
1)
{<br>
+=C2=A0
while((c=3Dgetopt_long(argc,argv,"rqd:s:i:a:f:",long_options,NULL))!=
=3D-1)
{<br>
=C2=A0=C2=A0=C2=A0=C2=A0 switch (c) {<br>
+=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0 case 'a':<br>
+=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0 startat=3Datoll(optarg);=
<br>
+=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0 break;<br>
+=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0 case 'f':<br>
+=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0 firstnum=3Datoi(optarg);=
<br>
+=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0 break;<br>
=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0 case 'r':<br>
=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0 rewrite=3Dtrue;<br>
=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0 break;<br>
@@ -396,6 +411,8 @@<br>
=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0 about();<br>
=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0 printf("\nUsage: ge=
nindex [-r] [-d DIR] [-s SIZE]\n\n"<br>
=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=
=C2=A0=C2=A0=C2=A0=C2=A0 "=C2=A0 -i FILE, --input FILE=C2=A0 use a single =
input
file\n"<br>
+=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=
=C2=A0=C2=A0=C2=A0 "=C2=A0 -a,=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0 --startat=C2=
=A0=C2=A0=C2=A0=C2=A0 start reading input file
at position\n"<br>
+=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=
=C2=A0=C2=A0=C2=A0 "=C2=A0 -f,=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0 --firstnum=C2=
=A0=C2=A0=C2=A0 start numbering output
file at num\n"<br>
=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=
=C2=A0=C2=A0=C2=A0=C2=A0 "=C2=A0 -r,=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0 --rewri=
te=C2=A0=C2=A0=C2=A0=C2=A0 rewrite video files\n"<br>
=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=
=C2=A0=C2=A0=C2=A0=C2=A0 "=C2=A0 -d DIR,=C2=A0 --dest=3DDIR=C2=A0=C2=A0=C2=
=A0 set destination dir\n"<br>
=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=
=C2=A0=C2=A0=C2=A0=C2=A0 "=C2=A0 -s SIZE, --split=3DSIZE=C2=A0 split files=
at megabyte
count\n"<br>
@@ -421,6 +438,6 @@<br>
=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0 }<br>
=C2=A0=C2=A0=C2=A0=C2=A0 if(!quiet) printf("\n\n");<br>
=C2=A0=C2=A0=C2=A0=C2=A0 }<br>
-=C2=A0 gi.Work();<br>
+=C2=A0 gi.Work(startat);<br>
=C2=A0=C2=A0 return 0;<br>
=C2=A0}<br>
Only in genindex-0.1.3: genindex.o<br>
diff -ur genindex-0.1.3.orig/pes.c genindex-0.1.3/pes.c<br>
--- genindex-0.1.3.orig/pes.c=C2=A0=C2=A0=C2=A0 2003-07-26 23:55:21.=
000000000
+0200<br>
+++ genindex-0.1.3/pes.c=C2=A0=C2=A0=C2=A0 2008-10-26 23:32:44.00000=
0000 +0100<br>
@@ -11,7 +11,7 @@<br>
=C2=A0#include "pes.h"<br>
=C2=A0#include "ringbuffer.h"<br>
=C2=A0<br>
-#define DEBUG(x...) printf(x)<br>
+#define DEBUG(x...) fprintf(stderr, x)<br>
=C2=A0//#define DEBUG(x...)<br>
=C2=A0<br>
=C2=A0//#define PD(x...) printf(x)<br>
@@ -23,6 +23,7 @@<br>
=C2=A0{<br>
=C2=A0=C2=A0 rb=3Dnew cRingBufferFrame(KILOBYTE(50));<br>
=C2=A0=C2=A0 defaultRule=3Dru;<br>
+=C2=A0 nextFile=3Dfalse; <br>
=C2=A0=C2=A0 Reset();<br>
=C2=A0}<br>
=C2=A0<br>
@@ -109,6 +110,7 @@<br>
=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0 }<br>
=C2=A0=C2=A0=C2=A0=C2=A0 }<br>
=C2=A0=C2=A0 else if(skipped) {<br>
+=C2=A0=C2=A0 nextFile=3Dtrue;<br>
=C2=A0=C2=A0=C2=A0 totalSkipped+=3Dskipped;<br>
=C2=A0=C2=A0=C2=A0 if(skipped=3D=3Dzeros) totalZeros+=3Dzeros;<br>
=C2=A0=C2=A0=C2=A0 else DEBUG("PES: skipped %d bytes\n",skipped);<br=
>
diff -ur genindex-0.1.3.orig/pes.h genindex-0.1.3/pes.h<br>
--- genindex-0.1.3.orig/pes.h=C2=A0=C2=A0=C2=A0 2003-07-26 23:54:51.=
000000000
+0200<br>
+++ genindex-0.1.3/pes.h=C2=A0=C2=A0=C2=A0 2008-10-26 18:59:26.00000=
0000 +0100<br>
@@ -25,6 +25,7 @@<br>
=C2=A0class cPES : public cMutex {<br>
=C2=A0protected:<br>
=C2=A0=C2=A0 enum eRule { prPass, prSkip, prAct1, prAct2, prAct3, pr=
Act4,
prAct5, prAct6, prAct7, prAct8 };<br>
+=C2=A0 bool nextFile;<br>
=C2=A0private:<br>
=C2=A0=C2=A0 eRule rules[NUM_RULESETS][NUM_RULES], *currRules, currR=
ule,
defaultRule;<br>
=C2=A0=C2=A0 int currNum;<br>
Only in genindex-0.1.3: pes.o<br>
Only in genindex-0.1.3: ringbuffer.o<br>
Only in genindex-0.1.3: thread.o</font><br>
<br>
Christian.<br>
<br>
<br>
<br>
<div class=3D"moz-cite-prefix">On 2023-07-03 14:34, Kartsa wrote:<br>
</div>
<blockquote type=3D"cite"
cite=3D"mid:[email protected]">
<pre class=3D"moz-quote-pre" wrap=3D"">Hi
I=E2=80=99ve had VDR running for almost 20 years now. Not continuously of =
course and occasionally I have updated the system and added more disk and =
new MB and CPU and so.
My problem is that I had an external disk for saving recordings which did =
not fit on the internal hard disk and now the external disk has failed. I =
had XFS on the disk and I have been able to create an image of the disk (p=
robably with big chunks missing) but I have not been able to restore any o=
f the recordings from the image. I have tried with foremost but the proble=
m is the ts files. Foremost does not recognise them out of the box and I w=
ould need some header/footer information of the files. But to my understan=
ding the ts files have no special footer which would indicate the ending o=
f a file. Have tried to recognise from current recordings the header and t=
ried with that. Foremost has been able to restore the info files but those=
are not a big help.
Anyway I was wondering if there are any tools that I could try to restore =
the recordings. I have tried a lot of different tools (including testdisk =
and photorec) but have not had any real luck. So any instructions and/or p=
ointers would be appreciated :)
BR
\\Kartsa
_______________________________________________
vdr mailing list
<a class=3D"moz-txt-link-abbreviated" href=3D"mailto:[email protected]">vdr@=
linuxtv.org</a>
<a class=3D"moz-txt-link-freetext" href=3D"https://www.linuxtv.org/cgi-bin=
/mailman/listinfo/vdr">https://www.linuxtv.org/cgi-bin/mailman/listinfo/vd=
r</a>
</pre>
</blockquote>
<br>
</body>
</html>
--------------5ALCnqKTh1M2ri3dp7MuYPBf--
--===============0481228051463661279==
Content-Type: text/plain; charset="us-ascii"
MIME-Version: 1.0
Content-Transfer-Encoding: 7bit
Content-Disposition: inline
_______________________________________________
vdr mailing list
[email protected]
https://www.linuxtv.org/cgi-bin/mailman/listinfo/vdr
--===============0481228051463661279==--