Steven M. Schultz wrote:
On Mon, 19 Dec 2005, sean wrote:
Actually, it seems I made that up. I did capture with dv2.
Hard enough debugging problems without "creative writing" in the
bug report :-)
So why's lav2wav busting my chops :)
Don't know. I've never used the lav* programs with DV data - the DV
handling is less well developed than it could be.
OK. I'll get cvs.
What version were you using? The 1.8.0 that came out a while back?
If I get this correctly, DV ( NTSC? ) records video 4:1:1.
Correct. However "libdv" (which is what mjpegtools/lav* uses to
process DV data) mangles the data into 4:2:2 using a suboptimal
superscaling technique (replicates the chroma samples). Then later
on that 4:2:2 data gets converted (haven't looked at the code that
handles that - I think Matt did it and if so it's doing the best it
can with the 4:2:2 data).
dvd mjepg2 is 4:2:0. So my present command "lav2yuv -C 422 |
^
|
mpeg2 :)
yuvdenoise | y4mscaler -O preset=dvd | mpeg2enc ...." -
which is the result of an info mesage from lav2yuv -
upsamples the dv stream - a Bad Idea.
It is necessary to re-sample from 4:1:1 to 4:2:0 (which means super
sampling horizontally but sub-sampling vertically) but the way libdv
does it (which is what the "-C 422" is doing) is not correct.
The video processing should be working ok. It's the audio processing
(lav2wav) that was having problems - and for that I don't know what's
going on.
Where does it go to 4:2:0? mpeg2enc? Or does y4mscaler take care of it?
y4mscaler's taking care of it - part of the "preset=DVD"
What you'll be able to do with the cvs version is something like:
lav2yuv -C 411 file | yuvdenoise | y4mscaler -O preset=DVD | mpeg2enc ...
as a side note 'yuvdenoise' has seen a lot of work (improvements) since
the last release so you'll get the benefit of that as well.
For DV handling ffmpeg's libavcodec has a much better DV decoder
than libdv. Not sure anyone's got the inclination to replace 'libdv'
with 'libavcodec' in mjpegtools though.
Building the smilutils (need the cvs version, not the old 0.3.x
releases you'll find around the net) with ffmpeg's libavcodec
is straightforward. That gives you 'smil2yuv' and 'smil2wav' (counter-
parts to lav2yuv and lav2wav) which are much more at ease with DV
data. The above command undergoes a simple transformation into:
smil2yuv -a output.wav -i 2 file | yuvdenoise | ...
(gives the video on stdout and creates the wave file in one command)
The other thing which just occurred to me is that if you have
libquicktime built with ffmpeg's codecs then the new 'qttoy4m' program
should be able to (never been tested) process Quicktime files
containing DV data. Only thing I've tested qttoy4m and y4mtoqt with
has been uncompressed formats ('2vuy' and 'v210').
Have Fun!
Well,not yet.
I got 12/19 cvs. Built that with gcc-4.1.
1. Region2D.hh needs an #include <cassert>
that was easy;
Then I re-dvgrab'ed the tape --format raw.
When I ran it I got a segfault for mpeg2enc.
Here's the script I'm using:
#!/bin/sh
smil2yuv -i 2 moontrap-raw/dv/moontrap-001.dv |
yuvdenoise | \
y4mscaler -O preset=dvd | \
mpeg2enc -D 10 -f 8 -q 5 -E -10 -4 1 -2 1 -o moontrap.m2v
and here's the output:
sh -x test.raw
+ smil2yuv -i 2 moontrap-raw/dv/moontrap-001.dv
+ yuvdenoise
INFO: [yuvdenoise]
-----------------------------------------------------
INFO: [yuvdenoise] mjpeg-tools yuvdenoise version 1.9.0
INFO: [yuvdenoise]
-----------------------------------------------------
INFO: [yuvdenoise] Using the following thresholds:
INFO: [yuvdenoise] 3D-Median-Filter [Y,U,V] : [2,4,4]
INFO: [yuvdenoise] Spatial-Noise-Filter [Y,U,V] : [2,4,4]
INFO: [yuvdenoise] Gauss-Lowpass-Filter [Y,U,V] :
[32,255,255]
INFO: [yuvdenoise] Temporal-Noise-Filter [Y,U,V] : [4,8,8]
INFO: [yuvdenoise] Renoise [Y,U,V] : [0,0,0]
+ y4mscaler -O preset=dvd
+ mpeg2enc -D 10 -f 8 -q 5 -E -10 -4 1 -2 1 -o moontrap.m2v
INFO: [mpeg2enc] SETTING EXTENDED MMX for MOTION!
INFO: [mpeg2enc] SETTING SSE and MMX for TRANSFORM!
INFO: [mpeg2enc] SETTING EXTENDED MMX for PREDICTION!
INFO: [yuvdenoise] Y4M-Stream 720x480(4:1:1 (horiz.
cositing))
INFO: [yuvdenoise] Processing Mode : 4:1:1 interlaced
INFO: [yuvdenoise] Luma-Plane : 720x480 pixels
INFO: [yuvdenoise] Chroma-Plane : 180x480 pixels
INFO: [yuvdenoise] Buffers allocated.
INFO: [yuvdenoise] SETTING EXTENDED MMX for MOTION!
INFO: [yuvdenoise] 16-Bit gamma-transformations
initialized...
INFO: [y4mscaler] Input Stream Header:
INFO: [y4mscaler] <<< frame size: 720x480 pixels
(518400 bytes)
INFO: [y4mscaler] <<< chroma: 4:1:1 (horiz. cositing)
INFO: [y4mscaler] <<< frame rate: 30000/1001 fps
(~29.970030)
INFO: [y4mscaler] <<< interlace: bottom-field-first
INFO: [y4mscaler] <<< sample aspect ratio: 10:11
INFO: [y4mscaler] DVD output format requested in NTSC norm.
INFO: [y4mscaler] Source matte region defaulting to full
source frame.
INFO: [y4mscaler] Source active region defaulting to
full source frame.
INFO: [y4mscaler] Target interlacing defaulting to match
source.
INFO: [y4mscaler] Target active region defaulting to
full target frame.
INFO: [y4mscaler] Deriving ratios from active regions
and SARs...
INFO: [y4mscaler] ...using scaling ratios which pad target.
INFO: [y4mscaler] ...using scaling ratios which are simple.
INFO: [y4mscaler] === SOURCE parameters: =================
INFO: [y4mscaler] < stream:
INFO: [y4mscaler] < 720x480, SAR 10:11, bottom-field-first
INFO: [y4mscaler] < chroma subsampling: 4:1:1 (horiz.
cositing)
INFO: [y4mscaler] < chroma ss ratios: x 1:4 y 1:1
INFO: [y4mscaler] < active region:
INFO: [y4mscaler] < 720.000000x480.000000 at
0.000000,0.000000
INFO: [y4mscaler] < matte region:
INFO: [y4mscaler] < 720x480 at 0,0 (bg Y'CbCr:
16,128,128)
INFO: [y4mscaler] === SCALING parameters: ================
INFO: [y4mscaler] | Scaler: Matto's Generic Scaler
INFO: [y4mscaler] | kernels: cubicK4, cubicK4
INFO: [y4mscaler] === TARGET parameters: =================
INFO: [y4mscaler] > stream:
INFO: [y4mscaler] > 720x480, SAR 10:11, bottom-field-first
INFO: [y4mscaler] < chroma subsampling: 4:2:0 MPEG-2
(horiz. cositing)
INFO: [y4mscaler] < chroma ss ratios: x 1:2 y 1:2
INFO: [y4mscaler] > active region:
INFO: [y4mscaler] > 720x480 at 0,0 (bg Y'CbCr:
16,128,128)
INFO: [y4mscaler] > X ratio: 1/1
INFO: [y4mscaler] > Y ratio: 1/1
INFO: [mpeg2enc] Selecting DVD with dummy navigation
packets output profile
INFO: [mpeg2enc] Assuming norm NTSC
INFO: [mpeg2enc] Interlaced input - selecting interlaced
encoding.
INFO: [mpeg2enc] Encoding MPEG-2 video to moontrap.m2v
INFO: [mpeg2enc] Horizontal size: 720 pel
INFO: [mpeg2enc] Vertical size: 480 pel
INFO: [mpeg2enc] Aspect ratio code: 2 = 4:3 display
INFO: [mpeg2enc] Frame rate code: 4 = 30000.0/1001.0
(NTSC VIDEO)
INFO: [mpeg2enc] Bitrate: 7500 KBit/s
INFO: [mpeg2enc] Quality factor: 5 (Quantisation = 5)
(1=best, 31=worst)
INFO: [mpeg2enc] Field order for input: bottom-field-first
INFO: [mpeg2enc] Sequence unlimited length
INFO: [mpeg2enc] Search radius: 16
INFO: [mpeg2enc] DualPrime: no
INFO: [mpeg2enc] Using one-pass rate controller
INFO: [mpeg2enc] GOP SIZE RANGE 7 TO 15
INFO: [mpeg2enc] Setting colour/gamma parameters to "NTSC"
INFO: [mpeg2enc] Progressive format frames = 0
INFO: [mpeg2enc] Using default unmodified quantization
matrices
INFO: [mpeg2enc] SETTING MMX and MMX for QUANTIZER!
INFO: [mpeg2enc] NEW GOP INIT length 15
INFO: [y4mscaler] Output Stream Header:
INFO: [y4mscaler] >>> frame size: 720x480 pixels
(518400 bytes)
INFO: [y4mscaler] >>> chroma: 4:2:0 MPEG-2
(horiz. cositing)
INFO: [y4mscaler] >>> frame rate: 30000/1001 fps
(~29.970030)
INFO: [y4mscaler] >>> interlace: bottom-field-first
INFO: [y4mscaler] >>> sample aspect ratio: 10:11
INFO: [y4mscaler] Frame number 0
INFO: [y4mscaler] Frame number 1
INFO: [y4mscaler] Frame number 2
test.raw: line 6: 31236 Broken pipe smil2yuv -i
2 moontrap-raw/dv/moontrap-001.dv
31237 | yuvdenoise
31238 | y4mscaler -O preset=dvd
31240 Segmentation fault | mpeg2enc -D 10 -f 8 -q
5 -E -10 -4 1 -2 1 -o moontrap.m2v
sean
-------------------------------------------------------
This SF.net email is sponsored by: Splunk Inc. Do you grep through log files
for problems? Stop! Download the new AJAX search engine that makes
searching your log files as easy as surfing the web. DOWNLOAD SPLUNK!
http://ads.osdn.com/?ad_id=7637&alloc_id=16865&op=click
_______________________________________________
Mjpeg-users mailing list
Mjpeg-users@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/mjpeg-users