static int opt_preset(const char *opt, const char *arg)
{
    FILE *f=NULL;
    char filename[1000], tmp[1000], tmp2[1000], line[1000];
    char *codec_name = *opt == 'v' ? video_codec_name :
                       *opt == 'a' ? audio_codec_name :
                                     subtitle_codec_name;
    if (!(f = get_preset_file(filename, sizeof(filename), arg, *opt == 'f', codec_name))) {
        fprintf(stderr, "File for preset '%s' not found\n", arg);
        ffmpeg_exit(1);
    }
    while(!feof(f)){
        int e= fscanf(f, "%999[^\n]\n", line) - 1;
        if(line[0] == '#' && !e)
            continue;
        e|= sscanf(line, "%999[^=]=%999[^\n]\n", tmp, tmp2) - 2;
        if(e){
            fprintf(stderr, "%s: Invalid syntax: '%s'\n", filename, line);
            ffmpeg_exit(1);
        }
        if(!strcmp(tmp, "acodec")){
            opt_audio_codec(tmp2);
        }else if(!strcmp(tmp, "vcodec")){
            opt_video_codec(tmp2);
        }else if(!strcmp(tmp, "scodec")){
            opt_subtitle_codec(tmp2);
        }else if(!strcmp(tmp, "dcodec")){
            opt_data_codec(tmp2);
        }else if(opt_default(tmp, tmp2) < 0){
            fprintf(stderr, "%s: Invalid option or argument: '%s', parsed as '%s' = '%s'\n", filename, line, tmp, tmp2);
            ffmpeg_exit(1);
        }
    }
    fclose(f);
    return 0;
}
['static int opt_preset(const char *opt, const char *arg)\n{\n    FILE *f=NULL;\n    char filename[1000], tmp[1000], tmp2[1000], line[1000];\n    char *codec_name = *opt == \'v\' ? video_codec_name :\n                       *opt == \'a\' ? audio_codec_name :\n                                     subtitle_codec_name;\n    if (!(f = get_preset_file(filename, sizeof(filename), arg, *opt == \'f\', codec_name))) {\n        fprintf(stderr, "File for preset \'%s\' not found\\n", arg);\n        ffmpeg_exit(1);\n    }\n    while(!feof(f)){\n        int e= fscanf(f, "%999[^\\n]\\n", line) - 1;\n        if(line[0] == \'#\' && !e)\n            continue;\n        e|= sscanf(line, "%999[^=]=%999[^\\n]\\n", tmp, tmp2) - 2;\n        if(e){\n            fprintf(stderr, "%s: Invalid syntax: \'%s\'\\n", filename, line);\n            ffmpeg_exit(1);\n        }\n        if(!strcmp(tmp, "acodec")){\n            opt_audio_codec(tmp2);\n        }else if(!strcmp(tmp, "vcodec")){\n            opt_video_codec(tmp2);\n        }else if(!strcmp(tmp, "scodec")){\n            opt_subtitle_codec(tmp2);\n        }else if(!strcmp(tmp, "dcodec")){\n            opt_data_codec(tmp2);\n        }else if(opt_default(tmp, tmp2) < 0){\n            fprintf(stderr, "%s: Invalid option or argument: \'%s\', parsed as \'%s\' = \'%s\'\\n", filename, line, tmp, tmp2);\n            ffmpeg_exit(1);\n        }\n    }\n    fclose(f);\n    return 0;\n}']