Log in

View Full Version : Converting DivX to DV


stefboombastic
18th September 2004, 08:47
Hi:)
Since this is my first post in the great Doom9 I wish to congratulate with all the people who help this excellent site!!:D
Well I understand here there are many great gurus of "video programming" while I'm only a beginner, so I hope you will apologize me if I do silly questions :o
Ok here's my problem:
Well, I bought an external Digital/analogic converter (the great Canopus ADVC-100 :p
Cause I'm a young programmer (as hobby though!) I started to code something to use that.
Following the MS DirectX DirectShow samples, I've created a simple program that allows me to watch my VHS Tapes on my PC, record them as both type1 and type 2 DV AVIs, and then trasmit them back through my D/A converter to my TV.
So cause I've a good collections of DivX AVI on my Hard Disk I thought "why not to use my D/A converter to see the DivX on my TV instead of my little 17" monitor??"
I have Pinnacle Studio, and it can do that through a "render"!?!
But I don't like that program, and as a developer I wish to create my own application to do that!!
The matter is that I don't know which filters to use to go back from the DivX to the DV device!
I tried to use graphedit, but I didn't manage to get anything
Any idea?
Thank U, best regars!
Stefano B :cool:

celtic_druid
20th September 2004, 12:24
There is already a program called Video2DV that I think does what you want.

stefboombastic
20th September 2004, 21:03
Thank U very much :)
But I've already got some programs that can do the same thing... I asked to a development forum cause I'm a beginner programmer and I'd wish to create my own software...
Video2DV seems to be developed in Delphi, and I'm a Borland C++ Builder programmer so there must be a way to do that ... But I don't know who to ask to for an help on how to start :(
Tnx anyway!!
Stefano B.

diehardii
30th September 2004, 12:28
Hi stefboombastic,
Using graphedit, drag your DivX file into graphedit. It will render the file. After the file renders, remove the rendering filters and insert the DV Encoder into the video stream, and the PCM audio compressor into the audio stream. Then insert the DV Muxer and connect it to the audio and video. To just dump the file add a dump filter (sample in the SDK) and you will write a file to disk (see attached file). Alternatively, you can connect the "Micrososft DV ..." driver filter to the video stream and it should write it to the tape. I don't have my DV player around for testing, sorry. Just to let you know, this will be a very slow process, and in my initial tests it does not seem to handle 16x9 well. Good luck.

~Steve

P.S. Out of curiousity, can you compile and use the baseclasses in Borland? Are smart pointers also available in Borland?

stefboombastic
30th September 2004, 19:03
Thank U very much Mr. DieHardii ... I'm so desperate that any help is gold for me!!
First of all I want to satisfy Your curiosity: 1)In Borland C++Builder
"The template class auto_ptr holds onto a pointer obtained via new and deletes that object when the auto_ptr object itself is destroyed.." I don't know if U mean this...
2) The MS DX baseclasses don't compile fine, but there's a Japanese site with the correct classes for BCB (tell me if U need) ... I preferred to rewrite the code that I needed
I tried to do such experiments with GraphEdit billion of times!:( Following Your way, when I try to connect the DV Muxer to the "Microsoft DV Camera ..." GE says "these filters cannot agree on a connection. Verify type compatibility of input pin and output pin". :(
I tried to connect it to the "File Writer" (found among the DirectShow Filters...is this the dump filter You talk about?) but it gives the same result :angry:
Video2DV works good so there must be a way to do that ... I'm so desperate that I even emailed the author of that program to pray him to sell me the source even if I'm only a student who need to study that... But He even did not reply me :scared:
PLEASE HELP ME!!! :o
Stefano B.

P.S. What do U mean with "see attached file"? What file are U talking about?

diehardii
30th September 2004, 19:49
Hi Stefboombastic,

I have my DV camera and I will take a look at writing it to a tape. Its odd, when I go to edit my post it shows I have an attachment added, but it does not show up in the main post. Anyways, I'll post that to my webspace at some point and give you the address later today. The dump filter is in the DirectX SDK. It dumps the raw output from the muxer. You will have to build it. Unfortunately, it is very, very difficult to do anything in DirectShow without Visual C++ as your development environment. I initially tried to use free compilers and gave up after about a week. Also with directShow, the ATL makes life much easier and your program less prone to memory leaks.

In the SDK, there are also samples as to how to use DV cameras programatically. I would also recommend Mark Pesce's DirectShow book. Once again, these will unfortunately be not very usefull without Visual C++. Sorry. Anyways, I'll get you the graphs. Good luck.

~Steve

diehardii
1st October 2004, 02:05
Hi Stefboombastic,

Here is the working graph with the file writer. If you connect the camera filter to the avimux filter, it should work (although I haven't been able to test it out). Aspect ratios are messed up here however. I would suggest looking at the msdn for directshow, there is a wealth of knowledge there. It mentions how to correctly connect the DV muxer to connect to the File Writer.

http://lipid.uchicago.edu/~steved/Clipboard01.jpg

Good luck.

~Steve

DoC hEx
1st October 2004, 02:53
stefboombastic, is it the source code for a Divx to DV program that you're looking for??? not the actual program itself???

stefboombastic
1st October 2004, 10:30
THANK U VERY MUCH Mr.Steve!:)
Another step forward done! :D
The AVI Mux solved the incompatibility with "File Writer", now it writes a (DV?) avi and Media Player can playback it, but my program that can playback DV type1 and type2 avi to my Camcorder fails!!!
It only shows the preview without outputting anything to the TV!! It fails to connect the AVI Splitter output pin and the DV Camera input pin when loading it as a type1 DV avi (FileSource->AVI_Splitter->DV_Camera).
Nothing changed when connecting the "Microsoft DV Camera and VCR" as final block in GE ... always rejected! :angry:
... So ...so desperate :o :scared:
Stefano B.

stefboombastic
1st October 2004, 10:36
Hi Mr. DoC hEx :)
Yes or better YEEESSSS!!! I absolutely need the source code! I'm only a student who wants to learn, I will not sell my program but I'm ready to pay for a working source code!!! But it seems that the only guy able to do that in the web is the author of VideoToDV who even did not reply my email!!:(
See Ya!
Stefano B.

stefboombastic
1st October 2004, 18:39
EUREKA!!!:D
Yeeeeeeessssss!!!! ThnX God and Thank U All very much for Your help!
I did it finally!!!:)
What a silly man!!:o A whole month crashing my poor head, googling the web for help ... and the matter was a stupid switch!!
Ok Ok I explain: I live in Italy so my TV and so my A/D converter are set to PAL!! But the DV Encoder is set to NTSC as default (both in Graph Edit and programmately when U create a DV Encoder Filter instance) so it could be not connected to the "Microsoft DV Camera and VCR" filter!!!:p
Ok it sounds like now there are 2 guys able to do that in the web!!:D
I want to upload my project as soon as possible at the Borland CodeCentral (it's implemented as a BCB component with a test project), so all beginners who want to learn this stuff will not have to suffer as I did :)
Of course if U need that feel free to email me!!
Thank U very much again!!
Stefano B. :cool:

P.S. for Mr. Steve: BCB have also the ATL 3.0 smart pointers for COM programming!!