PDA

View Full Version : Use .VRO files with dvdauthor under linux


bashley
18th November 2005, 22:18
I have been recording programs onto DVD-ram with a DVR and
editing out commercials using my linux system. The .vro
files, or segments thereof, are not suitable for input
to dvdauthor.

I wrote the following filter to insert
minimal [from mplex] navigation blocks into the stream.
The resulting [pseudo] .vob files can be input into
dvdauthor. I thought the program might be useful to
others.

Use it like this:

(1) mount the DVD-ram disk as a udf file.

(2) cat /mnt/DVD_RTAV/VR_MOVIE.VRO| vro2vob >output.vob
where vro2vob is the following program:

#include <stdio.h>
#include <sys/time.h>
#include <string.h>
#include <stdlib.h>
#include <fcntl.h>
#include <stdio.h>
#include <unistd.h>
#include <signal.h>
#include <ctype.h>
#include <stdarg.h>

unsigned char header[]={
0x00 ,0x00 ,0x01 ,0xBA ,0x44 ,0x00 ,0x04 ,0x00 ,0x04 ,0x01 ,0x01 ,0x89 ,0xC3 ,0xF8 ,0x00 ,0x00,
0x01 ,0xBB ,0x00 ,0x12 ,0x80 ,0xC4 ,0xE1 ,0x04 ,0xE1 ,0xFF ,0xB9 ,0xE0 ,0xE8 ,0xB8 ,0xC0 ,0x20,
0xBD ,0xE0 ,0x3A ,0xBF ,0xE0 ,0x02 ,0x00 ,0x00 ,0x01 ,0xBF ,0x03 ,0xD4 ,0x81 ,0x00 ,0x00 ,0x00};

unsigned char middle[]={
0x00,0x00,0x01,0xBF,0x03,0xFA,0x81};


#define SIZE 2048
unsigned char block[SIZE];

unsigned char navblock[SIZE];

int fd=0,type;


main(argc,argv)
int argc;
char *argv[];
{
int j;
unsigned char *ptr;

for(j=0;j<48;++j) navblock[j]=header[j];
for(j=0;j<7;++j) navblock[j+1024]=middle[j];

while(read(fd,block,SIZE)==SIZE){
ptr=block;
if( block[38] == 0 &&
block[39] == 0 &&
block[40] == 1 &&
block[41] == 0xbf){
ptr=navblock;
for(j=5;j<10;++j) navblock[j]=block[j];
}
write(1,ptr,SIZE);
}
exit(0);
}

bashley
30th December 2005, 13:43
Line 46 should be changed to:
for(j=4;j<10;++j) navblock[j]=block[j];
instead of starting at j=5. This error caused the
SCR to rollback after an hour or so of recording.

I am very sorry about this mistake.