View Full Version : An open source method for exporting back to the JY-HD10 or DVHS


Pages : [1] 2

Paul St. Denis
December 30th, 2003, 06:23 PM
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.

Darren Kelly
December 30th, 2003, 06:59 PM
It's very interesting. Can you perhaps comment on how the final output looks in comparison to the camera original?

DBK

Paul St. Denis
December 30th, 2003, 08:14 PM
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
December 31st, 2003, 01:56 PM
--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.

Heath McKnight
December 31st, 2003, 02:34 PM
Whew! That's a lot! But thanks for the tips!

heath

Eric Bilodeau
December 31st, 2003, 03:49 PM
Nice. I always thought VLC could offer a way to get back to the HD10. Thanks Paul and Arick, this is niiiiice!

Paul St. Denis
January 1st, 2004, 01:04 PM
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.

Darren Kelly
January 1st, 2004, 02:42 PM
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

Peter Robert
January 2nd, 2004, 08:35 PM
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?

Paul St. Denis
January 2nd, 2004, 10:35 PM
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?

Peter Robert
January 4th, 2004, 07:29 PM
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.

Paul St. Denis
January 4th, 2004, 07:44 PM
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?

David Newman
January 4th, 2004, 08:14 PM
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.

Peter Robert
January 4th, 2004, 09:07 PM
Hi David & Denis,

Thank for your remarks. I'll try DVHSTool and post the result here.

Paul St. Denis
January 4th, 2004, 11:02 PM
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/professional/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-hd10+transport&hl=en&lr=&ie=UTF-8&oe=UTF-8&safe=off&selm=2cce55f0.-1%40webx.la2eafNXanI&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?

David Newman
January 4th, 2004, 11:13 PM
Paul,

The camera happily stores and plays back GOP lengths of 15 frames, so don't let that be a concern. Plus 15 is better for image quality. Mux-rate = is the transport stream bit-rate, i.e. with everything muxed together (audio and video) into 188 byte transport stream packets. I'm not sure what this would mean for using mpeg2enc. Bitrate is confusing as Mb/s could be a 1024 or 1000 multiple, than why I said approximately 19.2Mb/s. I don't remember the camera exact bit rate. Within the Premiere exporter we use 19400kb/s for the default mux-rate, although we can support wide range.

Peter Robert
January 5th, 2004, 07:15 PM
Hi David,

DVHSTool doesn't work neither. It can export the ts file to jvc d-vhs. I can see the picture and hear the audio which is ok. But when I rewind the tape and play back again, no audio and video is a mess.

Paul St. Denis
January 5th, 2004, 07:41 PM
Thanks for the information David, I'll try 15 frame GOP's in mpeg2enc tomorrow.

Peter, you might have found your solution already using DVHSTool as David suggested. I tried to find a win32 port for mpeg2enc today, I could find the binary as part of VCDEasy, but not the source code, the source code is availble for the unix version, but I couldn't get it to compile in VC++ or cygwin.

Alex Raskin has a great thread describing his workflow for going back to the camera on this forum from Premiere.
http://www.dvinfo.net/conf/showthread.php?s=&threadid=15411&highlight=womble

I used the same steps starting from "Then use TMPGENC to convert that AVI Movie into ES..." after exporting an AVI and AC3 from Vegas.

One minor typo, Alex suggested using the "hyffyuv" codec which should read huffyuv, available at http://neuron2.net/www.math.berkeley.edu/benrg/huffyuv.html

tempgenc is available http://www.tmpgenc.net/e_main.html

DVHStool http://kgbird.com/DVHSTool/

womble http://www.womble.com/index.shtml

Paul Mogg
January 8th, 2004, 05:41 PM
Wow, Paul this is wonderful what you have done, congratulations on your efforts! I just came back from the UK where I did quite a bit of filming with my HD1OU and now finally I'll be able to edit and archive back to DVHS on the Mac, thank you so much.
Just out of interest, I don't know if you saw my previous postings on the changes I was told to make to Mpeg2enc ( by the ffmpegx forum guys) to get it to encode HD resolutions, but I was wondering if it required more extesive changes than just changing those few parameters and re-compiling? You might want to inform Major over at the ffmpegx forum of what you've been able to do as he had it on his to-do list for the next version release to incorperate HD encoding under Mpeg2enc, and it sounds like you've just saved him a lot of work.

