Transcode and the codecs
Transcode software and documentation
Current issues
Transcoding to raw dv
Here's a line for someone who had quicktime files made with
"two's complement as the audio compression option and dv video as the
video compression option" and wanted to turn them into raw dv for kino:
transcode -i quicktime_dv.mov -y dvraw -o raw.dv
Note also the package quicktime-x11utils with the lqtplay player!
Cropping
Hi8 tapes have crud in the bottom line of the picture; how can you crop these out? Note you may be able to use konverter -- it has a nice cropping interface
Here's from transcode --help:
-j t[,l[,b[,r]]]
|
select frame region by clipping border [off] |
-Y t[,l[,b[,r]]]
|
select (encoder) frame region by clipping border [off] |
--pre_clip t[,l[,b[,r]]] |
select initial frame region by clipping border [off] |
--post_clip t[,l[,b[,r]]] |
select final frame region by clipping border [off] |
Here are some ideas from Tillman:
You first need to scale to the correct aspect ration
and then crop. I suppose the input material is 720x480 @ 16:9 so i
would go for
transcode -i ....
-B 4,0,16 # rescale to 720x416 (16:9)
-Y 0,80 # crop left 80 and right 80
# 416*1.3333 ~= 560
# (720-560)/2 = 80
-Y is like -j but after -B
And some from Christoph Lampert :
- You should _not_ crop with odd numbers of columns/rows when
in -V (i.e. YUV) mode, e.g. -j 0,81 is forbidden. For RGB there's no
problem.
- If you crop, the resulting resolution (after all rescaling
etc.) should still be multiples of 16 in width and height, e.g.
starting with 768x576 cropping -j 0,84 is bad (because that's 768x408
and 408 is not a multipleof 16).
- If you need to crop, pad and scale on the same movie, you
should crop with "-j" before scaling and pad with -Y afterwards, so
less pixels have to bescaled.
This makes it sound as if you need to (or could) worry about rescaling
when you crop -- I'd be happy just removing a few lines and leaving it
at that. And indeed that works too --
transcode -x v4l2,v4l2 -M 2 -i /dev/video$DEV -p /dev/dsp -y ffmpeg -F mpeg4 \
-c 00:$TIM -g 640x480 -f 29.970,4 -I 1 --pre_clip 4 -u 1024 -Q 3 -E 48000,16,2 \
--lame_preset medium -o $DIR/$FIL.avi
Beautiful results on tv capture; cleans up a messy first few lines (use
even numbers). Note that transcode clips both above and below on that
command:
[transcode] V: import frame | 640x480 1.33:1
[transcode] V: pre clip frame | 640x472 (4,0,4,0)
To clip only above, try this:
transcode -x v4l2,v4l2 -M 2 -i /dev/video$DEV -p /dev/dsp -y ffmpeg -F mpeg4 \
-c 00:$TIM -g 640x480 -f 29.970,4 -I 1 --pre_clip 8,0,0,0 -u 1024 -Q 3 -E 48000,16,2 \
--lame_preset medium -o $DIR/$FIL.avi
Note that you have to take multiples of 8 lines, because of some standard. If you don't, you run out of capture buffers.
Strategies
The encoding scripts are
located on /vm/video/scripts and /usr/local/bin. As of 28 August 2003, they include a
double-pass xvid script (my default), a single-pass divx5 script, a
double-pass divx5 script (not currently working), an mpeg2 script, and
an mp3 resampling script. I've so far been able to implement everything
I wanted to in scripts without any serious difficulties.
Remote control
Compression jobs can be started immediately, delayed, and
remotely. To start a remote compression job remotely and immediately,
issue this:
dv2divx.sh >& logfile &
This will compress the files and complete on its own -- 7500 frames
takes around an hour to compress on a 1.2GHz CPU, or an hour and a half
on an 800MHz CPU. When you log out, the process will not be interrupted, although you won't get a clean logout.
A tidier way of doing this is to use screen, as follows:
screen
dv2divx
To see a list of screen key bindings, press
Ctrl-a ?
Here are some examples:
detach ^c d
start screen ^c c select
^c ' Prompt for a window name or
number to switch to
Alternatively, log into a second terminal and issue
screen -list
You'll see something like this:
There is a screen on:
17989.tty1.spello (Attached)
1 Socket in /var/run/screen/S-steen.
To detach, issue
screen -d 17989.tty1.spello
You can now log out cleanly. When you return later, you can reattach the screen to any terminal by issuing
screen -list
screen -r 17989.tty1.spello
This is incredibly elegant and seems robust -- no issues so far. You can also use this for grabbing; cf. dvgrab.
Delayed execution
To instruct a compression job to start a few hours from now, issue this command:
at <tt:mm> -f /usr/local/bin/dv2xvid
where <tt:mm> is the hour and minute to begin the job.
Note that you have to give the full path of the file to be run. Instead
of using the dv2xvid file directly, you could write a small file with
bash commands that at would then execute.
In this way, you can start the job after you leave work, after a
capture job has completed, or after another compression job is done.
You can also use this to start a capture job after a compression job
has completed; just leave the tape to be captured in the camcorder.
I haven't tried giving an at command remotely, but I imagine it would work if correctly formulated.
avisplit
for quick cuts: avisplit can be used to cut bits out of a
recording very fast -- you just need the time codes and use the -t flag,
as in this example:
avisplit -i orig.avi -o cut.avi -c -t \
0:1:04-0:33:18,0:42:54-1:03:58,1:12:58-1:36:46,1:46:16-1:58:27
This will not decode or recompress the AVI so it is very fast -- depends
only on harddisk performance. Note that avifile tools usually work reliably
only on transcode generated AVI files.
Kino
will read raw DV files produced by the transcode dvraw export
module. The trick is to present dvraw with exactly the
correct dimensions and audio format for DV.
$ transcode -z -i foo.xvid -y dvraw -o foo.dv
...produces a raw DV stream that Kino loads and plays.
Generate
an index with transcode
transcode -i in.avi -P3 -o out.avi
Avidemux
to cut out scenes marked by keyframes
I use 'avidemux' to cut out the commercials, which is easy since avidemux
has a "skip to next keyframe" button. Usually at the end of commercials
there is a new keyframe. Use the markers begin/end and the delete option
from the "mark" menu to cut the ads out. Then write a new file with A/V
to disk. See http://fixounet.free.fr/avidemux/.
Merging
a video and an audio file
transcode -i video.avi -p audio.wav -P 1 -b 128,0 -o complete.avi -y
raw
Download an image and mount it on a background
wget
http://images.amazon.com/images/P/0790729628.01.LZZZZZZZ.jpg
--output-document - | montage -background black -geometry 720x480 -
cover.jpg
or more simply,
curl http://images.amazon.com/images/P/0790729628.01.LZZZZZZZ.jpg | montage -background black -geometry 720x480 - cover.jpg
Using
transcode in a distributed system
transcode has a "-y net" option that sends the result to another
computer instead of to a codec.
See also discussion
forum entry.
There is a cluster mode which you may want to try out. Read /docs/cluster_mode.txt.
Frame grabbing with transcode
For frame grabbing using transcode, see below.
Cropping a video and converting to anamorphic
Some camcorders produce so-called letterboxed 16/9 footage rather than real anamorphic. Here's how to convert:
I experimented a little a found that the following will convert letterboxed 16/9 to anamorphic 16/9.
transcode -i capture001.dv -j 80 -x dv,dv -o file.mpeg -y mpeg2enc,dv --export_asr 3 -Z 720x576
- -j 80 cuts away the black bars in top and bottom.
- --export_asr 3 exports to 16 format
- -Z 720x576 zooms the picture which has been cut down to 720x416 (576-(s*80)) back to 720x576.
I probably left out a lot of picture quality optimizations.
Data rates
Encoding with transcode -y mpeg I get
Total data rate : 324100 bytes/sec (2592800 bits/sec) (8 bits = 1 byte)
Total data rate : 324,1 kB/sec (2592,8 kbits/sec)
Total data rate : 19446 kB/min
Total data rate : 19,45 MB/min
Total data rate : 172100 bytes/sec (1376800 bits/sec)
Total data rate : 172,1 kB/sec
Total data rate : 10326 kB/min
Total data rate : 10,32 MB/min
So that's the range in mpeg2 -- between 10 and 20 MB/min. The average
may be towards the lower end of that, around 12 MB/min, but this may vary.
A normal mp3 audio bit rate is 16000 bytes/sec (128 kbit/sec) -- so rates
are often given in kbit rather than KB!! In comparison, the above video
was at 2592 kbit/sec.
A normal mpeg2 video rate is 297000 bytes/sec (2376 kbit/sec) -- about
20 times the audio rate.
The total file size of the mpeg files is 3158kB or 3.1 MB
The total file size of the dv files is 63000kB or 63 MB
This means that the compression ratio is 20:1.
The total video sequence is 17 seconds. That means a minute of video
is
222 MB more or less -- you'd estimated 200MB/min, which is about right.
So you go from 200MB/min in dv to 20MB/min with mpeg2.
In divx, you can set the frame rate of course to get the quality you
want.
I tried a high 2000 and got files that were larger than the mpeg2 files.
I tried a low 1000 and got
The total file size of the mpeg files is 2.6 MB
The total file size of the dv files is 63 MB
This means the compression ratio is around 25:1 and the bitrate around
10 MB/sec. The picture quality is not very good.
"To compare, a DVD-quality video encoded in the MPEG-2 format uses
six to eight megabits per second, while the same video in MPEG- 4 would
use two or three megabits per second."
Transcode will make good use of any processing power, so feel free to
get one that can encode dv realtime. It likely requires two CPUs at around
2GHz, though that's a guess.
The XFS file system may be better than ext3. Someone found it a lot faster.
Available codecs for export (see /usr/local/lib/transcode/):
MPEG2
|
MPEG4
|
Other
|
Audio
|
Unknown
|
ffmpeg |
divx4 |
dv
|
mpeg |
af6 |
mjpeg |
divx4raw |
dvraw |
mp2enc |
im |
yuv4mpeg |
divx5 |
mov |
pcm |
|
mpeg2enc |
fame |
net |
ppm |
|
|
ffmpeg4 |
null |
toolame |
|
|
opendivx |
raw |
wav |
|
|
xvid |
|
ogg |
|
|
xvidcvs |
|
|
|
|
xvidraw |
|
|
|
Xvid history
As of August 2003, I've switched to the free and open-source
xvid codec, dated 2003-07-30, version 0.9.2, and available in Debian
from mid-August 2003. The codec behaves much like the commercial divx5
codec and it likely has features I'm not yet exploiting (some
experimenting is called for). Playback is done with ffmpeg in Linux; we
need to test playback in Mac and Windows. The xvid codec is called by
the script /usr/local/bin/dv2xvid,which does a two-pass encoding.
On 21 October 2002, I succeeded in using xvid -- and from a raw dv file
made with dv1394in! So this is a new way of doing things. This unexpected
success is presumably a combination of two things: yesterday I compiled
the most recent xvid cvs and transcode 0.6 final. The xvid is named 2002-10-17.
There's an xvid.cfg file, but it looks useful only for very advanced users.
I simply modified the dv2divx.sh shell script to use xvid as a codec and
to look for dv rather than avi files. I'll also try using ogg -- the dv2xvid.sh
now has ogg as audio codec, not yet tested. You'll also need to test whether
these files will play at all - and on other platforms! So far so good.
Transcode
for V4L framegrabbing
You can use transcode to grab from a V4L device using the `nvrec' import
module. Read /docs/import_nvrec.txt. This has several advantages over
using vcr:
- transcode generates the AVI files so the avi* tools work
- You can use all processing filters available in transcode
- A/V synch is just perfect.
- You have all the freedom transcode gives you.
The disadvantage of not having a timer application to start recording
jobs can be solved be using the standard at(1) tool. I use the following
script (make a symlink from transcode to ztranscode to make it work)
----------------snip----------------
#!/bin/sh
recorder="ztranscode"
echo -n "Start time (hh:mm)? "; read start
echo -n "Stop time (hh:mm)? "; read stop
echo -n "filename ? "; read filename
echo -n "Bitrate [800] ? "; read rate
echo -n "Extra args ? "; read extra
if test -z ${start}; then start=00:00; fi
if test -z ${stop}; then stop=00:01; fi
if test -z ${filename}; then filename=film-${start}-${stop}.avi; fi
if test -z ${rate}; then rate=800; fi
echo Inserting start job at ${start}
echo -e "
#!/bin/sh \n\
ztranscode -V -i /dev/v4l2/capture0 -x nvrec,null -y divx5,null -g 576x432
\
-u 200 -J ppcvs=\"lb tn:64:128:256 dr\" -e 44100,16,2 -q0
-w $rate -H0 \
-o video-$filename -m audio-$filename $extra" \
| at ${start}
echo Inserting kill job at ${stop}
echo -e "#!/bin/sh
echo ${filename} recorded\n\
echo Now merge them using\n\
echo avimerge -i video-$filename -p audio-$filename -o $filename\n\
killall -2 ztranscode" | at ${stop}
exit 0;
----------------snip----------------
You can specify a keyframe interval by the second argument of the `-w'
parameter. If you set this to 1 nearly every frame is a keyframe (eg
-w
1800,1,100). I do not suggest doing so, just because the default works
very well for me. Before the commercial break starts, the divx encoder
ususally detects a scene change and inserts a key frame anyway.
Hope this helps
Tilmann
22 November 2002 update
I just got the new transcode on spello and want to compare it to what
I already have running on cyberspace. Here is the cyberspace version:
Creating the target directory divx5-2 for the encoded filestranscode
v0.6.1 (C) 2001-2002 Thomas Östreich
[import_dv.so] v0.2.6 (2001-11-08) (video) DV | (audio) PCM
[export_null.so] v0.1.2 (2001-08-17) (video) null | (audio) null
[export_divx5.so] v0.1.3 (2002-05-14) (video) DivX 5.xx | (audio) MPEG/AC3/PCM
[transcode] auto-probing source 2002.09.10_13-06-21.dv (ok)
[transcode] V: import format | Digital Video (V=dv|A=dv)
[transcode] V: import frame | 720x480 1.50:1 encoded @ 4:3
[transcode] V: de-interlace | (mode=3) zoom to full frame (slow)
[transcode] V: flip frame | yes
[transcode] V: rgb2bgr | yes
[transcode] V: bits/pixel | 0.193
[transcode] V: anti-alias | (mode=2|0.33|0.50) resize effects only
[transcode] V: encoding fps | 29.970
[transcode] V: multi-pass | (mode=1) writing data (pass 1) to divx4.log
[transcode] A: import format | 0x1 PCM [32000,16,2] 1024 kbps
[transcode] A: export format | 0x55 MPEG layer-3 [32000,16,2] 128 kbps
[transcode] A: bytes per frame | 4272 (4270.933333)
[transcode] A: adjustment | -1064@1000
[import_dv.so] tcextract -x dv -i "2002.09.10_13-06-21.dv" -d
0 | tcdecode -x dv -y pcm -d 0
[import_dv.so] tcextract -x dv -i "2002.09.10_13-06-21.dv" -d
0 | tcdecode -x dv -y rgb -d 0 -Q 5
For comparison, here is the new transcode on spello -- the very first
time it's working! So first of all it's 6.2 vs. 6.1, secondly the dv codec
is [import_dv.so] v0.2.8 (2002-11-21) vs v0.2.6 (2001-11-08) -- that's
a difference of a year! Third, the divx code is also new -- [export_divx5.so]
v0.1.4 (2002-10-10) vs v0.1.3 (2002-05-14). And I was doing other things
while it was being downloaded and installed! Debian is a huge timesaver.
Very impressive. Finally note the new video acceleration mode, V: IA32
accel mode | sse (sse mmxext mmx asm), which didn't even exist before.
Creating the target directory divx5-2 for the encoded filestranscode
v0.6.2 (C) 2001-2002 Thomas Östreich
[transcode] auto-probing source TimeLapse-every-30.dv (ok)
[transcode] V: import format | Digital Video (V=dv|A=dv)
[transcode] V: import frame | 720x480 1.50:1 encoded @ 4:3
[transcode] V: de-interlace | (mode=3) zoom to full frame (slow)
[transcode] V: flip frame | yes
[transcode] V: rgb2bgr | yes
[transcode] V: bits/pixel | 0.193
[transcode] V: anti-alias | (mode=2|0.33|0.50) resize effects only
[transcode] V: encoding fps | 29.970
[transcode] V: multi-pass | (mode=1) writing data (pass 1) to divx4.log
[transcode] A: import format | 0x1 PCM [32000,16,2] 1024 kbps
[transcode] A: export format | 0x55 MPEG layer-3 [32000,16,2] 128 kbps
[transcode] A: bytes per frame | 4272 (4270.933333)
[transcode] A: adjustment | -1064@1000
[transcode] V: IA32 accel mode | sse (sse mmxext mmx asm)
[import_dv.so] v0.2.8 (2002-11-21) (video) DV | (audio) PCM
[export_null.so] v0.1.2 (2001-08-17) (video) null | (audio) null
[export_divx5.so] v0.1.4 (2002-10-10) (video) DivX 5.xx | (audio) MPEG/AC3/PCM
[import_dv.so] tcextract -x dv -i "TimeLapse-every-30.dv" -d
0 | tcdecode -x dv -y pcm -d 0
[import_dv.so] tcextract -x dv -i "TimeLapse-every-30.dv" -d
0 | tcdecode -x dv -y rgb -d 0 -Q 5
I just copied the script over to spello, so that part looks to work fine.
You have to admit that was a pretty rapid deployment, but there were of
course hitches on unrelated matters, largely vmware. The solution for
the moment is simply not to run samba on spello -- the only reason would
be to gain direct access to merton and nicco; you'll have indirect access
through NFS to gubbio and cyberspace.
12 November 2002 update
Try this deinterlace and see if it makes a difference:
transcode -i /video/MH/ep2/ -x dv,dv -j 0,32,0,32 -J
smartdeinter=highq=1:cubic=1 -k -z -o ./final
-cut.avi -y xvid -w 6400
Note he's using -w 6400 -- an extremely high value, but possibly leading
to better quality. Try it out.
More details (including how to put this on a DVD) at
http://expressivefreedom.org/Projects/PVR/Firewire-Methodology.html
Here's Tilman describing what he does:
I often record mpeg2 streams of my dbox2 using grab and I use this commandline
to convert it to divx. The input is assumed as 720x576 encoded at 1.25:1
#first pass transcode -V # enable YUV mode for ppcvs -i record.mpg # input file -B 9,9,16 # scale down to 576x432 -x auto,null # no need to do audio in the first pass -y xvidcvs,null # encode to xvid -o final.avi # outputfile (may be omittet) -M 1 # PAL demuxer -w 1030 # to fit 2*45 minutes (2 episodes) on a CD. -G 0.89 # gamma correction for my monitor -J ppcvs="lb vb hb dr" # see -J ppcvs=help for this, I do # not use `al' because I do not like it -R 1 # first pass
#second pass transcode -i record.mpg -V -B 9,9,16 -y xvidcvs # this time with audio -o final.avi # this time it matters -M1 -w 1030 -G 0.89 # same as above -J ppcvs="lb vb hb dr" -R2 # second pass
I choose ppcvs=lb for deinterlacing after a lot of testing with other
deinterlacers available in transcode. The grabbed mpeg2 streams are somehow
interlaced in a real weird way, sometimes there is one complete progressive
(i.e non interlaced frame) and after this comes a completely interlaced
one. All other deinterlacers I have tried produce some "jerkiness" and
I personally find the bluring ppcvs=lb does the most suitable for me.
For this toolchain to work even better the ppcvs plugin should not be
used as a postprocess filter (which it is at the moment) but as a pre
filter before scaling. The plugin does deinterlacing so this makes a lot
of sense to me.
I'll come up with a clean solution someday but in the meantime to accomplish
this you have to patch filter_ppcvs for your self
cd transcode-src/
vi filter/filter_ppcvs.c
search for TC_POST_PROCESS and replace it with TC_PRE_PROCESS
:wq
make install
Correspondence and command lines
Tilmann
Bitterberg, 20 Jun 2002: DV to mpeg2
On 19.06.02, Peter Plantagenet wrote:
I've recently been trancoding digital camcorder clips made with dvgrab
to divx5 on Linux, using the recommended command line transcode -i *_001*avi
-I 3 -C 2 -z -k -o encode/001.avi -y divx5
1. What's a recommended command line for a multiple pass? I tried to add
-R1 and -R2 to the line above, but got nothing that struck me as an improvement.
Do I need to add a -w parameter, and what is a reasonable value?
If `-w' is not specified it defaults to 1800 which is quite a lot.
That's why you don't see much from 2pass encoding. A 2pass commandline
would be,
CMD="-i ... -I 3 -C 2 -z -k"
transcode $CMD -x auto,null -y divx5,null -o /dev/null -R1
transcode $CMD -o encode/001.avi -R
This doesn't encode audio during the first pass.
- Personally I find `-w 1000' with 2pass encoding a reasonable value.
- I would suggest to use the `-V' option for a speed and quality gain
- YUV -> RGB -> YUV doesn't make the image better, if the
dv file is in YUV format
2. I would like to encode some of my dv (avi) files to mpeg2, in order
to retain a slightly higher quality than the divx5 at the price of larger
file sizes. What do I need to do?
Transcode already comes with an mpeg2 encoder, a possible command line
would be
transcode ... -V -y mpeg -F 2 -o foo tcmplex -m 2 -i foo.m2v -p
foo.mpa -o foo.mpg
read /docs/template.cfg.txt howto to create a profile to suit your
mpeg2 needs. I doubt there will be much quality gain when encoding to
mpeg2 instead of mpeg4 (divx) especially at these high bitrates.
Trial runs (see below for installation history)
tcprobe examples:
Here's an AVI file (really, an OGM file) after running dv2xvid (xvid+ogg)
on a raw dv:
[tcprobe] OGG Multimedia Container
[tcprobe] summary for 2002-07-06_06-45-46.avi, (*) = not default, 0 =
not detected
import frame size: -g 720x480 [720x576] (*)
frame rate: -f 29.971 [25.000] frc=4 (*)
audio track: -a 0 [0] -e 32000,16,2 [48000,16,2] -n 0xfffe [0x2000] (*)
bitrate=128 kbps
Here's an AVI file from DV grab (format dv2):
gubbio:~/mnt/giant/video # tcprobe -i welcome.avi
[tcprobe] RIFF data, AVI video
[avilib] V: 29.971 fps, codec=dvsd, frames=81, width=720, height=480
[avilib] A: 32000 Hz, format=0x01, bits=16, channels=2, bitrate=1024 kbps,
[avilib] 81 chunks, 345932 bytes
[tcprobe] summary for welcome.avi, (*) = not default, 0 = not detected
import frame size: -g 720x480 [720x576] (*)
frame rate: -f 29.971 [25.000] frc=4 (*)
audio track: -a 0 [0] -e 32000,16,2 [48000,16,2] -n 0x1 [0x2000] (*)
bitrate=1024 kbps
length: 81 frames, frame_time=33 msec
Here's a raw, DV format file:
[tcprobe] Digital Video (NTSC)
[tcprobe] summary for test_002.dv, (*) = not default, 0 = not detected
import frame size: -g 720x480 [720x576] (*)
aspect ratio: 4:3 (*)
frame rate: -f 29.970 [25.000] frc=4 (*)
audio track: -a 0 [0] -e 32000,16,2 [48000,16,2] -n 0x1 [0x2000] (*)
audio track: -a 0 [0] -e 32000,16,2 [48000,16,2] -n 0x1 [0x2000] (*)
bitrate=1024 kbps
Here's the gigantic, raw DV format file:
[tcprobe] RIFF data, AVI video
[avilib] V: 29.971 fps, codec=dvsd, frames=100000, width=720, height=480
[avilib] A: 32000 Hz, format=0x01, bits=16, channels=2, bitrate=1024 kbps,
[avilib] 100000 chunks, 427073268 bytes
[tcprobe] summary for test_001.avi, (*) = not default, 0 = not detected
import frame size: -g 720x480 [720x576] (*)
frame rate: -f 29.971 [25.000] frc=4 (*)
audio track: -a 0 [0] -e 32000,16,2 [48000,16,2] -n 0x1 [0x2000] (*)
bitrate=1024 kbps
length: 100000 frames, frame_time=33 msec
Transcode sessions
Here's a session with dv2xvid.sh (xvid + ogg) -- essentially this means
running something like this:
transcode -i raw.dv -I 3 -C 2 -z -k -w 2000 -y xvid,ogg -o test.avi
-m test.ogg
ogmmerge -o xvidogg.avi test.avi test.ogg
I modified the dv2divx.sh to a single-pass dv2xvid.sh that includes ogmmerge.
It generates separate xvid and ogg files that are merged with ogmmerge
at the end -- but they can also be individually refined. For instance,
the audio can be boosted and then remuxed.
I ran a full session on /vm/Spencer/2002/07 on 22 October 2002. It'll
be interesting to see if the sync is better! Dual-pass is not working.
transcode v0.6.1 (C) 2001-2002 Thomas Östreich
[transcode] auto-probing source 2002-07-18_07-52-31.avi (ok)
[transcode] V: import format | Digital Video RIFF data, AVI (V=dv|A=avi)
[transcode] V: import frame | 720x480 1.50:1
[transcode] V: de-interlace | (mode=3) zoom to full frame (slow)
[transcode] V: flip frame | yes
[transcode] V: rgb2bgr | yes
[transcode] V: bits/pixel | 0.193
[transcode] V: anti-alias | (mode=2|0.33|0.50) resize effects only
[transcode] V: encoding fps | 29.971
[transcode] A: import format | 0x1 PCM [32000,16,2] 1024 kbps
[transcode] A: export format | 0x55 MPEG layer-3 [32000,16,2] 128 kbps
[transcode] A: bytes per frame | 4272 (4270.848000)
[transcode] A: adjustment | -1152@1000
[import_avi.so] v0.4.2 (2002-05-24) (video) * | (audio) *
[import_dv.so] v0.2.6 (2001-11-08) (video) DV | (audio) PCM
[export_ogg.so] v0.0.2 (2002-07-21) (video) null | (audio) ogg
[export_xvid.so] v0.3.4 (2002-09-17) (video) XviD (Stable) | (audio) MPEG/AC3/PCM
[import_avi.so] format=0x1, rate=32000 Hz, bits=16, channels=2, bitrate=1024
[import_dv.so] tcextract -x dv -i "2002-07-18_07-52-31.avi"
-d 0 | tcdecode -x dv -y rgb -d 0 -Q 5
[export_ogg.so] oggenc -r -B 16 -C 2 -b 128 -R 32000 -Q -o xvid-ogg/2002-07-18_07-52-31.avi.ogg
encoding frames [000000-007499], 1.73 fps, EMT: 0:04:10, ( 0| 0| 0)
Here's what became a standard divx session (formalized in dv2divx.sh):
transcode -i encode/ -I 3 -C 2 -z -k -o tape-divxmp3.avi -y divx4
transcode v0.6.0pre5 (C) 2001-2002 Thomas Östreich
[transcode] auto-probing source encode/ (ok)
[transcode] V: import format | Digital Video RIFF data, AVI
(V=dv|A=avi)
[transcode] V: import frame | 720x480 1.50:1
[transcode] V: de-interlace | (mode=3) zoom to full frame (slow)
[transcode] V: flip frame | yes
[transcode] V: rgb2bgr | yes
[transcode] V: anti-alias | (mode=2|0.33|0.50) resize effects only
[transcode] V: anti-alias | (mode=2|0.33|0.50) resize effects only
[transcode] V: encoding fps | 29.971
[transcode] A: import format | 0x1 PCM [32000,16,2] 1024 kbps
[transcode] A: export format | 0x55 MPEG layer-3 [32000,16,2] 128 kbps
[transcode] A: bytes per frame | 4272 (4270.848000)
[transcode] A: adjustment | -1152@1000
[import_avi.so] v0.4.1 (01/29/02) (video) * | (audio) *
[import_dv.so] v0.2.6 (11/08/01) (video) DV | (audio) PCM
[export_divx4.so] v0.3.4 (05/05/02) (video) DivX 4.xx | (audio) MPEG/AC3/PCM
error: no audio track found
error: popen PCM stream
I'm unsure if this means I lack the MPEG/AC3/PCM codec, and also the
DivX codec.
Here's a session that actually worked!
gubbio:~/mnt/giant/video/encode # transcode -i cd.avi -I 3 -C 2 -z -k -o
encoded.avi
-y dv
transcode v0.6.0pre5 (C) 2001-2002 Thomas Östreich
[transcode] auto-probing source cd.avi (ok)
[transcode] V: import format | Digital Video RIFF data, AVI (V=dv|A=avi)
[transcode] V: import frame | 720x480 1.50:1
[transcode] V: de-interlace | (mode=3) zoom to full frame (slow)
[transcode] V: flip frame | yes
[transcode] V: rgb2bgr | yes
[transcode] V: anti-alias | (mode=2|0.33|0.50) resize effects only
[transcode] V: encoding fps | 29.971
[transcode] A: import format | 0x1 PCM [32000,16,2] 1024 kbps
[transcode] A: export format | 0x55 MPEG layer-3 [32000,16,2] 128 kbps
[transcode] A: bytes per frame | 4272 (4270.848000)
[transcode] A: adjustment | -1152@1000
[import_avi.so] v0.4.1 (01/29/02) (video) * | (audio) *
[import_dv.so] v0.2.6 (11/08/01) (video) DV | (audio) PCM
[export_dv.so] v0.1.0 (12/04/01) (video) Digital Video | (audio) MPEG/AC3/PCM
[import_avi.so] format=0x1, rate=32000 Hz, bits=16, channels=2, bitrate=1024
[import_dv.so] tcextract -x dv -i "cd.avi" -d 0 | tcdecode -x
dv -y rgb -d 0 -Q 5
(aud_aux.c) using lame-3.93 (alpha 2, May 27 2002 23:38:25) filling buffer
...
done
encoding frames [000000-000125], 1.95 fps, ( 0| 0| 0) clean up ... done
[transcode] encoded 126 frames (0 dropped), clip length 4.20 s
So what works is this: dv (converts avi to raw dv!), opendivx, ppm (images
that Pixie can't read), and xvidcvs (!!) -- the latest xvid, from CVS?
It
seems to work fine.
Here's another great one that works: mpeg!
gubbio:~/mnt/giant/video/encode # transcode -i cd.avi -I 3 -C 2 -z -k -o
encoded.avi -y mpeg
transcode v0.6.0pre5 (C) 2001-2002 Thomas Östreich
[transcode] auto-probing source cd.avi (ok)
[transcode] V: import format | Digital Video RIFF data, AVI (V=dv|A=avi)
[transcode] V: import frame | 720x480 1.50:1
[transcode] V: de-interlace | (mode=3) zoom to full frame (slow)
[transcode] V: flip frame | yes
[transcode] V: rgb2bgr | yes
[transcode] V: anti-alias | (mode=2|0.33|0.50) resize effects only
[transcode] V: encoding fps | 29.971
[transcode] A: import format | 0x1 PCM [32000,16,2] 1024 kbps
[transcode] A: export format | 0x50 MPEG layer-2 [32000,16,2] 128 kbps
[transcode] A: bytes per frame | 4272 (4270.848000)
[transcode] A: adjustment | -1152@1000
[import_avi.so] v0.4.1 (01/29/02) (video) * | (audio) *
[import_dv.so] v0.2.6 (11/08/01) (video) DV | (audio) PCM
[export_mpeg.so] v1.2.0 (03/23/02) (video) MPEG 1/2 | (audio) MPEG 1 Layer
II
[import_avi.so] format=0x1, rate=32000 Hz, bits=16, channels=2, bitrate=1024
[import_dv.so] tcextract -x dv -i "cd.avi" -d 0 | tcdecode -x
dv -y rgb -d 0 -Q 5
INFO: using reference profile (MPEG1)
INFO: profile type is (NTSC)
INFO: motion-comp. with SSE/MMX acceleration !
INFO: dct with MMX acceleration (intel)!
INFO: prediction with SSE-acceleration!
filling buffer ... done
encoding frames [000000-000125], 1.67 fps, ( 0| 0| 0)
INFO: Min bitrate of any one frame = 108228 bits
INFO: Max bitrate of any one frame = 484815 bits
INFO: Min bitrate over any one second = 5210828 bps
INFO: Avg bitrate over any one second = 5617893 bps
INFO: Max bitrate over any one second = 5764613 bps
INFO: Total time: 78 seconds (00:01:18), 1.60 frames/sec, 0.624 sec/frame.
clean up ... done
[transcode] encoded 126 frames (0 dropped), clip length 4.20 s
encoding frames [000000-000086], 1.74 fps, ( 9| 1| 0)
Now that seems pretty promising. Here are the file lengths:
-rw-r--r-- 1 steen users 15664508 May 27 15:10 cd.avi
-rw-r--r-- 1 root root 2928912 May 28 05:27 mpeg.m1v
-rw-r--r-- 1 root root 66816 May 28 05:27 mpeg.mpa
-rw-r--r-- 1 root root 1168718 May 28 04:57 opendivx.avi
-rw-r--r-- 1 root root 1053928 May 28 05:20 xvidcvs.avi
The original is 156MB, the mpeg has made two files of 30MB, and the
opendivx and xvidcvs are around 10MB -- less then a tenth of the original.
Playback results
The results? Windows Media Player won't play the opendivx or the xvidcvs
-- the only one it handles is the mpeg, which it plays upside down! But
it
plays fine and it looks good; you can turn off the upside down feature
I
believe.
xvid+ogg
gmplayer xvidogg.avi
Playing xvidogg-test.avi
Cache fill: 18.77% (1574557 bytes) Detected OGG file format!
=============================================
Opening audio decoder: [libvorbis] Ogg/Vorbis audio decoder
AUDIO: 32000 Hz, 2 ch, 16 bit (0x10), ratio: 16000->128000 (128.0 kbit)
Selected audio codec: [vorbis] afm:libvorbis (OggVorbis Audio Decoder)
=============================================
=============================================
Opening video decoder: [ffmpeg] FFmpeg's libavcodec codec family
Selected video codec: [ffodivx] vfm:ffmpeg (FFmpeg MPEG-4)
=============================================
mpeg
gmplayer -vo xv -ao oss mpeg*
this plays upside down and without sound.
Now, Aviplay handles both xvidcvs and opendivx really well, and the mpeg
file plays upside down without sound. You can's scrub these files -- pan
back and forth -- but the quality is excellent and the compression
extreme.
Kino won't read any of the compressed files.
It's likely that if you can get the divx4 and 5 codecs, they would also
play in Windows.
You can get divx501 here:
http://www.divx-digest.tv/software/codec/divx4linux501-20020418.tgz
and http://www.divx.com/divx/maclinux.php
I also installed it for Windows, and the encoder works! So this is the
state of affairs:
* Mplayer does a great job with divx5
* Windows Media Player plays it fine (I downloaded the codec)
* Aviplay make a mess of things -- the colors are flooding
Still, this means I have players on both Linux and Windows for divx5,
and it'll work on the Mac too.
Instructions: http://www.theorie.physik.uni-goettingen.de/~ostreich/transcode/html/dv.html
Put all AVI-files or raw DV stream into a subdirectory, e.g., named "divx5/".
transcode -i graham/ -I 3 -C 2 -z -k -o graham/play.avi -y divx5
The necessary import module is autodetected. tccat extracts the video
stream of all AVI-files and concatenates them together to make the clips
appear as a single DV stream for transcode.
Here, the de-interlace option "-I 3", which drops one half-frame
and interpolates by zooming to full frame size and, in principle, removes
the interlace artifacts. We also try the anti-aliasing feature with "-C
2" to process the full frame afterwards, but this is slow.
Well, that's it. Use avimerge to glue the matching clips together and
burn the resulting file to CD. This actually seems to work.
Modules: http://www.theorie.physik.uni-goettingen.de/~ostreich/transcode/html/modules.html
"I have a couple of DV AVI-file clips I want to transcode as a single
movie without merging. How does it work?"
The "directory mode" with option "-i" also works for DV AVI-files
(hopefully). Try to put all clips into a directory and use the directory
name to let transcode extract and merge the raw DV stream for further
processing.
transcode v0.6.0pre5 (C) 2001-2002 Thomas Östreich
'transcode -h | more' shows a list of available command line options.
gubbio:~ # transcode -h | more
transcode v0.6.0pre5 (C) 2001-2002 Thomas Östreich
Usage: transcode [options]
options:
-i name input file/directory/device/mountpoint/host name
-H n auto-probe n MB of source (0=off) [1]
-p file read audio stream from separate file [off]
-a a[,v] extract audio[,video] track [0,0]
-T t[,c[-d][,a]] select DVD title[,chapter(s)[,angle]] [1,1,1]
-L n seek to VOB stream offset nx2kB [0]
-e r[,b[,c]] PCM audio stream parameter [48000,16,2]
-g wxh RGB video stream frame size [720x576]
-u m[,n] use m framebuffer[,n threads] for AV processing [10,1]
-x vmod[,amod] video[,audio] import modules [null]
-o file output file name
-m file write audio stream to separate file [off]
-y vmod[,amod] video[,audio] export modules [null]
-d swap bytes in audio stream [off]
-s g[,c[,f[,r]]] increase volume by gain,[center,front,rear] [off,1,1,1]
-A use AC3 as internal audio codec [off]
-V use YV12/I420 as internal video codec [off]
-J filter[,...] apply external filter plugins [off]
-P flag pass-through flag (0=off|1=V|2=A|3=A+V) [0]
-D num sync video start with audio frame num [0]
-M mode demuxer PES AV sync mode (0=off|1=PTS only|2=full) [1]
-O flush lame mp3 buffer on encoder stop [off]
-f rate[,frc] output video frame rate[,frc] [25.000,0] fps
-z flip video frame upside down [off]
-l mirror video frame [off]
-k swap red/blue (Cb/Cr) in video frame [off]
-r n[,m] reduce video height/width by n[,m] [off]
-j t[,l[,b[,r]]] select frame region by clipping border [off]
-B n[,m[,M]] resize to height-n*M rows [,width-m*M] columns [off,32]
-X n[,m[,M]] resize to height+n*M rows [,width+m*M] columns [off,32]
-Z wxh resize to w columns, h rows with filtering [off]
-C mode enable anti-aliasing mode (1-3) [off]
-I mode enable de-interlacing mode (1-3) [off]
-K enable b/w mode [off]
-G val gamma correction (0.0-10.0) [off]
-Y t[,l[,b[,r]]] select (encoder) frame region by clipping border [off]
-w b[,k[,c]] encoder bitrate[,keyframes[,crispness]] [1800,250,100]
-R n[,f1[,f2]] enable multi-pass encoding (0-3) [0,divx4.log,pcm.log]
-Q n[,m] encoding[,decoding] quality (0=fastest-5=best) [5,5]
-b b[,vbr[,q]] audio encoder bitrate kBits/s[,vbr[,quality]] [128,0,5]
-n 0xnn import audio format id [0x2000]
-N 0xnn export audio format id [0x55]
-E samplerate audio output samplerate [as input]
-F codec encoder parameter strings [module dependent]
-c f1-f2 encode only frames f1-f2 [all]
-t n,base split output to base%03d.avi with n frames [off]
-U base process DVD in chapter mode to base-ch%02d.avi [off]
-W n,m[,file] autosplit and process part n of m (VOB only) [off]
-S unit[,s1-s2] process program stream unit[,s1-s2] sequences [0,all]
-q level verbosity (0=quiet,1=info,2=debug) [1]
-h this usage message
-v print version
additional long options:
--zoom_filter string use filter string for video resampling -Z [Lanczos3]
--cluster_percentage use percentage mode for cluster encoding -W [off]
--cluster_chunks a-b process chunk range instead of selected chunk [off]
--export_asr C set export aspect ratio code C [as input]
--keep_asr try to keep aspect ratio (only with -Z) [off]
--export_frc F set export frame rate code F [as input]
--divx_quant min,max divx encoder min/max quantizer [2,31]
--divx_rc p,rp,rr divx encoder rate control parameter [2000,10,20]
--import_v4l n[,id] channel number and station number or name [0]
--record_v4l a-b recording time interval in seconds [off]
--duration hh:mm:ss limit v4l recording to this duration [off]
--pulldown set MPEG 3:2 pulldown flags on export [off]
--antialias_para w,b center pixel weight, xy-bias [0.333,0.500]
--no_audio_adjust disable audio frame sample adjustment [off]
--av_fine_ms t AV fine-tuning shift t in millisecs [autodetect]
--nav_seek file use VOB navigation file [off]
--psu_mode base process VOB in PSU mode to base-psu%02d.avi [off]
--psu_chunks a-b process only selected units a-b for PSU mode [all]
--no_split encode to single file in chapter/psu mode [off]
--pre_clip t[,l[,b[,r]]] select initial frame region by clipping border
[off]
--post_clip t[,l[,b[,r]]] select final frame region by clipping border
[off]
--a52_drc_off disable liba52 dynamic range compression [enabled]
--a52_demux demux AC3/A52 to separate channels [off]
--dir_mode base process directory contents to base-%03d.avi [off]
--more_help param more help on named parameter
MPlayer's response to the divx5 file:
gubbio:/home/steen/video/encode # gmplayer -vo xv -ao oss divx5.avi
MPlayer 0.90pre4-2.95.3 (C) 2000-2002 Arpad Gereoffy (see DOCS!)
CPU vendor name: GenuineIntel max cpuid level: 2
CPU: Intel Celeron 2/Pentium III Tualatin (Type: 6, Stepping: 1)
extended cpuid-level: 4
Testing OS support for SSE... yes.
Testing OS support for SSE unmasked exceptions... yes.
Tests of OS support for SSE passed.
CPUflags: Type: 6 MMX: 1 MMX2: 1 3DNow: 0 3DNow2: 0 SSE: 1 SSE2: 0
Compiled for x86 CPU with features: MMX MMX2 SSE
vo: X11 running at 1024x768 with depth 16 and 16 bits/pixel (":0.0"
=>
local display)
Reading /root/.mplayer/codecs.conf: can't open
'/root/.mplayer/codecs.conf': No such file or directory
Reading /usr/local/share/mplayer/codecs.conf: 34 audio & 92 video
codecs
font: can't open file: /root/.mplayer/font/font.desc
font: can't open file: /usr/local/share/mplayer/font/font.desc
Using Linux's hardware RTC timing (1024Hz)
Can't open input config file /root/.mplayer/input.conf : No such file
or
directory
Falling back on default (hardcoded) config
SKIN dir 1: '/root/.mplayer/Skin'
SKIN dir 2: '/usr/local/share/mplayer/Skin'
Playing divx5.avi
Detected AVI file format!
MainAVIHeader.dwFlags: (272) HAS_INDEX IS_INTERLEAVED
VIDEO: [DIVX] 720x480 24bpp 29.97 fps 1884.0 kbps (230.0 kbyte/s)
[V] filefmt:3 fourcc:0x58564944 size:720x480 fps:29.97 ftime:=0.0334
Clip info:
Software: transcode-0.6.0pre5
Detected audio codec: [mp3] drv:1 (MPEG layer-2, layer-3)
Selecting Audio Decoder: [mp3lib] MPEG layer-2, layer-3
mp3lib: made decode tables with MMX optimization
init layer2&3 finished, tables done
mp3lib: using MMX optimized decore!
MPEG 1.0, Layer III, 32000 Hz 128 kbit Joint-Stereo, BPF: 576
Channels: 2, copyright: No, original: Yes, CRC: No, emphasis: 0
AUDIO: srate=32000 chans=2 bps=2 sfmt=0x10 ratio: 16000->128000
=============================================
Opening Video Decoder: [ffmpeg] FFmpeg's libavcodec codec family
libavcodec: CPU flags: mmx mmxext sse
Detected video codec: [ffodivx] drv:5 prio:0 (FFmpeg MPEG-4)
=============================================
AO: [oss] 32000Hz Stereo Signed 16-bit (Little-Endian)
ao2: 32000 Hz 2 chans Signed 16-bit (Little-Endian)
audio_setup: sample format: Signed 16-bit (Little-Endian) (requested:
Signed 16-bit (Little-Endian))
audio_setup: using 2 channels (requested: 2)
audio_setup: using 32000 Hz samplerate (requested: 32000)
audio_setup: frags: 16/16 (4096 bytes/frag) free: 65536
Start playing...
This file was encoded with DivX501 Build20020416
VDec: vo config request - 720 x 480, Planar YV12 0% 0% 0.0% 0 0 0%
[PP] Sorry, postprocessing is not available
Movie-Aspect is undefined - no prescaling applied.
VO: [xv] 720x480 => 720x480 Planar YV12
*** [vo] Exporting mp_image_t, 720x480x12bpp YUV planar, 518400 bytes
Installation history
Ogg vorbis
http://www.vorbis.com/
Next, here's the Ogg Vorbis CVS -- see http://www.xiph.org/cvs.html
cvs -d :pserver:anoncvs@xiph.org:/usr/local/cvsroot login
when prompted for a password, use anoncvs
cvs -d :pserver:anoncvs@xiph.org:/usr/local/cvsroot -z 9 co module
Get these modules:
ogg
vorbis
For a full list, see http://www.xiph.org/cvs.html
I did ./autogen.sh --prefix=/usr and then make and make install, and
it went fine. There was an earlier version of ogg installed, so I had
to put it where it was, in /usr and not /usr/local.
Thanks to that, lame finally found vorbis...
I then compiled lame from http://sourceforge.net/cvs/?group_id=290, again
using --prefix=/usr -- it wouldn't compile with vorbis, so I left that
out. Lame compiled fine.
BBC uses ogg -- http://support.bbc.co.uk/ogg/
-- XMMS should play this by default -- and send them a letter!
On 14 August 2002, I downloaded tarballs (from http://www.vorbis.com/download_unix.psp
using wget) for libao 0.8.3, libogg 1.0.1, libvorbis 1.0.1, and vobistools
1.0. I configured libao for alsa 9 and arts (and likely also for oss),
and used --prefix=/usr for everything (not necessarily such a good practice,
but his is where the old installation was). I configured vorbistools with
lots of --disable test suites.
I also symlinked the XMMS plugin:
ln -sf /usr/lib/libvorbis.so.0.2.0 /usr/X11R6/lib/xmms/Input/libvorbis.so
Note that libvorbis 1.0.1 produced libvorbis.so.0.2.0. It has transcode
support in 0.6.0 (see changelog):
- Experimental Ogg multimedia support added by Tilmann Bitterberg.
This includes Ogg Vorbis audio encoding/decoding modules. For more information
on creating Ogg compliant media streams see Moritz Bunkus' oggmtools
at http://www.bunkus.org/videotools/ogmtools/
Encode, e.g., to separate AVI XviD video / Ogg Vorbis audio stream with
$ transcode [...] -y xvid,ogg -m audio.ogg -o video.avi
and use oggmerge to multiplex into an Ogg Multimedia stream. Auto-probing
is also available but no demuxing. Decoding only for Ogg Vorbis single
audio streams with the new import module "import_ogg.so".
See also his AVIextract, an AVI demuxer that will pull out the video
or the audio, including mp3. http://www.bunkus.org/videotools/
Also check out http://www.fmod.org/ -- not clear what this does.
Avifiles
Now, I did a cvs update on avifiles and got lots of stuff, but it wouldn't
compile. Avifile continues to be a pain to stabilize, so don't upgrade
once you have a stable version (I made that mistake in August 02 and now
have nothing).
Transcode
I then moved on to transcode, which needs liba52, which I got from
http://liba52.sourceforge.net/downloads.html
cvs -d :pserver:anonymous@cvs.liba52.sourceforge.net:/cvsroot/liba52
login
cvs -d :pserver:anonymous@cvs.liba52.sourceforge.net:/cvsroot/liba52 co
a52dec
liba52 needed ./bootstrap and was configured for /usr; it built fime.
The CVS
directory is called a52dec.
Incidentally, you can update all the CVS directories at once simply by
typing cvs
update!
Libdvdcss
Then I got libdvdcss 1.2.0 from videolan -- there's no public cvs unfortunately,
so I got the tarball from http://www.videolan.org/libdvdcss/download.html
I did a ./configure --prefix=/usr and then make and make install -- painless.
Transcode
Then transcode itself -- I got the transcode-0.6.0pre5 tarball from
http://www.theorie.physik.uni-goettingen.de/~ostreich/transcode/
I should get the OpenDivX and Xvid codecs at some point -- it can wait.
I did a
./configure --prefix=/usr
---------------------------------------------------------- Summary for transcode 0.6.0 features:static AV-frame buffering yes DVD navigation with libdvdread yes link against local lame library (>=3.89) yes support for net streams yes avifile dependent modules | avifile-0.6 support yes | yes libmpeg3 dependent modules no quicktime dependent modules no libdv dependent modules yes liba52 audio plugin (>=0.7.3) | default decoder yes | no libfame video encoding plugin no nasm dependent modules no ImageMagick dependent modules (>=5.4.3) no libxml2 dependent import modules yes mjpegtools dependent export modules no experimental v4l support yes X11 dependent filter plugins yes MPlayer libpostproc dependent filter plugin no ----------------------------------------------------------
So transcode also uses Quicktime for Linux, or OpenQuicktime, but it
says "Expect a new release very soon" at their site, http://openquicktime.sourceforge.net/
I then did a make and a make install for transcode. The libraries are
installed in /usr/lib/transcode
xvid
Now there's xvid at http://www.xvid.org/ -- I've already got their latest
snapshot, but they have a cvs!
cvs -d:pserver:anonymous@cvs.xvid.org:/xvid login
cvs -d:pserver:anonymous@cvs.xvid.org:/xvid co xvidcore
This worked beautifully. I entered /mnt/giant/cvs/xvidcore/build/generic
and just typed make -- it seemed to work, but then it foundered on nasm:
make: nasm: Command not found
nasm
the Netwide Assembler, nasm, is at http://nasm.2y.net/ and http://sourceforge.net/projects/nasm
has the cvs:
cvs -d:pserver:anonymous@cvs.nasm.sourceforge.net:/cvsroot/nasm login
cvs -z3 -d:pserver:anonymous@cvs.nasm.sourceforge.net:/cvsroot/nasm
co nasm
It needs autoconf 2.53 or later -- I have 2.52. I got it from ftp://ftp.gnu.org/gnu/autoconf/
as a tarball and did a ./configure --prefix=/usr
followed by make and make install.
Then autoconf worked for nasm, and I did ./configure --prefix-/usr
I got the "bad interpreter: Permission denied" error -- mysterious.
It turns out it may have an explanation -- when I do
bash ./configure
it works fine! So I've just lost an env variable and can't find the program?
In the make part, I get lots of "warning: initialization from incompatible
pointer type" -- not sure if this is fatal, but it doesn't look good.
It installs nicely in /usr/bin/nasm
xvid
I then return to xvid. I changed LIBDIR = /usr/local/lib to LIBDIR =
/usr/lib in Makefile.linux and in Makefile -- and this time it built!
So my nasm was tolerable. xvid generated libxvidcore.so and put it in
/usr/lib.
Fame, libfame
I then got libfame CVS version 0.8.10, a real-time MPEG-1/MPEG-4 encoder,
at
http://fame.sourceforge.net/ or http://sourceforge.net/projects/fame --
realtime
MPEG-4?
Anyway,
cvs -d:pserver:anonymous@cvs.fame.sourceforge.net:/cvsroot/fame login
cvs -z3 -d:pserver:anonymous@cvs.fame.sourceforge.net:/cvsroot/fame co
fame
I also get the modules libfame (which must be compiled and installed
first), and
recmpeg.
libfame is a video encoding library. It can currently encode MPEG-1 and
MPEG-4 rectangular video, as well as MPEG-4 video with arbitrary shape.
fame is a multimedia encoder, which captures video from a video4linux
device, and optionally sound, for MPEG encoding. It is based on libfame
and lame and thus supports the same output formats as these two libraries.
recmpeg is a simple video encoder, based on libfame, which compresses
raw video sequences to MPEG video.
libfame configure fine.
I had to run autoconf to make fame configure, as the existing configure
file didn't work.
recmpeg has a file missing and won't compile at all.
ImageMagick
I then went to get ImageMagick at http://www.imagemagick.org/ -- there's
a cvs
cvs -d :pserver:anonymous@cvs.simplesystems.org:/cvsroot login
The password is anonymous
cvs -d :pserver:anonymous@cvs.simplesystems.org:/cvsroot co -P ImageMagick
ImageMagick is configured as follows. Please verify that this configuration matches your expectations.
Host system type : i686-pc-linux-gnuOption Configure option Configured value ----------------------------------------------------------------- Shared libraries --enable-shared=no no Static libraries --enable-static=yes yes GNU ld --with-gnu-ld=yes yes LZW support --enable-lzw=no no 16 bit pixels --enable-16bit-pixel=yes yes
Delegate Configuration: BZLIB --with-bzlib=yes yes DPS --with-dps=yes yes FlashPIX --with-fpx=yes no FreeType 2.0 --with-ttf=yes no (failed tests) Ghostscript None /usr/bin/gs Ghostscript fonts --with-gs-font-dir=default /usr/share/ghostscript/fonts Ghostscript lib --with-gslib=yes no HDF --with-hdf=no no JBIG --with-jbig=yes no JPEG v1 --with-jpeg=yes yes JPEG v2 --with-jp2=yes yes LCMS --with-lcms=yes yes MPEG v2 --with-mpeg2=yes no Magick++ --with-magick-plus-plus=yes yes PERL --with-perl=yes /usr/bin/perl PNG --with-png=yes yes TIFF --with-tiff=yes yes Windows fonts --with-windows-font-dir= none WMF --with-wmf=yes no X11 --with-x= yes XML --with-xml=yes yes ZLIB --with-zlib=yes yes X11 Configuration: X_CFLAGS = -I/usr/X11R6/include X_PRE_LIBS = -lSM -lICE X_LIBS = -L/usr/X11R6/lib X_EXTRA_LIBS = Options used to compile and link: CC = gcc CFLAGS = -g -O2 -Wall CPPFLAGS = -D_REENTRANT -D_FILE_OFFSET_BITS=64 -I/usr/X11R6/include -I/usr/X11R6/include/X11 CXX = g++ CXXFLAGS = -g -O2 LDFLAGS = -L/usr/X11R6/lib -L/usr/lib LIBS = -llcms -ltiff -ljasper -ljpeg -lpng -ldpstk -ldps -lXext -lXt -lSM -lICE -lX11 -lbz2 -lxml2 -lz -lpthread -lm
So I see MPEG2 is missing -- their homepage is at http://mpeg.openprojects.net/
-- he says, My mpeg2 software player enhancements have been integrated
into LiVID Full framerate DVD playback is now possible on a dual PIII500.
His latest Linux driver for Stradis Professional MPEG-2 4:2:2 Decoder
card is now included in the kernel.
The LiVID project is at http://www.linuxvideo.org/
-- the site is not accessible and I should stop now.
Freetype2
Well, there's also Freetype 2 -- I get the tarball 2.1.0 from
http://sourceforge.net/project/showfiles.php?group_id=3157
I did
- make setup CFG="--prefix=/usr"
- make
- make install
It was uneventful. I did make clean.
ImageMagick
I then returned to ImageMagick and got this:
ImageMagick is configured as follows. Please verify that this
configuration matches your expectations.
Host system type : i686-pc-linux-gnu
Option Configure option Configured value
-----------------------------------------------------------------
Shared libraries --enable-shared=yes yes
Static libraries --enable-static=no no
GNU ld --with-gnu-ld=yes yes
LZW support --enable-lzw=yes yes
16 bit pixels --enable-16bit-pixel=yes yes
Delegate Configuration:
BZLIB --with-bzlib=yes yes
DPS --with-dps=yes yes
FlashPIX --with-fpx=yes no
FreeType 2.0 --with-ttf=yes yes
Ghostscript None /usr/bin/gs
Ghostscript fonts --with-gs-font-dir=default /usr/share/ghostscript/fonts
Ghostscript lib --with-gslib=yes no
HDF --with-hdf=no no
JBIG --with-jbig=yes no
JPEG v1 --with-jpeg=yes yes
JPEG v2 --with-jp2=yes yes
LCMS --with-lcms=yes yes
MPEG v2 --with-mpeg2=yes no
Magick++ --with-magick-plus-plus=yes yes
PERL --with-perl=yes /usr/bin/perl
PNG --with-png=yes yes
TIFF --with-tiff=yes yes
Windows fonts --with-windows-font-dir= none
WMF --with-wmf=yes no
X11 --with-x= yes
XML --with-xml=yes yes
ZLIB --with-zlib=yes yes
X11 Configuration:
X_CFLAGS = -I/usr/X11R6/include
X_PRE_LIBS = -lSM -lICE
X_LIBS = -L/usr/X11R6/lib
X_EXTRA_LIBS =
Options used to compile and link:
CC = gcc
CFLAGS = -g -O2 -Wall
CPPFLAGS = -D_REENTRANT -D_FILE_OFFSET_BITS=64 -I/usr/X11R6/include
-I/usr/X11R6/include/X11
-I/usr/include/freetype2
CXX = g++
CXXFLAGS = -g -O2
LDFLAGS = -L/usr/X11R6/lib -L/usr/lib -L/usr/lib
LIBS = -llcms -ltiff -lfreetype -ljasper -ljpeg -lpng -ldpstk -ldps
-lXext -lXt
-lSM -lICE -lX11 -lbz2 -lxml2 -lz -lpthread -lm
I had to run ./configure like this:
./configure --enable-shared=yes --enable-static=no --enable-lzw=yes
and Freetype2 is included! Mpeg2 is not, but what can I do. I compile
and install ImageMagick -- a huge compilation job -- and then
Transcode
I return to Transcode and it finds it:
----------------------------------------------------------
Summary for transcode 0.6.0 features:
static AV-frame buffering yes
DVD navigation with libdvdread yes
link against local lame library (>=3.89) yes
support for net streams yes
avifile dependent modules | avifile-0.6 support yes | yes
libmpeg3 dependent modules no
quicktime dependent modules no
libdv dependent modules yes
liba52 audio plugin (>=0.7.3) | default decoder yes | no
libfame video encoding plugin yes
nasm dependent modules yes
ImageMagick dependent modules (>=5.4.3) yes
libxml2 dependent import modules yes
mjpegtools dependent export modules no
experimental v4l support yes
X11 dependent filter plugins yes
MPlayer libpostproc dependent filter plugin no
----------------------------------------------------------
Anyway, this is getting there. I'll now use cfdisk to get the Linux from
scratch partition back to the main partition, as I'm running out of space
on it.
gubbio:~ # uname -a
Linux gubbio 2.4.16 #2 Mon May 27 12:09:52 PDT 2002 i686 unknown
Someone writes,
"If you would like to merge avi-files together then tools/avimerge
can do it for you..."
/wojci
The long encoding: 12GB input file
I've just run transcode on a 12GB avi file, grabbed from a camcorder
with dvgrab -format dv2. Here are the details:
Input file: 12430350904 May 23 16:38 test_001.avi
Command: transcode -i *001.avi -I 3 -C 2 -z -k -o encode/001.avi -y divx5
Screen output:
transcode v0.6.0pre5 (C) 2001-2002 Thomas Östreich
[transcode] auto-probing source test_001.avi (ok)
[transcode] V: import format | Digital Video RIFF data, AVI (V=dv|A=avi)
[transcode] V: import frame | 720x480 1.50:1
[transcode] V: de-interlace | (mode=3) zoom to full frame (slow)
[transcode] V: flip frame | yes
[transcode] V: rgb2bgr | yes
[transcode] V: anti-alias | (mode=2|0.33|0.50) resize effects only
[transcode] V: encoding fps | 29.971
[transcode] A: import format | 0x1 PCM [32000,16,2] 1024 kbps
[transcode] A: export format | 0x55 MPEG layer-3 [32000,16,2] 128 kbps
[transcode] A: bytes per frame | 4272 (4270.848000)
[transcode] A: adjustment | -1152@1000
[import_avi.so] v0.4.1 (01/29/02) (video) * | (audio) *
[import_dv.so] v0.2.6 (11/08/01) (video) DV | (audio) PCM
[export_divx5.so] v0.1.2 (05/05/02) (video) DivX 5.xx | (audio) MPEG/AC3/PCM
[import_avi.so] format=0x1, rate=32000 Hz, bits=16, channels=2, bitrate=1024
[import_dv.so] tcextract -x dv -i "test_001.avi" -d 0 | tcdecode
-x dv -y rgb -d 0 -Q 5
(aud_aux.c) using lame-3.93 (alpha 2, May 31 2002 16:26:57)
filling buffer ... done
encoding frames [0000000-090000], 2.20 fps, (9| 1| 0)
It looks like it will be able to handle the whole 12GB file, albeit slowly.
|