An open source method for exporting back to the JY-HD10 or DVHS at DVinfo.net
DV Info Net

Go Back   DV Info Net > Cross-Platform Post Production Solutions > High Definition Video Editing Solutions
Register FAQ Today's Posts Buyer's Guides

High Definition Video Editing Solutions
For all HD formats including HDV, HDCAM, DVCPRO HD and others.

Reply
 
Thread Tools Search this Thread
Old December 30th, 2003, 06:23 PM   #1
Regular Crew
 
Join Date: Nov 2003
Location: Stony Brook NY
Posts: 169
An open source method for exporting back to the JY-HD10 or DVHS on a Mac

I was able to view edited content on the jy-hd10u and sr-vd400u for the first time today. The process requires several steps and some might consider it too complicated to be worth it, but I have been trying for this for over a month now and I sure am happy to finally get it!

It requires the following tools:

DVHSCap
available from Apple.

VLC
I used the beta version 0.7.0 available here
http://www.videolan.org/pub/testing/vlc-0.7.0-test2

mplex
http://mjpeg.sourceforge.net/MacOS/mplex

mpeg2enc
I needed to change the program ever so slightly so it would encode HD.
This version is available here:
http://www.celt.sunysb.edu/paul/mpeg2enc_HDTV.zip

ffmpeg
I included the binary for this file with mpeg2enc, the source is available at:
http://ffmpeg.sourceforge.net/


All of these need to be installed by placing them in your search path, mine are in /usr/local/bin.

I couldn't statically compile mpeg2enc yet so there are files along with mpeg2enc located in a "lib" folder that have to be placed in /usr/local/lib.

I am skipping explicit steps as to HOW you install these files, if people need help with this please let me know.

From Final Cut, export from your main sequence using Quicktime conversion, use Motion JPEG A compression, highest quality. Under options for this codec I choose "One" for number of fields ( am not sure if this was needed). Do not export the audio in this step, save the file on the Desktop as "mjpeg.mov"

From Final Cut, export from the main sequence using Quicktime conversion, under format choose "wave", save your file on the Desktop as "audio.wav"

Open up a terminal (located in "Applications/Utilities")

You will be acting on the files you just created, first we need to make the working directory the Desktop, for this type "cd Desktop".

Now we want to convert the quicktime movie to a MPEG2 elementary stream, type the following (I suggest copy and paste):

ffmpeg -hq -i mjpeg.mov -f yuv4mpegpipe -an - | mpeg2enc --verbose 0 --aspect 3 --format 3 --frame-rate 4 --video-bitrate 18300 --nonvideo-bitrate 384 --interlace-mode 0 --force-b-b-p --video-buffer 448 --video-norm n --keep-hf --no-constraints --sequence-header-every-gop --min-gop-size 6 --max-gop-size 6 -o mpeg2.mpv

Now we want to convert the audio wave file to a MPEG2 elementary stream, type the following:

ffmpeg -i audio.wav -y -vn -f mp2 -acodec mp2 -ab 384 -ar 48000 -ac 2 audio.mp2

Now we want to combine these elementary streams together (mux) as a MPEG2 program stream.

mplex -f 3 -b 2000 -o programstream.ps audio.mp2 mpeg2.mpv

Now we need to convert this program stream to a transport stream, for this we use VLC

Start VLC (back to a GUI finally!), Use the "file" menu, then "open file"
click on the "Browse..." button and find "programstream.ps", check on the "advanced output" check box and then click on the "Settings.." button, make sure the "file" radio button is picked click on the "Browse..." button save the file on your desktop as "transport.ts", Make sure that the "Encapsulation Method" is MPEG TS, leave everything else blank. Click OK, which brings you back to the other screen click OK again.
VLC will convert the file to a transport stream in real time.

Now to DVHSCap, make sure your camera/deck is plugged in to the computer via firewire, start DVHSCap, it should recognize your device, click on "export to D-VHS", find "transport.ts" on your desktop, watch your movie play back on the camera/HD monitor for the first time!

Thanks go to Arick Chan and Alfred Tsang who helped me figure this out.
Paul St. Denis is offline   Reply With Quote
Old December 30th, 2003, 06:59 PM   #2
Major Player
 
Join Date: Aug 2003
Location: Vancouver
Posts: 351
It's very interesting. Can you perhaps comment on how the final output looks in comparison to the camera original?

DBK
__________________
Darren Kelly
Darren Kelly is offline   Reply With Quote
Old December 30th, 2003, 08:14 PM   #3
Regular Crew
 