Thanks again.

Paul St. Denis
January 9th, 2004, 12:06 PM
Thanks for your congratulations Paul, it is nice to hear.

The solution for mpeg2enc that I found was very simple although
I am sure it is not the way the developers of mpeg2enc would have done it.

I could not encode at bit rates higher than the 15Mbs despite having the --no-constraints parameter, so I just removed the check for the bit-rate. This would affect people who want to make sure their bit-rates conform to specifications for VCD,DVD etc.

The result is a program which will work fine for our needs is no longer general purpose.

I am focusing on getting the steps to be more user friendly, I should be able to post the results in a week or so.

I wish the creator of ffmpegX who uses open source tools would in turn make his work open source.

Heath McKnight
January 9th, 2004, 02:14 PM
<<<-- Originally posted by Paul St. Denis : I wish the creator of ffmpegX who uses open source tools would in turn make his work open source. -->>>

I thought that was a rule for open source...

heath

Paul St. Denis
January 9th, 2004, 03:02 PM
I think that depends on if ffmpegX can be considered a single program or a group of programs that work alongside each other, here is a quote from the GPL FAQ

... in many cases you can distribute the GPL-covered software alongside your proprietary system. To do this validly, you must make sure that the free and non-free programs communicate at arms length, that they are not combined in a way that would make them effectively a single program.

http://www.gnu.org/licenses/gpl-faq.html#GPLInProprietarySystem

I think the "arms length" argument could be made for ffmpegx, it is not combined with the open source programs but runs on its own and calls these programs when ever they are needed.

Paul St. Denis
January 11th, 2004, 04:23 AM
Paul,
I was just thinking that it should be possible to use ffmpegX to convert from a HD Quicktime file to program stream if ffmpegX's version of mpeg2enc is replaced with the version I posted above.
I will not be able to try this until Monday.
By the way thanks for all the great posts you've made in the last few months, I was just checking out some of the older threads and I see you had a way to edit in Final Cut last May! I didn't think the camera was even available then.
I also noticed that Steve Mullen used to post here quite a bit, where did he go?

Paul Mogg
January 11th, 2004, 08:57 AM
Thanks, I'll have to try putting your Mpeg2enc version in ffmpegx and see how it works. Should I theoretically then be able to encode from any other quicktime format and not have to go through the MJPEG convertion first? That would be great.


Cheers.

Paul Mogg
January 11th, 2004, 12:42 PM
Hey Paul, I just tried your version of mpeg2enc in ffmpegx, it failed unfortunetly, but here's the terminal window output showing the error. Let me know if I specified someting incorrectly or if it's an easy fix. Thanks

