From: Davey on
On Sun, 25 Apr 2010 21:18:27 +0100
Andy Furniss <spam(a)andyfurniss.entadsl.com> wrote:

> Davey wrote:
>
> >> mplayer -vo xv:adaptor=1 tv:// -tv
> >> driver=v4l2:norm=NTSC:buffersize=64:device=/dev/video0:audiorate=48000:immediatemode=0:forceaudio:adevice=/dev/dsp1
> >>
> > Couldn't get that to work, it didn't like anything after the "xv",
> > and I couldn't find any other way of switching the video mode to
> > textured.
>
> Oh well, I guess it doesn't matter anyway - if your main use will be
> to record with mencoder. You could also have used
> -vo xv:port=
> and used the first port number xvinfo shows for textured vid.
>
> >
> > I tried some other stuff, but it either made no difference, or
> > caused crashes! If you have any other ideas, they would be welcome
> > Currently using:
> > mplayer -vo xv tv:// -tv
> > driver=v4l2:norm=NTSC:device=/dev/video0:audiorate=48000:immediatemode=0:forceaudio:adevice=/dev/dsp1:volume=2000
>
> If it keeps running with this, then maybe trying to capture with
> mwncoder would be the best thing to try next.
>
> I tested one pass encoding with a short raw vid file and it's a lot
> better than the windows quality wise - but maybe a bit borderline for
> Cpu.
>
> mjpeg gives really nice results with low CPU usage but makes for big
> files - but that's OK as an intermediate format to code to mpeg2
> after the capture.
>
> If you are going to make mpeg2, then you can save a bit of USB
> bandwidth by using a different raw format that uses the same type
> (4:2:0) as mpeg will. Also if DVD is your target then you need to get
> the dazzle to output 720x480. I would try as a test -
>
> mencoder -vf harddup -of lavf -oac pcm -ovc lavc -lavcopts
> vcodec=mjpeg -ofps 30000/1001 -o outfilename.avi tv:// -tv
> driver=v4l2:norm=NTSC:device=/dev/video0:width=720:height=480:outfmt=yv12:audiorate=48000:immediatemode=0:forceaudio:adevice=/dev/dsp1:volume=2000
>
> Are you planning to make "real" DVDs to play on a standalone player -
> or just wanting to make files to burn to a dvd and play on a computer?

Now this is getting better!
Successfully recorded a 30 second file, plays back with good sound,
too. The problem is still the massive flickering of the picture, as
though its trying to play the next frame before it has finished
displaying the last one.

