[FFmpeg-user] Grabbing quality from TV card

Rodney Baker rodney.baker at iinet.net.au
Wed Mar 14 15:24:06 CET 2012


On Wed, 14 Mar 2012 06:25:12 tovis wrote:
> Hi Rodney!
> Much better, but not good enough :(

At least we're making progress. :-)

> Quality is still wrong, does not change against the very old Debianized
> version. On time I have a lot of error messages:
> $ ffmpeg -v verbose -f video4linux2 -i /dev/video0 -s 640x480 -r 25
> out10.avi 2>&1 | tee ffmpeg-grab.log

OK - you're setting the output size to 640x480 but...
> 
> The log looks like this:
> ffmpeg version N-38750-g599888a Copyright (c) 2000-2012 the FFmpeg
> developers built on Mar 12 2012 23:50:31 with gcc 4.4.5
>   configuration: --enable-nonfree --enable-libv4l2
>   libavutil      51. 42.100 / 51. 42.100
>   libavcodec     54. 10.100 / 54. 10.100
>   libavformat    54.  2.100 / 54.  2.100
>   libavdevice    53.  4.100 / 53.  4.100
>   libavfilter     2. 64.101 /  2. 64.101
>   libswscale      2.  1.100 /  2.  1.100
>   libswresample   0.  7.100 /  0.  7.100
> [video4linux2,v4l2 @ 0x30f13e0] [3]Capabilities: 5010015
> [video4linux2,v4l2 @ 0x30f13e0] Querying the device for the current frame
> size
> [video4linux2,v4l2 @ 0x30f13e0] Setting frame size to 320x240

...the input is recognised as 320x240. Is this correct? If so, you're scaling 
up the input which means you're interpolating a lot of pixels which will, in 
turn, reduce the quality considerably.


I don't know about the "Resource temporarily unavailable" errors - perhaps 
Carl Eugen (or one of the other devs) may have an idea. I'd try Carl's 
suggestion re yadif too - if you have an interlaced source you probably want 
to run it through the deinterlace filter. 


> libv4l2: error dequeuing buf: Resource temporarily unavailable
>   -- repeated 1174 times --
> libv4l2: error dequeuing buf: Resource temporarily unavailable
> [video4linux2,v4l2 @ 0x30f13e0] Estimating duration from bitrate, this may
> be inaccurate
> Input #0, video4linux2,v4l2, from '/dev/video0':
>   Duration: N/A, start: 1331666886.562734, bitrate: 23040 kb/s
>     Stream #0:0: Video: rawvideo (I420 / 0x30323449), yuv420p, 320x240,
> 23040 kb/s, 25 tbr, 1000k tbn, 25 tbc
> [buffer @ 0x30f9020] w:320 h:240 pixfmt:yuv420p tb:1/1000000 sar:0/1
> sws_param:
> [scale @ 0x30f6e40] w:320 h:240 fmt:yuv420p -> w:640 h:480 fmt:yuv420p
> flags:0x4
> Output #0, avi, to 'out10.avi':
>   Metadata:
>     ISFT            : Lavf54.2.100
>     Stream #0:0: Video: mpeg4 (FMP4 / 0x34504D46), yuv420p, 640x480,
> q=2-31, 200 kb/s, 25 tbn, 25 tbc
> Stream mapping:
>   Stream #0:0 -> #0:0 (rawvideo -> mpeg4)
> Press [q] to stop, [?] for help
> libv4l2: error dequeuing buf: Resource temporarily unavailable
>   -- repeated 44 times --
> libv4l2: error dequeuing buf: Resource temporarily unavailable
> frame=   18 fps=0.0 q=31.0 size=     183kB time=00:00:00.72
> bitrate=2081.3kbits/s
> libv4l2: error dequeuing buf: Resource temporarily unavailable
>   -- repeated 44 times --
> libv4l2: error dequeuing buf: Resource temporarily unavailable
> frame=   31 fps= 29 q=31.0 size=     202kB time=00:00:01.24
> bitrate=1333.2kbits/s
> libv4l2: error dequeuing buf: Resource temporarily unavailable
>   -- repeated 44 times --
> libv4l2: error dequeuing buf: Resource temporarily unavailable
> frame=   44 fps= 28 q=31.0 size=     220kB time=00:00:01.76
> bitrate=1025.8kbits/s
> libv4l2: error dequeuing buf: Resource temporarily unavailable
>   -- repeated 44 times --
> libv4l2: error dequeuing buf: Resource temporarily unavailable
> frame=   57 fps= 27 q=31.0 size=     239kB time=00:00:02.28 bitrate=
> 858.0kbits/s
> libv4l2: error dequeuing buf: Resource temporarily unavailable
>   -- repeated 44 times --
> libv4l2: error dequeuing buf: Resource temporarily unavailable
> frame=   70 fps= 27 q=31.0 size=     255kB time=00:00:02.80 bitrate=
> 745.1kbits/s
> libv4l2: error dequeuing buf: Resource temporarily unavailable
>   -- repeated 44 times --
> libv4l2: error dequeuing buf: Resource temporarily unavailable
> frame=   83 fps= 26 q=31.0 size=     272kB time=00:00:03.32 bitrate=
> 672.0kbits/s
> libv4l2: error dequeuing buf: Resource temporarily unavailable
>   -- repeated 44 times --
> libv4l2: error dequeuing buf: Resource temporarily unavailable
> frame=   96 fps= 26 q=31.0 size=     290kB time=00:00:03.84 bitrate=
> 619.7kbits/s
> libv4l2: error dequeuing buf: Resource temporarily unavailable
>   -- repeated 44 times --
> libv4l2: error dequeuing buf: Resource temporarily unavailable
> frame=  109 fps= 26 q=24.8 size=     312kB time=00:00:04.36 bitrate=
> 586.2kbits/s
> libv4l2: error dequeuing buf: Resource temporarily unavailable
>   -- repeated 44 times --
> libv4l2: error dequeuing buf: Resource temporarily unavailable
> frame=  122 fps= 26 q=31.0 size=     331kB time=00:00:04.88 bitrate=
> 555.1kbits/s
> libv4l2: error dequeuing buf: Resource temporarily unavailable
>   -- repeated 44 times --
> libv4l2: error dequeuing buf: Resource temporarily unavailable
> frame=  135 fps= 26 q=31.0 size=     349kB time=00:00:05.40 bitrate=
> 530.0kbits/s
> libv4l2: error dequeuing buf: Resource temporarily unavailable
>   -- repeated 44 times --
> libv4l2: error dequeuing buf: Resource temporarily unavailable
> frame=  148 fps= 26 q=31.0 size=     366kB time=00:00:05.92 bitrate=
> 506.9kbits/s
> libv4l2: error dequeuing buf: Resource temporarily unavailable
>   -- repeated 44 times --
> libv4l2: error dequeuing buf: Resource temporarily unavailable
> frame=  161 fps= 26 q=31.0 size=     386kB time=00:00:06.44 bitrate=
> 490.5kbits/s
> libv4l2: error dequeuing buf: Resource temporarily unavailable
>   -- repeated 44 times --
> libv4l2: error dequeuing buf: Resource temporarily unavailable
> frame=  174 fps= 26 q=31.0 size=     403kB time=00:00:06.96 bitrate=
> 474.8kbits/s
> libv4l2: error dequeuing buf: Resource temporarily unavailable
>   -- repeated 44 times --
> libv4l2: error dequeuing buf: Resource temporarily unavailable
> frame=  187 fps= 26 q=31.0 size=     419kB time=00:00:07.48 bitrate=
> 458.5kbits/s
> libv4l2: error dequeuing buf: Resource temporarily unavailable
>   -- repeated 44 times --
> libv4l2: error dequeuing buf: Resource temporarily unavailable
> frame=  200 fps= 26 q=31.0 size=     438kB time=00:00:08.00 bitrate=
> 448.8kbits/s
> libv4l2: error dequeuing buf: Resource temporarily unavailable
>   -- repeated 44 times --
> libv4l2: error dequeuing buf: Resource temporarily unavailable
> frame=  213 fps= 26 q=31.0 size=     454kB time=00:00:08.52 bitrate=
> 436.7kbits/s
> libv4l2: error dequeuing buf: Resource temporarily unavailable
>   -- repeated 44 times --
> libv4l2: error dequeuing buf: Resource temporarily unavailable
> frame=  226 fps= 26 q=31.0 size=     468kB time=00:00:09.04 bitrate=
> 424.0kbits/s
> libv4l2: error dequeuing buf: Resource temporarily unavailable
>   -- repeated 15 times --
> libv4l2: error dequeuing buf: Resource temporarily unavailable
> frame=  230 fps= 25 q=31.0 Lsize=     480kB time=00:00:09.20 bitrate=
> 427.2kbits/s
> video:469kB audio:0kB global headers:0kB muxing overhead 2.358736%
> 
> May be I should not have to compile with libv4l2? What is bother me that
> may be I should have to set another input? Any farther suggestions?
> 
> Sincerely
>   tovis

Only what Carl Eugen suggested: 

"Since it is likely that the input is interlaced, please first try 
-qscale 2 out0.avi to test if this improves quality, then use yadif."




-- 
===================================================
Rodney Baker VK5ZTV
rodney.baker at iinet.net.au
=================================================== 



More information about the ffmpeg-user mailing list