Encoding started on Sun Jan 11 10:31:29 PST 2004
INFO: [yuvscaler] yuvscaler (version 1.7.0) is a general scaling utility for yuv frames
INFO: [yuvscaler] (C) 2001-2002 Xavier Biquard <xbiquard@free.fr>
INFO: [yuvscaler] yuvscaler -h for help, or man yuvscaler
INFO: [mpeg2enc] SETTING AltiVec for MOTION!
INFO: [mpeg2enc] SETTING AltiVec for TRANSFORM!
INFO: [mpeg2enc] SETTING AltiVec for PREDICTION!
INFO: [yuvscaler] input: frame size: 1280x720 pixels (1382400 bytes)
INFO: [yuvscaler] input: frame rate: 30000/1001 fps (~29.970030)
INFO: [yuvscaler] input: interlace: none/progressive
INFO: [yuvscaler] input: sample aspect ratio: 1:1
INFO: [yuvscaler] from 1280x720, take 1280x720+0+0, NOT_INTERLACED/PROGRESSIVE
INFO: [yuvscaler] scale to 1280x720, 1280x720 being displayed, NOT_INTERLACED/PROGRESSIVE
INFO: [yuvscaler] Scaling uses the RESAMPLE algorithm,
INFO: [yuvscaler] without line switching
INFO: [yuvscaler] without time forwarding
INFO: [yuvscaler] Without luminance correction
INFO: [yuvscaler] Without chrominance correction
INFO: [yuvscaler] frame rate: 29.970 fps
INFO: [yuvscaler] Scaling ratio for width is 1 to 1
INFO: [yuvscaler] and is 1 to 1 for height
INFO: [yuvscaler] Specific downscaling routing number 4
INFO: [yuvscaler] output: frame size: 1280x720 pixels (1382400 bytes)
INFO: [yuvscaler] output: frame rate: 30000/1001 fps (~29.970030)
INFO: [yuvscaler] output: interlace: none/progressive
INFO: [yuvscaler] output: sample aspect ratio: 1:1
INFO: [mpeg2enc] Selecting generic MPEG2 output profile
INFO: [mpeg2enc] Assuming norm NTSC
INFO: [mpeg2enc] Encoding MPEG-2 video to /Volumes/SATA RAID 1/HD Testing/test1_mpeg.m2v
INFO: [mpeg2enc] Horizontal size: 1280 pel
INFO: [mpeg2enc] Vertical size: 720 pel
INFO: [mpeg2enc] Aspect ratio code: 3 = 16:9 display
INFO: [mpeg2enc] Frame rate code: 4 = 30000.0/1001.0 (NTSC VIDEO)
INFO: [mpeg2enc] Bitrate: 10000 KBit/s
INFO: [mpeg2enc] Quality factor: 5 (Quantisation = 5) (1=best, 31=worst)
INFO: [mpeg2enc] Field order for input: none/progressive
INFO: [mpeg2enc] New Sequence every 9999 Mbytes
INFO: [mpeg2enc] Assuming non-video stream of 422 Kbps
INFO: [mpeg2enc] Search radius: 16
INFO: [mpeg2enc] GOP SIZE RANGE 9 TO 15
INFO: [mpeg2enc] Setting colour/gamma parameters to "NTSC"
INFO: [mpeg2enc] Progressive format frames = 1
**ERROR: [mpeg2enc] Horizontal size is greater than permitted in specified Level

Paul St. Denis
January 11th, 2004, 01:08 PM
Ok I can compile a version that ignores the size constraints.
In the mean time is there any way to pass the --no-constraints flag to mpeg2enc from ffmpegX?

Paul St. Denis
January 11th, 2004, 01:33 PM
Paul, can you give this one a try?
http://www.celt.sunysb.edu/paul/mpeg2enc_HDTV.zip

Paul Mogg
January 11th, 2004, 01:58 PM
Thanks Paul, just to let you know, I also tried your command line method but for some reason I get the response "command not found" for ffmpeg, even though I've checked that the ffmpeg program file definately is in the directory I'm in (usr/local/bin) using "ls", any ideas? Also FYI the input file I was using for the ffmpegx attempt was an 8 bit uncompressed HD file.
...Also I can't see any way to implement the "no constraints" flag from within ffmpegx.

...FYI, below were the instructions that Major (the guy that wrote ffmpegx) gave me to solve this problem, I see that he talks abou a "Level ID" needing to be set to 4, so this might be clue also.

Good luck, I can't wait to try it out!


well im a sucker for punishment -- i downloaded all the source code used in FFmpegXrelating to mpeg encoding and using the FFmpeg component of FFmpegX , no (does do transport stream though - but max resolution is PAL DVD)

but -

mpeg2enc - YES !

you (or someone) will have set the following:



set to 4



Code:

/* Level ID */

Specifies coded parameter constraints, such as bitrate, sample rate, and maximum allowed motion vector range.

Code Meaning Typical use ---- --------------- ----------------------------------------------- 4 High Level HDTV production rates: e.g. 1920 x 1080 x 30 Hz 6 High 1440 Level HDTV consumer rates: e.g. 1440 x 960 x 30 Hz 8 Main Level CCIR 601 rates: e.g. 720 x 480 x 30 Hz 10 Low Level SIF video rate: e.g. 352 x 240 x 30 Hz




set to 512 (for 19.2meg/s standard 720p)



Code:

/* vbv_buffer_size (in multiples 16 kbit) */

Specifies, according to the Video Buffering Verifier decoder model, the size of the bitstream input buffer required in downstream decoders in order for the sequence to be decoded without underflows or or overflows. You probably will wish to leave this value at 112 for MPEG-2 Main Profile at Main Level, and 20 for Constrained Parameters Bitstreams MPEG-1.



set to 2 for DC_P



Code:

/* intra_dc_precision */

Specifies the effective precision of the DC coefficient in MPEG-2 intra coded macroblocks. 10-bits usually achieves quality saturation.

