Revision b2a2197e

View differences:

ffmpeg.c
133 133
static int me_method = ME_EPZS;
134 134
static int video_disable = 0;
135 135
static int video_codec_id = CODEC_ID_NONE;
136
static int video_codec_tag = 0;
136 137
static int same_quality = 0;
137 138
static int b_frames = 0;
138 139
static int mb_decision = FF_MB_DECISION_SIMPLE;
......
200 201
static int audio_disable = 0;
201 202
static int audio_channels = 1;
202 203
static int audio_codec_id = CODEC_ID_NONE;
204
static int audio_codec_tag = 0;
203 205

  
204 206
static int mux_rate= 0;
205 207
static int mux_packet_size= 0;
......
1489 1491
            /* if stream_copy is selected, no need to decode or encode */
1490 1492
            codec->codec_id = icodec->codec_id;
1491 1493
            codec->codec_type = icodec->codec_type;
1492
            codec->codec_tag = icodec->codec_tag;
1494
            if(!codec->codec_tag) codec->codec_tag = icodec->codec_tag;
1493 1495
            codec->bit_rate = icodec->bit_rate;
1494 1496
            switch(codec->codec_type) {
1495 1497
            case CODEC_TYPE_AUDIO:
......
2613 2615
    }
2614 2616
}
2615 2617

  
2618
static void opt_audio_tag(const char *arg)
2619
{
2620
    char *tail;
2621
    audio_codec_tag= strtol(arg, &tail, 0);
2622

  
2623
    if(!tail || *tail)
2624
        audio_codec_tag= arg[0] + (arg[1]<<8) + (arg[2]<<16) + (arg[3]<<24);
2625
}
2626

  
2627
static void opt_video_tag(const char *arg)
2628
{
2629
    char *tail;
2630
    video_codec_tag= strtol(arg, &tail, 0);
2631

  
2632
    if(!tail || *tail)
2633
        video_codec_tag= arg[0] + (arg[1]<<8) + (arg[2]<<16) + (arg[3]<<24);
2634
}
2635

  
2616 2636
static void add_frame_hooker(const char *arg)
2617 2637
{
2618 2638
    int argc = 0;
......
2955 2975

  
2956 2976
            video_enc = &st->codec;
2957 2977
            
2978
            if(video_codec_tag)
2979
                video_enc->codec_tag= video_codec_tag;
2980
                
2958 2981
            if(!strcmp(file_oformat->name, "mp4") || !strcmp(file_oformat->name, "mov") || !strcmp(file_oformat->name, "3gp"))
2959 2982
                video_enc->flags |= CODEC_FLAG_GLOBAL_HEADER;
2960 2983
            if (video_stream_copy) {
......
3205 3228
            audio_enc = &st->codec;
3206 3229
            audio_enc->codec_type = CODEC_TYPE_AUDIO;
3207 3230

  
3231
            if(audio_codec_tag)
3232
                audio_enc->codec_tag= audio_codec_tag;
3233

  
3208 3234
            if(!strcmp(file_oformat->name, "mp4") || !strcmp(file_oformat->name, "mov") || !strcmp(file_oformat->name, "3gp"))
3209 3235
                audio_enc->flags |= CODEC_FLAG_GLOBAL_HEADER;
3210 3236
            if (audio_stream_copy) {
......
3870 3896
    { "nssew", OPT_INT | HAS_ARG | OPT_EXPERT | OPT_VIDEO, {(void*)&nsse_weight}, "weight", "" },
3871 3897
    { "subq", OPT_INT | HAS_ARG | OPT_EXPERT | OPT_VIDEO, {(void*)&subpel_quality}, "", "" },
3872 3898
    { "lowres", OPT_INT | HAS_ARG | OPT_EXPERT | OPT_VIDEO, {(void*)&lowres}, "", "" },
3899
    { "vtag", HAS_ARG | OPT_EXPERT | OPT_VIDEO, {(void*)opt_video_tag}, "force video tag/fourcc", "fourcc/tag" },
3873 3900

  
3874 3901
    /* audio options */
3875 3902
    { "ab", HAS_ARG | OPT_AUDIO, {(void*)opt_audio_bitrate}, "set audio bitrate (in kbit/s)", "bitrate", },
......
3877 3904
    { "ac", HAS_ARG | OPT_AUDIO, {(void*)opt_audio_channels}, "set number of audio channels", "channels" },
3878 3905
    { "an", OPT_BOOL | OPT_AUDIO, {(void*)&audio_disable}, "disable audio" },
3879 3906
    { "acodec", HAS_ARG | OPT_AUDIO, {(void*)opt_audio_codec}, "force audio codec ('copy' to copy stream)", "codec" },
3907
    { "atag", HAS_ARG | OPT_EXPERT | OPT_AUDIO, {(void*)opt_audio_tag}, "force audio tag/fourcc", "fourcc/tag" },
3880 3908

  
3881 3909
    /* grab options */
3882 3910
    { "vd", HAS_ARG | OPT_EXPERT | OPT_VIDEO | OPT_GRAB, {(void*)opt_video_device}, "set video grab device", "device" },

Also available in: Unified diff