[FFmpeg-user] ffmpeg - equivalent of mencoder's immediatemode=0

Mike F paziu at yahoo.com
Tue Jul 10 23:58:25 CEST 2012



> Mike F <paziu <at> yahoo.com> writes:
> 
>>  after running 
>>  # v4lctl volume mute off
>> 
>>  ffmpeg started capturing audio and video...
>> 
>>  Is there any way, to send a v4l2 cmd as a ffmpeg argument
> 
> Assuming we agree that mute=off can always be forced, 
> look at device_open() in libavdevice/v4l2.c
> (Don't forget to send a patch to ffmpeg-devel if you succeed.)
> 
> Carl Eugen

Hello Carl,

You do not know how much I would like to send a patch instead writing this message,
I am simply not good enough in C... If I start now, probably after 2 months I could send one...

I looked in the kernel module src - drivers for medua/video, many decided to mute it by default - read somewhere ---> to prevent some noise, probably during the init process (?)
vlc has several controls enabled for hue. brightness, color, volume & mute - mplayer also has some controls for v4l2
again, I would be more than happy to add them, if I could do GNU C.

here are a couple of small examples and a list of controls for v4l2:

--------------------------------------------------
this is the example of the em28xx driver:

        /* Audio defaults */
        dev->mute = 1;
        dev->volume = 0x1f;
--------------------------------------------------
add_bool( CFG_PREFIX "audio-mute", false, AUDIO_MUTE_TEXT,              AUDIO_MUTE_LONGTEXT, true )
---------------------------------------------------------------------------------

static struct v4l2_queryctrl ac97_qctrl[] = {
        {
                .id = V4L2_CID_AUDIO_VOLUME,
                .type = V4L2_CTRL_TYPE_INTEGER,
                .name = "Volume",
                .minimum = 0x0,
                .maximum = 0x1f,
                .step = 0x1,
                .default_value = 0x1f,
                .flags = V4L2_CTRL_FLAG_SLIDER,
        }, {
                .id = V4L2_CID_AUDIO_MUTE,
                .type = V4L2_CTRL_TYPE_BOOLEAN,
                .name = "Mute",
                .minimum = 0,
                .maximum = 1,
                .step = 1,
                .default_value = 1,
                .flags = 0,
        }
};
 
--------------------------------------------------------------------------------------------- 

 
        /* USER controls */
        /* Keep the order of the 'case's the same as in videodev2.h! */
        case V4L2_CID_USER_CLASS:               return "User Controls";
        case V4L2_CID_BRIGHTNESS:               return "Brightness";
        case V4L2_CID_CONTRAST:                 return "Contrast";
        case V4L2_CID_SATURATION:               return "Saturation";
        case V4L2_CID_HUE:                      return "Hue";
        case V4L2_CID_AUDIO_VOLUME:             return "Volume";
        case V4L2_CID_AUDIO_BALANCE:            return "Balance";
        case V4L2_CID_AUDIO_BASS:               return "Bass";
        case V4L2_CID_AUDIO_TREBLE:             return "Treble";
        case V4L2_CID_AUDIO_MUTE:               return "Mute";
        case V4L2_CID_AUDIO_LOUDNESS:           return "Loudness";
        case V4L2_CID_BLACK_LEVEL:              return "Black Level";
        case V4L2_CID_AUTO_WHITE_BALANCE:       return "White Balance, Automatic";
        case V4L2_CID_DO_WHITE_BALANCE:         return "Do White Balance";
        case V4L2_CID_RED_BALANCE:              return "Red Balance";
        case V4L2_CID_BLUE_BALANCE:             return "Blue Balance";
        case V4L2_CID_GAMMA:                    return "Gamma";
        case V4L2_CID_EXPOSURE:                 return "Exposure";
        case V4L2_CID_AUTOGAIN:                 return "Gain, Automatic";
        case V4L2_CID_GAIN:                     return "Gain";
        case V4L2_CID_HFLIP:                    return "Horizontal Flip";
        case V4L2_CID_VFLIP:                    return "Vertical Flip";
        case V4L2_CID_HCENTER:                  return "Horizontal Center";
        case V4L2_CID_VCENTER:                  return "Vertical Center";
        case V4L2_CID_POWER_LINE_FREQUENCY:     return "Power Line Frequency";
        case V4L2_CID_HUE_AUTO:                 return "Hue, Automatic";
        case V4L2_CID_WHITE_BALANCE_TEMPERATURE: return "White Balance Temperature";
        case V4L2_CID_SHARPNESS:                return "Sharpness";
        case V4L2_CID_BACKLIGHT_COMPENSATION:   return "Backlight Compensation";
        case V4L2_CID_CHROMA_AGC:               return "Chroma AGC";
        case V4L2_CID_COLOR_KILLER:             return "Color Killer";
        case V4L2_CID_COLORFX:                  return "Color Effects";
        case V4L2_CID_AUTOBRIGHTNESS:           return "Brightness, Automatic";
        case V4L2_CID_BAND_STOP_FILTER:         return "Band-Stop Filter";
        case V4L2_CID_ROTATE:                   return "Rotate";
        case V4L2_CID_BG_COLOR:                 return "Background Color";
        case V4L2_CID_CHROMA_GAIN:              return "Chroma Gain";
        case V4L2_CID_ILLUMINATORS_1:           return "Illuminator 1";
        case V4L2_CID_ILLUMINATORS_2:           return "Illuminator 2";
 ------------------------------------------------------------------------------------------------------------------
Since I already started, many times with Dennis Ritchie's &  Brian Kernighan's ANSI C book, this might give me a true reason do take it seriously, since I know, that I could do more....
I will start looking into the code, if mute is still the case after a few months, I will show you my attempt, but in any case I will try to achieve it for personal reasons...

Thank you a LOT and sorry that I cannot provide anything valuable...


Mike


More information about the ffmpeg-user mailing list