Code Meaning ---- ----------------- 0 8 bit 1 9 bit 2 10 bit 3 11 bit



set to all 24's (or 32's) except for position 1 which must be a 8 (you will need to build a table they explain (simple))




Code:

/* name of intra quant matrix file ("-": default matrix) */

Setting this to a value other than - specifies a file containing a custom intra quantization matrix to be used instead of the default matrix specified in ISO/IEC 13818-2 and 11172-2. This file has to contain 64 integer values (range 1...255) separated by white space (blank, tab, or newline), one corresponding to each of the 64 DCT coefficients. They are ordered line by line, i.e. v-u frequency matrix order (not by the zig-zag pattern used for transmission). The file intra.mat contains the default matrix as a starting point for customization. It is neither necessary or recommended to specify the default matrix explicitly.

Large values correspond to coarse quantization and consequently more noise at that particular spatial frequency.

For the intra quantization matrix, the first value in the file (DC value) is ignored. Use the parameter intra_dc_precision (see below) to define the quantization of the DC value.





use default (all 16's):




Code:

/* name of non intra quant matrix file ("-": default matrix) */

This parameter field follows the same rules as described for the above intra quant matrix parameter, but specifies the file for the NON-INTRA coded (predicted / interpolated) blocks. In this case the first coefficient of the matrix is NOT ignored.

The default matrix uses a constant value of 16 for all 64 coefficients. (a flat matrix is thought to statistically minimize mean square error). The file inter.mat contains an alternate matrix, used in the MPEG-2 test model.

Paul St. Denis
January 11th, 2004, 03:38 PM
/usr/local/bin needs to be in your search path, I am surprised it isn't already as I thought it would be by default. You can get around this by replacing ffmpeg with /usr/local/bin/ffmpeg in the command. You will probably need to do the same for mpeg2enc.

Typing "echo $PATH" will let you know what your search path is.
Sorry anout the hassle and thanks for trying it out.

This might work in ffmpegX
http://www.celt.sunysb.edu/paul/mpeg2enc_HDTV.zip

Paul Mogg
January 12th, 2004, 08:50 AM
IT WORKS!! ...and whats more, it works fabulously! I've tried encoding an uncompressed 8 bit HD movie, a Pixlet codec movie, and a DC30 codec movie, and all worked perfectly. The Pixlet movie was about 4 minutes long.
The quality is also very high from what I can judge so far, (which is amazing in itself) no obvious artifacting introduced, nor any gamma shift as I've seen occur on some "professional" encoders. I've only got the Apple SD MPEG2 encoder to compare it with, and I would say it does an equal or better job than that, but I'll let others judge. This is definately good enough for me.
An additional plus is that the Apple Quicktime player will play these HD movies on your desktop.
I haven't tried the conversion to Transport Stream or going back to the camera or DVHS deck yet, but I'll let you know.
It would seem you've achieved the Holy Grail here Paul, a very low cost ($15 for FFmpegx shareware), high quality, and very reliable HD MPEG2 encoding method.
We now have a complete and very flexible editing pathway for the Mac for HD1OU footage.
My hat is off to you and your associates!!
You should make a separate thread with a big announcement about this.
Below I've documented the settings I found tha seem to work for Ffmpegx, for people to use, you may have better reccomendations of course.



FFmpegx program interface settings for compressing a Quicktime HD movie (any codec 1280*720) to an MPEG2 HD (1280*720) Program Stream.

Open FFmegx

Use the "Open" and "Save As" tabs to select your input Quicktime HD Movie (1280*720), and output file name for the HD Mpeg2 file that will be created, (you can also drag and drop to input the file name).

From the "Video Codec" pull-down menu select "MPEG2[.MPG](mpeg2enc)"

Check the "Encode video" box

In the Bitrate calculator "Video Bitrate" box enter 10000

In the "Video parameters" section enter 1280*720 as the sizes in the "Video Size" boxes

From the "Autosize" drop-down menu select "16:9"

From the "Framerate" drop-down menu select "NTSC (29.97)"

Click on the "Audio" tab

From the "Audio Codec" drop-down menu select "MP2"

From the "Audio bitrate" drop-down menu select "384"

From the "Sampling" drop-down menu select "48000"

From the "Channels" drop-down menu select "Stereo"

From the "Mode" drop-down menu select "CBR"

Click on the "Filters" tab

Make sure that no filters are selected (unless there's something you specifically want to do here)

Click on the "Options " tab

In the "mpeg2enc options" section make sure that ONLY the following boxes are checked, un-check all others:
"GOP headers"
"Altivec" (assuming you're using a G4 or G5 Mac
"Decode wit Quicktime"

From the "Profile" drop-down menu select "Generic MPEG-2"

From the "Q Matrix" drop-down menu select "Standard"

From the "Interlace" drop-down menu select "Not interlaced"

From the "Thread" drop-down menu select "Dual CPU" if your computer has dual processors, or else select "Normal"

In the VBV size box enter "400"

Make sure the "Constant bitrate" box is un-checked

In the Q min box enter "5"

Click on the "Tools" tab

Make sure the "Keep elementary streams" tab is unchecked

Hit the "Encode" button and off it will go.

Christopher C. Murphy
January 12th, 2004, 09:34 AM
Hey Paul,

May I suggest something? How about putting this all together (HDV editing on the Mac) together into a nice and tidy program and selling it for a reasonable price? I'll buy it.

I think we're all looking for the same thing - an easy way to edit footage on a Mac and get it back out in various ways needed.

Just my 2 cents! My budget for a solution is $100-400 depending on what exactly it does...my specfic needs are editing in FCP4 on a G4 1ghz machine. My output is mainly DVD. (I just need something easier than HDcinema and less expensive then the $1000+ stuff offered out there.)

Thanks for all your hard work Paul.

Murph

Paul St. Denis
January 12th, 2004, 10:31 AM
<<<-- Originally posted by Christopher C. Murphy : Hey Paul,

May I suggest something? How about putting this all together (HDV editing on the Mac) together into a nice and tidy program and selling it for a reasonable price? I'll buy it.
Murph -->>>

It is tempting Murph, but I plan on making the program freely available in the spirit of the creators of mjpeg tools and ffmpeg (and this forum).
I hope that in the near future we will be able to describe a workflow on this forum that will allow anyone to easily export back to the camera/D-VHS from Final Cut.
I think we are nearly there now, it is a bit difficult to install the modified version of mpeg2enc, you need to place a file in /usr/local/lib, a folder not readily available from the desktop
(how did you do it Paul? I used "cp" from the command line).

Once we have the workflow down, Darren Kelly expressed interest in including it in the next version of his educational DVD.

Paul Mogg
January 12th, 2004, 12:41 PM
I think that's very noble of you Paul, not to want to charge, I actually agree that that's how it should be in this case, as the solution is based on a group of shareware utilities it seems the "right" thing to do.

I just tested the VLC conversion to Transport stream and it works flawlessly as well. With using ffmpegx we've eliminated two stages in the process, having to convert to MJPEG first, and then having to multiplex with Mplex, which makes the whole process much more user-friendly. It really is quite simple now.
Installation of your version of Mpeg2enc within the FFmpegx GUI is quite simple, you just browse to the file during the installation process.

Here are some fairly idiot-proof instructions I wrote for myself as an easy way to install the library files to the /usr/local/lib folder using a terminal window.



How to copy files from within an OSX terminal window:

For Mpeg2enc installation, Paul is recommending that Library files need to be copied into the /usr/local/lib directory and program files need to be copied into the /usr/local/bin directory.

Open a Terminal window, ( found in your "Applications/Utilities" folder)
To be able to copy files into the /usr/local/bin directory, I've found you need to be logged on as "root" to have permissions to do so. To do this type:
"sudo -s" at the prompt and hit enter. Enter your password if you have one.
The prompt will change to read "root$"

Type "cd /usr/local/bin" and hit enter, to go to that directory
Type "cp " (with a space after cp) at the prompt.
Go out of the terminal window, click and highlight the actual file you want to copy, drag that file to the terminal window prompt, at the prompt will now appear the full pathname to the file you want to copy, (this saves you a lot of typing and headache), now type a space and the name of the file you're copying (again) but this time without the full path in front of it. This is the destination filename for the Unix "cp" copy command.
The format of what is now typed at the prompt should look something like this (but with your filenames etc. of course):

MoggysG5:/usr/local/bin root# cp /Applications/MPEG\ Utilities/mpeg2enc_HDTV/mpeg2enc_HDTV/lib/libmpeg2encpp-1.6.0.dylib libmpeg2encpp-1.6.0.dylib

Notice that the filename is written twice at the end with a space between. Now hit enter to copy the file to your current location.

Type "exit" and hit enter to change back from being "root" to your normal logon name.

Paul St. Denis
January 12th, 2004, 12:53 PM
I created a package to install the lib file in /usr/local/lib
It is now available together with the revised mpeg2enc at
http://www.celt.sunysb.edu/paul/mpeg2enc_HDTV.zip
I tested it on my machine and it worked, if anyone has a problem please let me know.

Paul Mogg
January 12th, 2004, 10:33 PM
Hi Paul,
I'm having problems outputting to a DVHS deck or the Camera. I tried your bitrate setting of 18300 and a VBV setting of 732 in Ffpegx, but although these files play and look fine, I can't get the DVHS deck or camera to recognise them. I notice that on plaback through DVHScap the bitrate is constantly changing. Any ideas?

Thanks

Paul

Darren Kelly
January 12th, 2004, 10:40 PM
Paul St. Denis,

can you email me privately at darren@hdvtraining.com with your telephone number. I would like to chat with you about your solution.

Thanks

DBK

Paul Mogg
January 13th, 2004, 08:26 AM
Paul,
I'm thinking that maybe the reason the mpeg2 files I'm producing through ffmpegx aren't exportable to the camera is that there is no way that I can see in ffmpegx to force the GOP size to 6 as you seem to be doing in your command line parameters for Mpeg2enc. Perhaps you would need to compile a custon version that overrides the command line parameters and forces this to happen. I'm just making an idiots guess here, also the source movie files I used didn't have any audio in them which I guess might cause a problem. Please let me know if you get this to work through ffmpegx, as it's a very exciting development, and the quality of the mpeg2 files this produces is amazingly good.

Thanks again for all your work.

Christopher C. Murphy
January 13th, 2004, 09:42 AM
Well, I must say...after spending $100 on HDcinema and not getting what I call good support - this is great.

I'd still like to make a cash "donation" to anyone here that's giving away this new and constantly improving solution. Is there a way to setup a Paypal account that we can dontate funds? I'm sure a few of us would give a few bucks...hey, it's beer and pizza money for you! Right?

If that isn't what you'd like see happen then we could all donate to a charity of your choice....

Murph

Paul Mogg
January 13th, 2004, 10:23 AM
Hmm, yes I see that through ffmpegx, mpeg2enc is reporting the GOP limits to be a minimum of 9 and a maximum of 15. I see that David Newman stated earlier that the camera can accept a 15 GOP setting, but is ffmpegx allowing a variable GOP rate here that the camera doesn't like? Just thinking out loud.
One other strange thing, I can't get ffmpeg (not ffmpegx) to work from a terminal window at all, I always get "command not found" even though mpeg2enc works fine in the same directory. Even more strangely ffmeg DOES seem to execute when I click on it's icon outside of the Terminal window, can't figure that one out!

Cheers

Paul St. Denis
January 13th, 2004, 11:11 AM
Paul it could be that ffmpeg does not have its execute permissions set, while in the directory containing ffmpeg type:
ls -la
if you don't see the x's before ffmpeg
-rwxr-xr-x 1 root wheel 1476160 16 Dec 11:31 ffmpeg
type:
chmod a+x ffmpeg

It's that or the search path problem, in which case typing the full path to ffmpeg, like "/usr/local/bin/ffmpeg" should work

Murph, I'll think about the "PayPaul" :) or charity options once (if?) we get these wrinkles ironed out.

Paul St. Denis
January 14th, 2004, 10:39 AM
Paul, I was able to export to both the camera and a D-VHS deck using the ffmpegX/VLC combination. Have you tried this again? Maybe it was because you didn't have an audio track?

Paul Mogg
January 14th, 2004, 01:02 PM
I did try it again yesterday Paul, but with no luck. I used a file with an audio track, using the settings I posted before but with a bitrate of 18300 and a VBV setting of 732, all else was the same, but the camera and DVHS deck seem to record nothing, the resulting m2t files play back fine in VLC.
Can you post your exact settings and anything special you're doing in DVHScap or VirtualDVHS?, and I'll try again. Also, is mpeg2enc reporting 9 to 15 as the GOP limits in your case? For some reason I thought a GOP of 6 was necessary.

Thanks

p.s. the ffmpeg problem was that the full pathname was needed.

Paul Mogg
January 14th, 2004, 01:51 PM
I'm having a general problem with recording and playing back anything to the camera right now I've discovered, so this may not be a problem with your mpeg2enc at all. Dvhscap and VirtualDVHS are recognizing and controlling the camera but nothing is coming through in either direction for some reason, not sure why at the moment.

Paul St. Denis
January 14th, 2004, 02:36 PM
Ok, but I noticed that although 30Mps stream show fine on the monitor when it is being recorded to DVHS the recording is garbled when played back. Apparently the DVHS is more particular about bitrates than I had originally thought.

Paul Mogg
January 14th, 2004, 02:58 PM
Finally it all works! It was just some sort of weird firewire glitch on this end, I changed to the front port on my G5 (I was using my G4 previously) and now all is fine. The 18300 encoded file with audio I mentioned before recorded perfectly to both the camera and the DVHS deck and seem to play back perfectly as well. I felt sure that the variable bit rate or the GOP size were the problem but that appears not to be the case. I think you can finally announce to the world that this solution actually works. Congratulations!
I guess just documenting the process from installation to usage for people would be a final stage, if you want me to help at all please let me know...but this is just great, it's now a very simple process to encode footage from any Quicktime HD codec, using Ffmpegx and VLC.
I think I will continue to use the DC30 codec for editing myself, as it seems the most reliable and artifact free to me, I was noticing some problems with Black and White using Pixlet.
By the way, do you know if you can save settings as a preset in Ffmpegx? I took a quick look but couldn't see a way to do it.

All the best, and thank you again for getting this together, you've done a great service for people with this camera.

Paul St. Denis
January 14th, 2004, 04:31 PM
Great to hear Paul! I'll put a thread together based largely on your ffmegX instructions and post it here in the near future. Did you download the latest version of http://www.celt.sunysb.edu/paul/mpeg2enc_HDTV.zip?
It contains a package installer for the library file and a readme with the ffmpegX workflow, it would be great if you can go over it and post any revisions that you see as needed.

I tried to see if there was an easy way to create presets within ffmpegX today, I didn't see anything right off the bat. I can disect ffmpegX a little by control clicking on the ffmpegX icon and using "view package contents". I dislike that the author went out of his way to obscure the program, by protecting the applescripts for example and not showing the commands that are used for conversion.

There is a program, Mediapipe for the mac which is similar to ffmpegx (except it is free and harder to use). Mediapipe is a GUI for UNIX tools but it also shows the entire list of commands that it generates so you can tweek them on your own. FfmpegX is limiting because it deliberately hides these commands.

FfmpegX isn't all bad, it is easy to use and we got it to do what we needed, still I am going to continue working on the droplet which will work without FfmpegX

Paul St. Denis
January 14th, 2004, 04:39 PM
You can create custom presets in ffmpegX using "file, save preset" menu item.

Heath McKnight
January 14th, 2004, 05:34 PM
Can you post those instructions up here as well? (http://www.dvinfo.net/conf/showthread.php?s=&threadid=16812) That's the link to Apple HDV solutions.

heath

Carlos Salcedo
January 19th, 2004, 10:30 PM
Success!!!!

Using Paul's excellent "how-to" I was able to record an edited clp back to my HD1 using my Mac and the results were great, if not excellent...

Thanks Paul!!!!

II did notice a few minor quirks but I am sure that I can work around them now that I found them...

1) I set the bit rate on ffMpegX to 17000 and I noticed that the transfer bit rate jumped from 13000 to 17500...I guess I can go as high as 19000 so I may try that on the next one...

2)there was a slight delay from the time that DVHSCap started the transfer to the time the HD1 began recording...about 2 seconds...so I will adjust and give it a bit of headway on the begining...

Things that i will work on next...

I used Motion Jpeg A when I did my export to Quicktime...i may use a different codec next time (Pixlet, or Dc30 lossless) to see if I get better results...

All of this for the awesome price of $15 for the shareware fee...too cool...

I am a happy Mac FCP/HD1 user right now...

Heath McKnight
January 20th, 2004, 12:23 PM
Cool, Carlos, sounds great!

heath