Join Date: Nov 2003
Location: Stony Brook NY
Posts: 169
I think it looks very good, perhaps my eyes are not as discerning as others on this board. There are two compression steps in the proccess, to MJPEG and to MPEG, one more than optimum. A more perfect solution would go from a lossless codec to MPEG or straight to MPEG. The MPEG program streams look slightly darker than the MJPEG when viewed in Quicktime but this happens to the original transport stream when converted to MPV and viewed in Quicktime as well. The data rate is comparable to the original transport stream, interestingly DVHSCap shows the data rate varying over time where the original transport streams are constant and this does not seem to affect the export to the camera. Perhaps it is possible to use a bitrate higher than 18300 in mpeg2enc and still have it recognized by the camera.
Paul St. Denis is offline   Reply With Quote
Old December 31st, 2003, 01:56 PM   #4
Regular Crew
 
Join Date: Nov 2003
Location: Stony Brook NY
Posts: 169
--video-bitrate 30000 and --video-buffer 996 produces a stream
still acceptable to the deck (didn't try it in the camera).
a higher bitrate than that caused a stutter. I think the file looks equal in quality to the original.
Paul St. Denis is offline   Reply With Quote
Old December 31st, 2003, 02:34 PM   #5
MPS Digital Studios
 
Join Date: Apr 2003
Location: Palm Beach County, Florida
Posts: 8,531
Whew! That's a lot! But thanks for the tips!

heath
__________________
My Final Cut Pro X blog
Heath McKnight is offline   Reply With Quote
Old December 31st, 2003, 03:49 PM   #6
Major Player
 
Join Date: Jun 2003
Location: Chicoutimi, Canada
Posts: 334
Nice. I always thought VLC could offer a way to get back to the HD10. Thanks Paul and Arick, this is niiiiice!
__________________
Eric Bilodeau
video SFX,DOP
___________________
http://www.fictis.net
info@fictis.net
Eric Bilodeau is offline   Reply With Quote
Old January 1st, 2004, 01:04 PM   #7
Regular Crew
 
Join Date: Nov 2003
Location: Stony Brook NY
Posts: 169
It's great to hear the encouraging words Eric. I hope more people will try this method out. I'm looking into making an Applescript droplet that would allow for Quicktime (properly formatted) to mt2 conversion. I'm not sure how long this will take however, in the meantime perhaps the creator of ffmpegX will incorperate quicktime to PS HD conversion into his program.
Paul St. Denis is offline   Reply With Quote
Old January 1st, 2004, 02:42 PM   #8
Major Player
 
Join Date: Aug 2003
Location: Vancouver
Posts: 351
Paul,

I would really like to see you continue with this. An apple script would be great.

You might also want to visit lumierehdv.com. They too are working on a solution and perhaps together, you guys could build something.

I'd be interested in showing it on the DVD and even including it (or a trial) on the DVD.

Keep working

DBK
__________________
Darren Kelly
Darren Kelly is offline   Reply With Quote
Old January 2nd, 2004, 08:35 PM   #9
Regular Crew
 
Join Date: Oct 2003
Location: Singapore
Posts: 70
Denis,

In the case of PC, do you think I can use VLC to convert .mpg file to ts file and then send back to HD1 or D-VHS?

I usually use Vegas to edit 720p footage and encode the file to mpg format. The only thing I don't have is a software to convert the mpg file to ts and then send back to HD1 or D-VHS. From what you described here, it seems that VLC could do the job.

Is my understanding correct?
Peter Robert is offline   Reply With Quote
Old January 2nd, 2004, 10:35 PM   #10
Regular Crew
 
Join Date: Nov 2003
Location: Stony Brook NY
Posts: 169
You should be able to do it on the PC but I believe the format of the mpeg is important. Earlier on I tried using VLC both for converting to mpeg and wrapping it in a transport stream and the camera did not accept the file. The parameters we used for ffmpeg/mpeg2enc were made to conform as closely as possible to the mpeg specifications for the camera, the exact data rate, group of picture length, IPB sequence and non-video data rate etc. If only one or all of these qualities are needed for the camera I am not sure at this point. The nice thing about mpeg2enc is it gives so much control over the structure of the mpeg file. The only way that I could be sure that it would work on the PC is if you used the same steps that I did on the Mac, ffmpeg, mplex, mpeg2enc are all available for the PC. You would need to recompile mpeg2enc however.
A kludgy hack allowed me to get bit rates higher than 15Mbs in mpeg2enc I removed the following lines from conform.cc

if (bit_rate> 1.0e6 * maxval->bit_rate)
mjpeg_error_exit1("Bit rate is greater than permitted in specified Level");

I would be interested in hearing if you get back to the camera using VLC on the PC and would be willing to help you any way I can, please let me know.

BTW I thought people have used womble to create transport streams on the PC?
Paul St. Denis is offline   Reply With Quote
Old January 4th, 2004, 07:29 PM   #11
Regular Crew
 
Join Date: Oct 2003
Location: Singapore
Posts: 70
Hi Denis,

I use vlc in PC this weekend and I want to post the result here.

1. Import m2t file directly in Vegas 4.0 and then edit as usual.

2. Export the timline and then encode it as mpg file by Mainconcept enocder. I use 720 30p template with a constant bitrate of 15mb.

3. Use vlc to convert the mpg file to ts file.

4. Use the utility software come with HD1 to export the ts file to JVC d-vhs.

Result:

The picture quality is as good as the one done by jvc editing software. The only problem is audio drop out at irregular intervals. 1 or 2 seconds audio drop out occur throughout the one hour playback.

Do you suggest any way to solve it?

I did try Womble but it failed. The ts file converted by Womble could be export to d-vhs. I can see the picture during the transfer. But when I playback the video tape, only white screen could be seen.
Peter Robert is offline   Reply With Quote
Old January 4th, 2004, 07:44 PM   #12
Regular Crew
 
Join Date: Nov 2003
Location: Stony Brook NY
Posts: 169
The bitrate should be 18300 bits per second, can you try 18.3 Mbs? I don't have Mainconcept so I can't try the same steps, but I will try to see if I can find a method for the PC at work on Monday. Has anyone used womble successfully on the PC?
Paul St. Denis is offline   Reply With Quote
Old January 4th, 2004, 08:14 PM   #13
CTO, CineForm Inc.
 
Join Date: Jul 2003
Location: Cardiff-by-the-Sea, California
Posts: 8,095
MainConcept PC solution (should be in a new topic.)

Peter & Paul,
The error is not in the bit-rate, in fact you can use a variety of bit-rates. The mux-rate is the important factor, and the camera uses approximately 19.2Mb/s. The problem occurs with the bundled software, which appears to be hardwired to a particular mux-rate making is hard to match with the MainConcept encoder. The miss-match occurs between the rate the bundle software sends data over firewire versus the actual rate it needs to be sent. The audio glitch you are seeing is a buffer under or overflow in the DVHS deck while recording. I have never been successful sending long sequences from the MainConcept encoder through KDDI's tool. The MainConcept encoder is fine as commerical products (yes a minor plug for our stuff) can export it TS files can various mux-rates without any problems. Give DVHSTool a try for your exports.
__________________
David Newman -- web: www.gopro.com
blog: cineform.blogspot.com -- twitter: twitter.com/David_Newman
David Newman is offline   Reply With Quote
Old January 4th, 2004, 09:07 PM   #14
Regular Crew
 
Join Date: Oct 2003
Location: Singapore
Posts: 70
Hi David & Denis,

Thank for your remarks. I'll try DVHSTool and post the result here.
Peter Robert is offline   Reply With Quote
Old January 4th, 2004, 11:02 PM   #15
Regular Crew
 
Join Date: Nov 2003
Location: Stony Brook NY
Posts: 169
There seems to be conflicting information on the web for what video data rate the camera uses. JVC's specs state that the combined data rate is 19.7Mbs (they don't give the video data rate)
http://www.jvc.com/promotions/grhd1/...onal/spec.html

