Re: OT: Digital Video Editor for CentOS 5.2 - Suggestions?

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]



Lanny Marcus wrote:

I'm assuming it is a MiniDV format camcorder.

Well, the funny thing is, that's just the physical support. MiniDV can carry either standard-def DV, or high-def MPEG2.

Is it an HD camera or standard-def?

I installed cinelerra
and will  try to install Kino now.

If it's standard-def, you can quickly capture video from the camera with a command-line tool, if you wish. It's called dvgrab and it's part of the Kino project, but it's usually a separate RPM - CentOS has it in the Base repo.

This is what I use with dvgrab 3.0:

dvgrab --autosplit --size 0 --format dv2 --opendml --noavc --nostop \
  --showstatus --timestamp --frames 0 --buffers 200 ${basename}-

Rewind the tape, connect the camera to the PC, start dvgrab, then push the Play button on the camera. Wait until the whole tape is dumped and the camera stops. Kill dvgrab.

With the above parameters, dvgrab will start a new file whenever there's a scene change on the tape, which is nice. Those files can be viewed with lots of different players (xine, vlc, mplayer...) and edited with Kino to cut off undesirable portions and stuff like that. With Kino, DV editing is lossless.

There are many ways to convert DV to all kinds of other formats. With Linux-based tools, one way to do conversion to DVD is this:

http://florin.myip.org/soft/conv-dvd/

I attached to this message another script which pretty much does the same thing, except it requires Windows-based tools running under WINE (AviSynth, HC Encoder, and associated software), but the image quality of the DVD is much better, since HCenc is a very good MPEG2 encoder.

Under Linux, without WINE, for DVD you can encode to MPEG2 with either mpeg2enc (so-so image quality, so-so speed, good standards compliance) or with ffmpeg (fast, poor image quality, produces MPEG2 that violates the DVD standard and may crash some standalone DVD players).
mencoder is similar to ffmpeg since they use the same underlying code.



HD is a very different story.

dvgrab can still be used for capture with MiniDV/MPEG2 cameras.
I've heard that Cinelerra may be able to edit HD MPEG2.
I doubt there's anything on Linux that can reliably parse and edit AVCHD, because libavcodec (essentially the only AVC decoder on Linux, and the only open source AVCHD decoder on Windows) has pretty big problems parsing interlaced high-def AVC (but if your camera is MiniDV, it's definitely not AVCHD).

I'm not sure how to do Blu-Ray authoring on Linux (or at least the poor man's Blu-Ray-file-structure-burned-on-DVD, a.k.a. AVCHD disks) other than running tsMuxer under WINE (or try the Linux version, if you can figure out how to use it text-mode). For BD or AVCHD authoring, you may have to transcode MPEG2 to AVCHD (unless you can produce on Linux a BD structure with the video track in MPEG2 format). Hopefully x264 works for you, but you may have to interface it with AviSynth - under WINE, of course. :-)

It's not a pretty HD situation on Linux. Windows is much better.

--
Florin Andrei

http://florin.myip.org/
#!/bin/bash

# v20080221
# Florin Andrei <florin@xxxxxxxxxxxxxxx>

if [ $# -ne "1" ]; then
 echo "Usage: $0 dirname"
 exit
fi

# Testing pre-requisites
for exe in wine unix2dos mplex dvdauthor; do
if [ -z `which ${exe}` ]; then
    echo "${exe} is not installed, bye"
    exit
fi
done

name=$1
pushd $name

# File that contains the DVD structure info
xmlf="dvdauthor.xml"

# The HC Encoder executable
# Path is in Windows format (as seen inside Wine)
encoder="C:\HCenc\HCenc.exe"

aencoder="avs2yuv"

# The Unix filesystem root is what "drive letter" under Wine?
# (e.g., if drive is Z, then /home/user becomes Z:\home\user under Wine)
rootdrive="Z"

# pwd in "windows" format (replace / with \)
unixpwd=`pwd`
winepwd=`echo ${unixpwd} | tr / \\\ `

# HC Encoder general encoding parameters
# Change ASPECT to 4:3 or 16:9, depending on the source
# Change BITRATE up or down to adjust image quality and file size
# The other parameters typically don't need to be adjusted
cat - > HC.ini << HCINI
*DBPATH           ${rootdrive}:${winepwd}
*MAXBITRATE       9500
*PROFILE          best
*AUTOGOP          15
*CQ_MAXBITRATE    5.000
*AQ               1
*DC_PREC          10
*DVSOURCE
*NOSCD
*MATRIX           mpeg
*LUMGAIN          1
*PRIORITY         normal
*WAIT             0
HCINI

unix2dos HC.ini

rm -f $xmlf
# dvdauthor XML config head
cat - >> $xmlf << XMLHEAD
<dvdauthor>
<vmgm />
<titleset>
<titles>
<pgc>
XMLHEAD

max=`ls dv | wc -l`
n=1
for inp in `ls dv`; do
rem=$(( $max - $n ))
echo
echo -n "["
for i in `seq 1 $n`; do
    echo -n "+"
done
if [ $rem -ne 0 ]; then
for i in `seq 1 $rem`; do
    echo -n "-"
done
fi
echo "]"
out=`basename $inp .avi`

cat - > $out-video.avs << AVSFILE-VIDEO
AviSource("${rootdrive}:${winepwd}\\dv\\${out}.avi")
ConvertToYV12(interlaced=true)
AVSFILE-VIDEO

cat - > $out-audio.avs << AVSFILE-AUDIO
AviSource("${rootdrive}:${winepwd}\\dv\\${out}.avi")
ConvertToYV12(interlaced=true)
SoundOut(output="ac3", filename="${rootdrive}:${winepwd}\\${out}.ac3", cbrrate=192, acmod=2, autoclose=true, wait=0, overwritefile="Yes", silentblock=false)
AVSFILE-AUDIO

unix2dos $out-video.avs
unix2dos $out-audio.avs

awinerun="wine ${aencoder} -frames 1 ${rootdrive}:${winepwd}\\${out}-audio.avs -o NUL"
echo ${awinerun}
`${awinerun}`

winerun="wine ${encoder} -ini ${rootdrive}:${winepwd}\\HC.ini -i ${rootdrive}:${winepwd}\\${out}-video.avs -o ${rootdrive}:${winepwd}\\${out}.m2v -log ${rootdrive}:${winepwd}\\${out}.log -frames all"
echo ${winerun}
`${winerun}`

mplex -f 8 -S 4400 $out.m2v $out.ac3 -o $out.vob 2>&1 | tee $out-mplex.log
echo "<vob file=\"$out.vob\" />" >> $xmlf
n=$(( $n + 1 ))
done

# dvdauthor XML config tail
cat - >> $xmlf << XMLTAIL
</pgc>
</titles>
</titleset>
</dvdauthor>
XMLTAIL

dvdauthor -o $name -x $xmlf

chmod -R 0755 $name
chmod 0644 $name/*_TS/*
sync
popd
_______________________________________________
CentOS mailing list
CentOS@xxxxxxxxxx
http://lists.centos.org/mailman/listinfo/centos

[Index of Archives]     [CentOS]     [CentOS Announce]     [CentOS Development]     [CentOS ARM Devel]     [CentOS Docs]     [CentOS Virtualization]     [Carrier Grade Linux]     [Linux Media]     [Asterisk]     [DCCP]     [Netdev]     [Xorg]     [Linux USB]
  Powered by Linux