NeroCom and DVD-Video

vbimport

#1

I am not able to determine how to burn a DVD-Video that will play in set top dvd players using pre-generated IFO, BUP and VOB files.

I have downloaded the SDK and looked thorugh the NeroFiddlesCOM and NeroFiddlesCOM.NET samples trying to figure this out, but neither of them seem to support DVD-Video.

I attempted to look through the NeroAPI samples, but my knowledge of C and C++ was too limited to understand what was going on. Also, not knowing how NeroCOM is implemented, it did seem that any information I gleaned there would probably not be too helpful with regards to NeroCOM.

The code I am using I converted from C++ or C# code that I found on this forum, but the code its self is suspect because the author of it was posting it to report a problem. (The problem was caused by a particular version of Nero, I had the same problem and upgrading to a slightly newer release solved the issue).

With that said… currently I am creating a NeroFileSystemDescContainer object, then calling the AddDirectory method to create VIDEO_TS and AUDIO_TS folders.

From there, I use the AddFile2 method of the NeroDirectoryContainer object representing the VIDEO_TS folder, and add VIDEO_TS.BUP, VIDEO_TS.IFO, VIDEO_TS.VOB, VTS_1_1.BUP, VTS_1_1.IFO, VTS_1_1.VOB

After that, I set the burn options:
NERO_BURN_OPTION_CREATE_UDF_FS + NERO_BURN_OPTION_DVDVIDEO_REALLOC

Then the I call BurnFileSystemContent with burn flags:
NERO_BURN_FLAG_CLOSE_SESSION + NERO_BURN_FLAG_WRITE + NERO_BURN_FLAG_DAO

The burner does not support BUF_UNDERRON_PROT, so I do not add it.

The burn goes successfully,and the disc is authored. It plays in computer dvd players just fine such as WMP, or InterVideo’s DVD player. When inserted into a set top dvd player the dvd player refuses to play it saying it is an invalid disc.

It does not give any information as to why, and as yet I have not found any program online to run against a DVD to determine if it is compatible, and if not then why not.

Does anyone have a sample they can point to, or working knowledge and experience with NeroCOM making DVD-Videos that can help me out with this please?

Thanks,

Scott


#2

public void BurnDvdRom()
{
// using NEROLib;
// You also need reference to COM object NeroCOM
Nero nero = new Nero();
NeroDrives neroDrives = nero.GetDrives(NERO_MEDIA_TYPE.NERO_MEDIA_DVD_ROM);
NeroDrive neroDrive = neroDrives.Item(0) as NeroDrive; // ToDo: Set your Device ID here.
Int32 burnSpeed = 16; // ToDo: Set your Burn Speed.
String path = @“C:\SuperMan\VIDEO_TS”; // ToDo: Set the path to your .vob, .ifo, .bup files.
try
{
NeroFileSystemDescContainer neroFileSystemDescContainer = new NeroFileSystemDescContainer();
neroFileSystemDescContainer.BurnOptions = NERO_BURN_OPTIONS.NERO_BURN_OPTION_CREATE_UDF_FS | NERO_BURN_OPTIONS.NERO_BURN_OPTION_DVDVIDEO_REALLOC;
neroFileSystemDescContainer.Name2 = “SuperMan”; // ToDo: Set your Title
NeroDirectoryContainer rootCont = neroFileSystemDescContainer.RootDirectoryContainer;
DirectoryInfo di = new DirectoryInfo(path);
FileInfo[] fileInfos = di.GetFiles("*", SearchOption.TopDirectoryOnly);

            // -1 Means you want default sorting order for files and directories
            NeroDirectoryContainer nd = rootCont.AddDirectory("VIDEO_TS", -1);
            foreach (FileInfo fileInfo in di.GetFiles("*"))
            {
                nd.AddFile2(fileInfo.Name, fileInfo.FullName, -1, -1);                  
            }
            rootCont.AddDirectory("AUDIO_TS", -1);
            
            neroDrive.OnAddLogLine += new _INeroDriveEvents_OnAddLogLineEventHandler(neroDrive_OnAddLogLine);
            bool ready = neroDrive.DeviceReady;
            if (ready)
            {
                neroDrive.BurnFileSystemContent(neroFileSystemDescContainer, NERO_BURN_FLAGS.NERO_BURN_FLAG_WRITE, burnSpeed, NERO_MEDIA_TYPE.NERO_MEDIA_DVD_ANY);
            }
            else
            {
                throw new Exception("Drive not ready");
            }
        }
        catch (Exception e)
        {
            Console.WriteLine(e.Message);
        }
    }
    void neroDrive_OnAddLogLine(ref NERO_TEXT_TYPE TextType, ref string Text)
    {
        Console.WriteLine(Text);
    }

#3

Hi, I was having exactly the same problem, and the above solution really helped.

However there is one modification I had to make to guarantee this worked on my set-top DVD player with short clips

Add NERO_BURN_FLAGS.NERO_BURN_FLAG_DVDP_BURN_30MM_AT_LEAST to the call to BurnFileSystemContent()

eg:
neroDrive.BurnFileSystemContent(
neroFileSystemDescContainer,
NERO_BURN_FLAGS.NERO_BURN_FLAG_WRITE |
NERO_BURN_FLAGS.NERO_BURN_FLAG_DVDP_BURN_30MM_AT_LEAST,
burnSpeed,
NERO_MEDIA_TYPE.NERO_MEDIA_DVD_ANY );

The flag, according to the docs switches on “DVD+R/RW high compatibility mode (at
least 1GB will be written).”

Anyway, thanks to RussM for the above solution.


#4

I noticed that I left in one line of code, which is un-needed:

FileInfo[] fileInfos = di.GetFiles("*", SearchOption.TopDirectoryOnly);

You can remove it.

RussM


#5

I am having this same problem, but it only seems to effect write once media (+R and -R). If I write the disc to a RW media, the disc plays fine everywhere! I am quire confused. I am using the following options:

nfsdc.BurnOptions = NERO_BURN_OPTION_CREATE_UDF_FS + NERO_BURN_OPTION_DVDVIDEO_REALLOC

and

drive.BurnFileSystemContent nfsdc, NERO_BURN_FLAG_WRITE + NERO_BURN_FLAG_DVDP_BURN_30MM_AT_LEAST, 16, NERO_MEDIA_DVD_ANY

I wondered if I should alos include the NERO_BURN_FLAG_BOOKTYPE_DVDROM flag.

ANY help would be greatly appreciated.

Thanks!

Jamie


#6

I used the code posted in this thread and it woks with using nero 8 installed. I want to burn to multiple drves at the same time but cannot get it to work. Can anyone help?

Here is the code I am playing with, text output below showing problem:

using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Data;
using System.Drawing;
using System.Text;
using System.Windows.Forms;
using System.IO;
using NEROLib;
using System.Threading;