Here is a portion of the terminal output:
Starts with:
MEncoder 2:1.0~rc2-0ubuntu19 (C) 2000-2007 MPlayer Team
CPU: Mobile Intel(R) Pentium(R) 4 CPU 3.06GHz (Family: 15, Model:
2, Stepping: 9) CPUflags: Type: 15 MMX: 1 MMX2: 1 3DNow: 0 3DNow2: 0
SSE: 1 SSE2: 1 Compiled with runtime CPU detection.
success: format: 9 data: 0x0 - 0x0
TV file format detected.
Selected driver: v4l2
name: Video 4 Linux 2 input
author: Martin Olschewski <olschewski(a)zpr.uni-koeln.de>
comment: first try, more to come ;-)
Selected device: Pinnacle Dazzle DVC 90/DVC 100
Capabilites: video capture audio read/write streaming
supported norms: 0 = NTSC; 1 = NTSC-M; 2 = NTSC-M-JP; 3 = NTSC-M-KR; 4
= NTSC-443; 5 = PAL; 6 = PAL-BG; 7 = PAL-H; 8 = PAL-I; 9 = PAL-DK; 10 =
PAL-M; 11 = PAL-N; 12 = PAL-Nc; 13 = PAL-60; 14 = SECAM; 15 = SECAM-B;
16 = SECAM-G; 17 = SECAM-H; 18 = SECAM-DK; 19 = SECAM-L; 20 = SECAM-Lc;
inputs: 0 = Composite1; 1 = S-Video; Current input: 0 Current format:
YUYV Selected input hasn't got a tuner! [V] filefmt:9
fourcc:0x32595559 size:720x480 fps:29.97 ftime:=0.0334
==========================================================================
Opening audio decoder: [pcm] Uncompressed PCM audio decoder AUDIO:
48000 Hz, 2 ch, s16le, 1536.0 kbit/100.00% (ratio: 192000->192000)
Selected audio codec: [pcm] afm: pcm (Uncompressed PCM)
==========================================================================
** MUXER_LAVF
*****************************************************************
REMEMBER: MEncoder's libavformat muxing is presently broken and can
generate INCORRECT files in the presence of B frames. Moreover, due to
bugs MPlayer will play these INCORRECT files as if nothing were wrong!
*******************************************************************************
OK, exit Opening video filter: [expand osd=1] Expand: -1 x -1, -1 ; -1,
osd: 1, aspect: 0.000000, round: 1 Opening video filter: [harddup]
==========================================================================
Opening video decoder: [raw] RAW Uncompressed Video
VDec: vo config request - 720 x 480 (preferred colorspace: Packed YUY2)
Could not find matching colorspace - retrying with -vf scale...
Opening video filter: [scale]
VDec: using Packed YUY2 as output csp (no 0)
Movie-Aspect is undefined - no prescaling applied.
SwScaler: reducing / aligning filtersize 1 -> 4
SwScaler: reducing / aligning filtersize 1 -> 4
SwScaler: reducing / aligning filtersize 1 -> 1
SwScaler: reducing / aligning filtersize 9 -> 8
[swscaler @ 0x883d3d0]SwScaler: BICUBIC scaler, from yuyv422 to yuv420p
using MMX2 [swscaler @ 0x883d3d0]SwScaler: using 4-tap MMX scaler for
horizontal luminance scaling [swscaler @ 0x883d3d0]SwScaler: using
4-tap MMX scaler for horizontal chrominance scaling [swscaler @
0x883d3d0]SwScaler: using 1-tap MMX "scaler" for vertical scaling (YV12
like) [swscaler @ 0x883d3d0]SwScaler: 720x480 -> 720x480 videocodec:
libavcodec (720x480 fourcc=47504a4d [MJPG]) Selected video codec:
[rawyuy2] vfm: raw (RAW YUY2)
==========================================================================
Forcing audio preload to 0, max pts correction to 0. VIDEO CODEC ID:
81f ( 0%) 0.00fps Trem: 0min 0mb A-V:0.000 [0:0] AUDIO CODEC ID:
10000, TAG: 0 Writing header...
--------------------------------------------------------------------------------
Here is a portion, showing duplicates and skips:

Pos: 5.4s 164f ( 0%) 24.37fps Trem: 0min 0mb A-V:0.000
[9200:1536] Skipping frame!
Pos: 5.4s 166f ( 0%) 24.45fps Trem: 0min 0mb A-V:0.000
[9211:1536] 1 duplicate frame(s)!
Pos: 5.5s 168f ( 0%) 24.33fps Trem: 0min 0mb A-V:0.000
[9212:1536] 1 duplicate frame(s)!
Pos: 5.6s 170f ( 0%) 24.29fps Trem: 0min 0mb A-V:0.000
[9146:1536] 1 duplicate frame(s)!
Pos: 5.7s 172f ( 0%) 24.18fps Trem: 0min 0mb A-V:0.000
[9129:1536] 1 duplicate frame(s)!
Pos: 5.8s 173f ( 0%) 24.12fps Trem: 0min 0mb A-V:0.000
[9103:1536] 1 duplicate frame(s)!
Pos: 6.1s 180f ( 0%) 24.22fps Trem: 0min 0mb A-V:0.000
[9116:1536] 1 duplicate frame(s)!
Pos: 6.3s 185f ( 0%) 24.27fps Trem: 0min 0mb A-V:0.000
[9149:1536] Skipping frame!
Pos: 6.3s 186f ( 0%) 24.39fps Trem: 0min 0mb A-V:0.000
[9149:1536] Skipping frame!
Pos: 6.3s 188f ( 0%) 24.50fps Trem: 0min 0mb A-V:0.000
[9170:1536] Skipping frame!
Pos: 6.3s 190f ( 0%) 24.57fps Trem: 0min 0mb A-V:0.000
[9152:1536] Skipping frame!

------------------------------------------------------------------------

And the end when I stop it with Cntrl-C:
Pos: 31.7s 956f ( 0%) 26.22fps Trem: 0min 0mb A-V:0.000
[11991:1536] Skipping frame!
^CPos: 31.8s 958f ( 0%) 26.23fps Trem: 0min 0mb A-V:0.000
[11997:1536] Flushing video frames.
Writing index...