Steve Mullen says that the combined rate is 19Mbs and that the video data rate is 17.8Mbps
http://videosystems.com/ar/video_edit_hdv/

I based my 183000 bps number on the following thread in another forum, If I recall correctly transport stream analyzers give the same values
http://groups.google.com/groups?q=jy...afNXanI&rnum=1

I should have suggested a higher value than 18.3Mps for the total data rate. As I mentioned earlier in this thread we had video-data rates as high as 30Mbs usable by a DVHS deck.

David, thanks for the info. When encoding just the video elementary stream in mpeg2enc you need to specify the nonvideo bitrate, do you think this what determines the mux-rate? What is a mux-rate?
Do you think it the 6 GOP size is needed by the camera?
Paul St. Denis is offline   Reply
Reply

DV Info Net refers all where-to-buy and where-to-rent questions exclusively to these trusted full line dealers and rental houses...

B&H Photo Video
(866) 521-7381
New York, NY USA

Scan Computers Int. Ltd.
+44 0871-472-4747
Bolton, Lancashire UK


DV Info Net also encourages you to support local businesses and buy from an authorized dealer in your neighborhood.
  You are here: DV Info Net > Cross-Platform Post Production Solutions > High Definition Video Editing Solutions


 



All times are GMT -6. The time now is 09:24 PM.


DV Info Net -- Real Names, Real People, Real Info!
1998-2024 The Digital Video Information Network