namespace myNero
{
public partial class Form1 : Form
{
private struct burnThreadParameters
{
public NeroDrive drv;
public NeroFileSystemDescContainer contain;
public Int32 burnSpeed;
public burnThreadParameters(NeroDrive p1, NeroFileSystemDescContainer p2, Int32 p3)
{
drv = p1;
contain = p2;
burnSpeed = p3;
}
}
private Nero m_nero;
private NeroDrives m_devices;
private NeroDrive m_lastDrive;
public Form1()
{
InitializeComponent();
}
private void Form1_Load(object sender, EventArgs e)
{
}

private void test_Click(object sender, EventArgs e)
{
// using NEROLib;
// You also need reference to COM object NeroCOM
Nero nero = new Nero();

short jhi=0, jlo=0, nhi=0, nlo=0;
nero.APIVersion(ref jhi, ref jlo, ref nhi, ref nlo);

NeroDrives neroDrives = nero.GetDrives(NERO_MEDIA_TYPE.NERO_MEDIA_DVD_M_R);
List<NeroDrive> listDrives = new List<NeroDrive>();
NeroDrive neroDriveZ = null;
NeroDrive neroDriveE = null;
foreach (NeroDrive d in neroDrives)
{
listDrives.Add(d);
if (d.DriveLetter == “z”)
{
neroDriveZ = d; // ToDo: Set your Device ID here.
}
if (d.DriveLetter == “e”)
{
neroDriveE = d; // ToDo: Set your Device ID here.
}
}

Int32 burnSpeedZ = 8; // ToDo: Set your Burn Speed.
Int32 burnSpeedE = 8; // ToDo: Set your Burn Speed.
String path = @“D:\2008-01-06_12-20-53_Sunday____2563680256\VIDEO_TS”; // ToDo: Set the path to your .vob, .ifo, .bup files.

try
{
NeroFileSystemDescContainer neroFileSystemDescContainerZ = new NeroFileSystemDescContainer();
neroFileSystemDescContainerZ.BurnOptions = NERO_BURN_OPTIONS.NERO_BURN_OPTION_CREATE_UDF_FS | NERO_BURN_OPTIONS.NERO_BURN_OPTION_DVDVIDEO_REALLOC;
NeroFileSystemDescContainer neroFileSystemDescContainerE = new NeroFileSystemDescContainer();
neroFileSystemDescContainerE.BurnOptions = NERO_BURN_OPTIONS.NERO_BURN_OPTION_CREATE_UDF_FS | NERO_BURN_OPTIONS.NERO_BURN_OPTION_DVDVIDEO_REALLOC;
neroFileSystemDescContainerZ.Name2 = “SuperManZ”; // ToDo: Set your Title
neroFileSystemDescContainerE.Name2 = “SuperManE”; // ToDo: Set your Title

NeroDirectoryContainer rootContZ = neroFileSystemDescContainerZ.RootDirectoryContainer;
NeroDirectoryContainer rootContE = neroFileSystemDescContainerE.RootDirectoryContainer;
DirectoryInfo di = new DirectoryInfo(path);
//FileInfo[] fileInfos = di.GetFiles("", SearchOption.TopDirectoryOnly);
// -1 Means you want default sorting order for files and directories
NeroDirectoryContainer ndZ = rootContZ.AddDirectory(“VIDEO_TS”, -1);
NeroDirectoryContainer ndE = rootContE.AddDirectory(“VIDEO_TS”, -1);
foreach (FileInfo fileInfo in di.GetFiles("
"))
{
ndZ.AddFile2(fileInfo.Name, fileInfo.FullName, -1, -1);
ndE.AddFile2(fileInfo.Name, fileInfo.FullName, -1, -1);
}
rootContZ.AddDirectory(“AUDIO_TS”, -1);
rootContE.AddDirectory(“AUDIO_TS”, -1);
neroDriveZ.OnAddLogLine += new _INeroDriveEvents_OnAddLogLineEventHandler(neroDrive_OnAddLogLineZ);
neroDriveE.OnAddLogLine += new _INeroDriveEvents_OnAddLogLineEventHandler(neroDrive_OnAddLogLineE);

bool readyZ = neroDriveZ.DeviceReady;
bool readyE = neroDriveE.DeviceReady;
if (readyZ && readyE)
{
/* neroDrive.BurnFileSystemContent(
neroFileSystemDescContainer,
NERO_BURN_FLAGS.NERO_BURN_FLAG_WRITE,
burnSpeed,
NERO_MEDIA_TYPE.NERO_MEDIA_DVD_ANY);
*/
//Thread burningThreadZ = new Thread(new ParameterizedThreadStart(this.DoBurn));
//Thread burningThreadE = new Thread(new ParameterizedThreadStart(this.DoBurn));
burnThreadParameters zz,ee;
zz.drv = neroDriveZ;
zz.contain = neroFileSystemDescContainerZ;
zz.burnSpeed = burnSpeedZ;
ee.drv = neroDriveE;
ee.contain = neroFileSystemDescContainerE;
ee.burnSpeed = burnSpeedE;
//burningThreadZ.Start(zz);
//burningThreadE.Start(ee);
DoBurn(zz);
DoBurn(ee);
}
else
{
throw new Exception(“Drive not ready”);
}
}
catch (Exception except)
{
Console.WriteLine(except.Message);
}
}

void neroDrive_OnAddLogLineZ(ref NERO_TEXT_TYPE TextType, ref string Text)
{
Console.WriteLine(“Z:” + Text);
}
void neroDrive_OnAddLogLineE(ref NERO_TEXT_TYPE TextType, ref string Text)
{
Console.WriteLine(“E:” + Text);
}

private void DoBurn(object boxParam)
{

burnThreadParameters box = (burnThreadParameters) boxParam;
NeroDrive drv = (NeroDrive)box.drv;
drv.BurnFileSystemContent(
box.contain,
NERO_BURN_FLAGS.NERO_BURN_FLAG_SIMULATE | NERO_BURN_FLAGS.NERO_BURN_FLAG_DVDP_BURN_30MM_AT_LEAST,
box.burnSpeed,
NERO_MEDIA_TYPE.NERO_MEDIA_DVD_ANY);
}
}
}

Problem:
‘myNero.vshost.exe’ (Managed): Loaded ‘B:\VS ryNero\myNero\myNero\bin\Debug\myNero.exe’, Symbols loaded.
‘myNero.vshost.exe’ (Managed): Loaded ‘B:\VS ryNero\myNero\myNero\bin\Debug\Interop.NEROLib.dll’, No symbols loaded.
Z:DVD-Video files reallocation started
E:DVD-Video files reallocation started
’myNero.vshost.exe’ (Managed): Loaded ‘C:\Windows\assembly\GAC_32\CustomMarshalers\2.0.0.0__b03f5f7f11d50a3a\CustomMarshalers.dll’, Skipped loading symbols. Module is optimized and the debugger option ‘Just My Code’ is enabled.
Z:DVD-Video files reallocation completed
E:DVD-Video files reallocation completed
Z:DVD-Video files sorted
E:DVD-Video files sorted
Z:Caching of files started
Z:Caching of files completed
Z:Simulation started at 8x (11,080 KB/s)
E:Caching of files started
E:Caching of files completed
E:Simulation started at 73.8x (11,080 KB/s)
E:Logical unit not ready, operation in progress
Z: LITE-ON DVDRW LH-20A1S
E:Simulation failed at 73.8x (11,080 KB/s)
The thread 0xb1c has exited with code 0 (0x0).
Z:Simulation completed successfully at 8x (11,080 KB/s)
The program ‘[5488] myNero.vshost.exe: Managed’ has exited with code 3 (0x3).


#7

neroapi will only work with one drive at a time within the same process.
If you want to burn with multiple recorders at the same time each recorder must have it’s own process… this is what the documentation states at the end.


#8

Hey, Thanks for the reply!

[quote=mjmim;1981763]neroapi will only work with one drive at a time within the same process.
If you want to burn with multiple recorders at the same time each recorder must have it’s own process… this is what the documentation states at the end.[/quote]

Yes, I did read this:


[LEFT][B]15.10. Concurrency[/B][/LEFT]

[B]Does the [/B]

[LEFT][B][I]NeroAPI [/I]support writing to several recorders simultaneously?[/B][/LEFT]

[LEFT]The [/LEFT]

[LEFT][I]NeroAPI [/I]does not support this.[/LEFT]

[LEFT][B]Does the [/B][/LEFT]

[LEFT][B][I]NeroAPI [/I]support burning to several drives in parallel?[/B][/LEFT]

[LEFT]You cannot initiate two burns at the same time in the same process with [/LEFT]

[LEFT][I]NeroAPI [/I]but[/LEFT]

[LEFT]it should not be a problem to start two processes. Try burning with two separate[/LEFT]

[LEFT]instances of [I]NeroCMD[/I].[/LEFT]

[LEFT][B][I]NeroAPI v7.0.5.6[/I][/B]

[I][B]Nero AG[/B][/I]

[LEFT][B]187[/B]
[B]Is NeroBurn a synchronous or asynchronous function?[/B][/LEFT]
[/LEFT]

[LEFT]NeroBurn returns only after burning has been finished.[/LEFT]

[LEFT]*******************************************************************[/LEFT]

[LEFT]Ok, maybe I should have just posted the threading version of my test code. [/LEFT]

[LEFT]I was successful with NeroCMD launed for each burner at the sae time. I have 7 burners in this machine. I searched for what they mean by “process”… So if the NeroCMD EXE can be ran mutiple times, isn’t that the same as creatng multiple instances of:
Nero m_nero1 = new Nero();
Nero m_nero2 = new Nero();[/LEFT]
???

[LEFT]I tried many thngs. Bottom line, if it woks by running a program multiple times, why can’t multiple “processes” be created within a program? Maybe their .NET is not complete? Maybe it could be done in C++? [/LEFT]

[LEFT]BTW, the document states:
“NeroBurn returns only after burning has been finished.”[/LEFT]

[LEFT]Well,the function I call returns within a few seconds as the drive takes 5 minutes to burn. The callback indicated when finished.[/LEFT]

[LEFT]Any ideas?[/LEFT]

[LEFT]Many Thanks,
Bob[/LEFT]


#9

I guess I’ll put the burning code in a seperate project and launch it multiple times using the Process class.

I wonder how reliable any of this is since Nero seems to have dropped away from supporting this.

Bob


#10

This is exactly what you need to do.


#11

Thanks.

Actually I have been calling NeroCMD to do the job. It works for now. I’ll see what nero does with the sdk. It looks like they left it behind.


#12

Thanks.

Actually I have been calling NeroCMD to do the job. It works for now. I’ll see what nero does with the sdk. It looks like they left it behind.


#13

Hi There,
I am trying to get the code snippet RussM provided and I am having a rather large problem. I do not get any errors and the code does not hit the AddLogLine. The problem I am experiencing is that when the code hits
"neroDrive.BurnFileSystemContent(neroFileSystemDescContainer, NERO_BURN_FLAGS.NERO_BURN_FLAG_WRITE, burnSpeed, NERO_MEDIA_TYPE.NERO_MEDIA_DVD_ANY);"
nothing happens. No response from the DVD burner and no exception. It steps through it like nothing happened. The rest of the code appears to work, it seems to recognize the DVD rom and it finds all the files in the directory it just will not begin the Write process. Can anyone suggest something for me to try?


#14

I actually fixed my own problem by changed the nerDrives.Item to 1 instead of 0. I have a question about this though. I am planning on putting this onto several different kiosks where the drives may be different item indexes. Is there a way to iterate through and find the correct one.
For example I have a CDRW and an external DVDRW on this machine. The neroDrives count is 3 when i search for NERO_MEDIA_TYPE.NERO_MEDIA_DVD_RAM. Are there 3 instances of the same DVDRW or how do i figure out the right one without manually testing each item index?