Video stream: 11997.814 kbit/s (1499726 B/s) size: 47638922 bytes
31.765 secs 958 frames

Audio stream: 1536.000 kbit/s (192000 B/s) size: 6144000 bytes
32.000 secs v4l2: 1102 frames successfully processed, -6 frames dropped.
david(a)david-laptop:~$ ls

The command used is:
mencoder -vf harddup -of lavf -oac pcm -ovc lavc -lavcopts vcodec=mjpeg
-ofps 30000/1001 -o testfilename.avi tv:// -tv
driver=v4l2:norm=NTSC:device=/dev/video0:width=720:height=480:outfmt=yv12:audiorate=48000:immediatemode=0:forceaudio:adevice=/dev/dsp1:volume=2000

Any ideas how to reduce the flickering? But this is a major advance!
Thanks.

--
Davey.
From: Andy Furniss on
Davey wrote:

> Now this is getting better!
> Successfully recorded a 30 second file, plays back with good sound,
> too. The problem is still the massive flickering of the picture, as
> though its trying to play the next frame before it has finished
> displaying the last one.

Looks like there is some confusion about framerates - I don't really
know why.


> fourcc:0x32595559 size:720x480 fps:29.97 ftime:=0.0334

29.97 here

> VDec: using Packed YUY2 as output csp (no 0)
> Movie-Aspect is undefined - no prescaling applied.
> SwScaler: reducing / aligning filtersize 1 -> 4
> SwScaler: reducing / aligning filtersize 1 -> 4
> SwScaler: reducing / aligning filtersize 1 -> 1
> SwScaler: reducing / aligning filtersize 9 -> 8
> [swscaler @ 0x883d3d0]SwScaler: BICUBIC scaler, from yuyv422 to yuv420p
> using MMX2 [swscaler @ 0x883d3d0]SwScaler: using 4-tap MMX scaler for
> horizontal luminance scaling [swscaler @ 0x883d3d0]SwScaler: using
> 4-tap MMX scaler for horizontal chrominance scaling [swscaler @
> 0x883d3d0]SwScaler: using 1-tap MMX "scaler" for vertical scaling (YV12
> like) [swscaler @ 0x883d3d0]SwScaler: 720x480 -> 720x480 videocodec:
> libavcodec (720x480 fourcc=47504a4d [MJPG]) Selected video codec:
> [rawyuy2] vfm: raw (RAW YUY2)

Looks like the yv12 request isn't working/supported as it's still
outputting yuy2 which mencoder is converting for you.

If the material is interlaced you should tell it, as there will be
subtle colour errors otherwise. So instead of -vf harddup use

-vf scale=-1:-1:1,harddup


> Here is a portion, showing duplicates and skips:
>
> Pos: 5.4s 164f ( 0%) 24.37fps Trem: 0min 0mb A-V:0.000
> [9200:1536] Skipping frame!
> Pos: 5.4s 166f ( 0%) 24.45fps Trem: 0min 0mb A-V:0.000
> [9211:1536] 1 duplicate frame(s)!
> Pos: 5.5s 168f ( 0%) 24.33fps Trem: 0min 0mb A-V:0.000
> [9212:1536] 1 duplicate frame(s)!

This I don't get - It looks like the Dazzle is outputting 25fps and
since mencoder thinks the fps should be 29.97 it is adding frames to
correct it.

Why would NTSC be 25 fps though.

Is it possible that the input to the Dazzle is not using NTSC ?

Maybe if top shows you have run out of CPU that could be it - but it
would be a bit too much of a co-incidence to get this output (it's
normal for mencoder to show a bit below 25 especially early on in a run).

You could try in you mencoder command using fps=25 instead of 30000/1001
alternately you could add to the tv:// part of the command line
:fps=30000/1001: and leave the fps=30000/1001 as it is is the mencoder part.

From: Davey on
On Sat, 01 May 2010 14:02:48 +0100
Andy Furniss <spam(a)andyfurniss.entadsl.com> wrote:

> Davey wrote:
>
> > Now this is getting better!
> > Successfully recorded a 30 second file, plays back with good sound,
> > too. The problem is still the massive flickering of the picture, as
> > though its trying to play the next frame before it has finished
> > displaying the last one.
>
> Looks like there is some confusion about framerates - I don't really
> know why.
>
>
> > fourcc:0x32595559 size:720x480 fps:29.97 ftime:=0.0334
>
> 29.97 here
>

I may be way off base here, but US power is at 50 Hz instead of UK 60.
Any relationship?

> > VDec: using Packed YUY2 as output csp (no 0)
> > Movie-Aspect is undefined - no prescaling applied.
> > SwScaler: reducing / aligning filtersize 1 -> 4
> > SwScaler: reducing / aligning filtersize 1 -> 4
> > SwScaler: reducing / aligning filtersize 1 -> 1
> > SwScaler: reducing / aligning filtersize 9 -> 8
> > [swscaler @ 0x883d3d0]SwScaler: BICUBIC scaler, from yuyv422 to
> > yuv420p using MMX2 [swscaler @ 0x883d3d0]SwScaler: using 4-tap MMX
> > scaler for horizontal luminance scaling [swscaler @
> > 0x883d3d0]SwScaler: using 4-tap MMX scaler for horizontal
> > chrominance scaling [swscaler @ 0x883d3d0]SwScaler: using 1-tap MMX
> > "scaler" for vertical scaling (YV12 like) [swscaler @
> > 0x883d3d0]SwScaler: 720x480 -> 720x480 videocodec: libavcodec
> > (720x480 fourcc=47504a4d [MJPG]) Selected video codec: [rawyuy2]
> > vfm: raw (RAW YUY2)
>
> Looks like the yv12 request isn't working/supported as it's still
> outputting yuy2 which mencoder is converting for you.
>
> If the material is interlaced you should tell it, as there will be
> subtle colour errors otherwise. So instead of -vf harddup use
>
> -vf scale=-1:-1:1,harddup
>

Will try that.

>
> > Here is a portion, showing duplicates and skips:
> >
> > Pos: 5.4s 164f ( 0%) 24.37fps Trem: 0min 0mb A-V:0.000
> > [9200:1536] Skipping frame!
> > Pos: 5.4s 166f ( 0%) 24.45fps Trem: 0min 0mb A-V:0.000
> > [9211:1536] 1 duplicate frame(s)!
> > Pos: 5.5s 168f ( 0%) 24.33fps Trem: 0min 0mb A-V:0.000
> > [9212:1536] 1 duplicate frame(s)!
>
> This I don't get - It looks like the Dazzle is outputting 25fps and
> since mencoder thinks the fps should be 29.97 it is adding frames to
> correct it.
>
> Why would NTSC be 25 fps though.
>
> Is it possible that the input to the Dazzle is not using NTSC ?

It is a US-spec. VHS Player, using the phono plug line outputs, so it
must be NTSC. And it was a year ago, when I used the same hardware, but
with a better PC, with Win XP, to go directly to DVD.

>
> Maybe if top shows you have run out of CPU that could be it - but it
> would be a bit too much of a co-incidence to get this output (it's
> normal for mencoder to show a bit below 25 especially early on in a
> run).
>
> You could try in you mencoder command using fps=25 instead of
> 30000/1001 alternately you could add to the tv:// part of the command
> line :fps=30000/1001: and leave the fps=30000/1001 as it is is the
> mencoder part.
>
I agree, they sound worth a try.

Again, I will post the result of the next attempt.

Thanks for the help.

--
Davey.

From: Geoff Clements on
Davey wrote:

> On Sat, 01 May 2010 14:02:48 +0100
> Andy Furniss <spam(a)andyfurniss.entadsl.com> wrote:
>

>
> I may be way off base here, but US power is at 50 Hz instead of UK 60.

Europe, including UK is 50Hz, USA is 60Hz.

--
Geoff
From: Davey on
On Sat, 01 May 2010 17:52:30 +0100
Geoff Clements <bitbucket(a)electron.me.uk> wrote:

> Davey wrote:
>
> > On Sat, 01 May 2010 14:02:48 +0100
> > Andy Furniss <spam(a)andyfurniss.entadsl.com> wrote:
> >
>
> >
> > I may be way off base here, but US power is at 50 Hz instead of UK
> > 60.
>
> Europe, including UK is 50Hz, USA is 60Hz.
>

Sorry, got it backwards.
Oh well, there goes that theory.
--
Davey.