Sunday, October 29, 2006

rendering cam-compatible HDV MPEGTS files

I have been successful in exporting HDV back out to my cam. I haven't posted detailed output from the individual steps before, so here it is:

General Steps
1) export video from Cinelerra as mpeg2 using mpeg2enc
2) export audio from Cinelerra as mp3
3) mux in mplex
4) open MPEGPS in VLC and convert to TS.

1) export video from Cinelerra as mpeg2 using mpeg2enc:
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 /mnt/videos/20050721/20050721.m2v

2) export audio from Cinelerra as mp3:
Input File : 'stdin' 48.0 kHz
Output File: '/mnt/videos/20050721/test.mp3'
384 kbps MPEG-1 Layer II j-stereo Psy model 1
[De-emph:Off Copyright:No Original:No CRC:Off]
[Padding:Normal Byte-swap:Off Chanswap:Off DAB:Off]
ATH adjustment 0.000000
encode_init: using tablenum 0 with sblimit 27
Hit end of audio data
Avg slots/frame = 1152.000; b/smp = 8.00; bitrate = 384.000 kbps

3) mux in mplex
[root@computer 20050721]# mplex -f 3 -b 2000 -o test.mp3 20050721.m2v
INFO: [mplex] mplex version 1.8.0 (2.2.4 $Date: 2005/08/28 17:50:54 $)
INFO: [mplex] File test.mp3 looks like an MPEG Audio stream.
INFO: [mplex] File 20050721.m2v looks like an MPEG Video stream.
INFO: [mplex] Found 1 audio streams and 1 video streams
INFO: [mplex] Selecting generic MPEG2 output profile
INFO: [mplex] Multiplexing video program stream!
INFO: [mplex] Scanning for header info: Audio stream c0 (test.mp3)
INFO: [mplex] Audio version : 1.0
INFO: [mplex] Layer : 2
INFO: [mplex] CRC checksums : no
INFO: [mplex] Bit rate : 49152 bytes/sec (384 kbit/sec)
INFO: [mplex] Frequency : 48000 Hz
INFO: [mplex] Mode : 0 stereo
INFO: [mplex] Mode extension : 0
INFO: [mplex] Copyright bit : 0 no copyright
INFO: [mplex] Original/Copy : 0 copy
INFO: [mplex] Emphasis : 0 none
INFO: [mplex] Scanning for header info: Video stream e0 (20050721.m2v)
INFO: [mplex] VIDEO STREAM: e0
INFO: [mplex] Frame width : 1280
INFO: [mplex] Frame height : 720
INFO: [mplex] Aspect ratio : 16:9 display
INFO: [mplex] Picture rate : 29.970 frames/sec
INFO: [mplex] Bit rate : 18300000 bits/sec
INFO: [mplex] Vbv buffer size : 229376 bytes
INFO: [mplex] CSPF : 0
INFO: [mplex] SYSTEMS/PROGRAM stream:
INFO: [mplex] rough-guess multiplexed stream data rate : 19077648
INFO: [mplex] Setting best-guess data rate.
INFO: [mplex] Run-in Sectors = 752 Video delay = 58123 Audio delay = 61126
INFO: [mplex] New sequence commences...
INFO: [mplex] Audio c0: buf= 0 frame=000000 sector=00000000
INFO: [mplex] Video e0: buf= 0 frame=000000 sector=00000000
INFO: [mplex] Scanned to end AU 39469
INFO: [mplex] STREAM e0 completed @ frame 39469.
INFO: [mplex] STREAM c0 completed @ frame 54874.
INFO: [mplex] Multiplex completion at SCR=118584775.
INFO: [mplex] Audio c0: buf= 2304 frame=054874 sector=00031342
INFO: [mplex] Video e0: buf= 0 frame=054843 sector=00509538
INFO: [mplex] Audio stream length 63216000 bytes.
INFO: [mplex] Syncwords : 54875
INFO: [mplex] Frames : 54875 padded
INFO: [mplex] Frames : 0 unpadded
INFO: [mplex] BUFFERING min 18 Buf max 1169
INFO: [mplex] Video Stream length: 1031417371 bytes
INFO: [mplex] Sequence headers: 6579
INFO: [mplex] Sequence ends : 1
INFO: [mplex] No. Pictures : 39470
INFO: [mplex] No. Groups : 6579
INFO: [mplex] No. I Frames : 6579 avg. size 58215 bytes
INFO: [mplex] No. P Frames : 32891 avg. size 19714 bytes
INFO: [mplex] No. B Frames : 0 avg. size 0 bytes
INFO: [mplex] Average bit-rate : 6264800 bits/sec
INFO: [mplex] Peak bit-rate : 9203600 bits/sec
INFO: [mplex] BUFFERING min 943996 Buf max 1944874
INFO: [mplex] MUX STATUS: no under-runs detected.
[root@computer 20050721]#

4) open MPEGPS in VLC and convert to MPEGTS.

Update 3/14/2008
Once the video is converted, you may then output to the camera using test-mpeg2 from libiec61883:


Also, take note of a possible 2GB limit in libiec61883 uploading your content to the cam:

No comments: