[vlc-devel] [vlc] transcoding with different input and output chromas
lokidor at lokiserv.ath.cx
Wed May 14 23:03:54 CEST 2008
lokidor a écrit :
> With vlc 0.9.0 from git is there a simple solution to transcode video
> with different input and output chromas ?
> My platform is a Nokia Internet Tablet N810 running maemo 4.0 (based on
> linux debian) and I compiled vlc inside scratchbox.
> This device has a builtin webcam TCM825x which is v4l2 compatible and
> works perfectly with the following command :
> qvlc v4l2:///dev/video0:chroma="UYVY":width=320:height=240
> This webcam can only output UYVY or RV16 signal, so vlc need to convert
> it to I420.
> As I built ffmpeg with "--enable-swcale" vlc is supposed to use the
> libswscale library which should be able to deal with the chroma
> convertion, but when I try to trancode the video with the following command:
> cvlc -vvv --color v4l2:///dev/video0:chroma="UYVY":width=320:height=240 \
> --ttl 12 \
> --sout-ffmpeg-hurry-up --ffmpeg-hurry-up --rt-priority
> I get the following error :
>  stream_out_transcode generic debug: source 320x240, crop
> 320x240, destination 320x240, padding 320x240
>  stream_out_transcode generic debug: encoder aspect is
>  main encoder debug: looking for encoder module: 7 candidates
>  ffmpeg encoder debug: libavcodec already initialized
>  ffmpeg encoder debug: found encoder MPEG-4 Video
>  main encoder debug: using encoder module "ffmpeg"
>  main generic debug: adding a new input
>  mux_asf generic debug: adding input
>  main filter debug: looking for video filter2 module: 1 candidate
>  main filter warning: no video filter2 module matching "scale"
> could be loaded
> And vlc continue failling to transcode rawvideo...
> After looking at the code It seem's that vlc doesn't find the libswscale
> filter defined in "codec/ffmpeg/ffmpeg.c" (which is correctly built) and
> try to load the filter from "video_filter/scale.c".
> This filter can only deal with identical input and output chroma
> formats, so it is rejected.
> I tried to build vlc without swscale in order to use the ffmpeg "crop
> padd" filter but it is worst :
>  main filter debug: looking for video filter2 module: 0 candidates
>  main filter error: no video filter2 module matched "crop padd"
>  stream_out_transcode generic debug: no video filter found
> And vlc continue failling to transcode rawvideo...
> Vlc doesn't find a "crop padd" filter but "vlc --list | grep crop" give
> me croppadd...
> Aflter looking at the code it seems that the missing space is the key
> point but anyway this filter (defined in "video_filter/croppadd.c") is
> not the ffmpeg filter and it can only deal with identical input and
> output chroma formats...
> As I know that is possible directly with vlc 0.8.6 with the ffmpeg "crop
> padd" filter I would know why I can't with vlc 0.9 ?
> Maybe vlc 0.9 uses a different method ?
> I saw there is a yuy2_i420 conversion filter but I didn't find a way to
> use it on the command line.
> vlc mailing list
> To unsubscribe or modify your subscription options:
Following my unanswered mail for the moment on the vlc mailing list, I
looked more precisely the code in relation to the criteria for selecting
filter and I have deduced that VLC load the module which have:
- A matching capability ("video filter2")
- A matching object_name or shortcut ("scale" if libswcale is detected
or "crop padd" if not)
- The biggest score
1\ With libswcale :
VLC can't find the filter from "codec/ffmpeg/scale.c" because the
object_name is "ffmpeg" and there is no "scale" shortcut defined.
But maybe this is intentional in order to disable the libswscale filter
Anyway, I tried to load this filter after patching the code (adding a
The module is found but It got a seg fault inside the sws_scale function
: (I checked with some flags)
 stream_out_transcode generic debug: source 320x240, crop
320x240, destination 320x240, padding 320x240
 stream_out_transcode generic debug: encoder aspect is
 main encoder debug: looking for encoder module: 7 candidates
 ffmpeg encoder debug: libavcodec already initialized
 ffmpeg encoder debug: found encoder MPEG-4 Video
 main encoder debug: using encoder module "ffmpeg"
 main generic debug: adding a new input
 mux_asf generic debug: adding input
 main filter debug: looking for video filter2 module: 2 candidates
 ffmpeg filter debug: 320x240 chroma: UYVY -> 320x240 chroma: I420
 main filter debug: using video filter2 module "ffmpeg"
I have not gone further with the libswscale filter and I tried with
ffmpeg built with "--disable-swscale"
2\ Without libswscale
VLC can't find the filter from "video_filter/croppadd.c" beause the
object_name is "croppadd" (without space) and there is no "crop padd"
VLC can't find the old ffmpeg filter from "codec/ffmpeg/ffmpeg.c"
because the capability is "crop padd" (not "video filter2") and
object_name is wrong too...
The filter from "video_filter/croppadd.c"" looks like useless for me
because it requires identical input and output chroma formats, so
finally I patched the code to enable the loading of the old ffmpeg filter.
Here is my working patch.
Perhaps there is a better way with libswscale or a chroma filter but I
do not have insisted.
-------------- next part --------------
A non-text attachment was scrubbed...
Size: 1619 bytes
Desc: not available
More information about the vlc-devel