Revision 9cfd1b81 chunker_streamer/chunker_streamer.c

View differences:

chunker_streamer/chunker_streamer.c
128 128
    "\t[-t]: QoE test mode\n\n"
129 129
    "Codec options:\n"
130 130
    "\t[-g GOP]: gop size\n"
131
    "\t[-b frames]: max number of consecutive b frames\n\n"
131
    "\t[-b frames]: max number of consecutive b frames\n"
132
    "\t[-x extas]: extra video codec options (e.g. -x me_method=hex,flags2=+dct8x8+wpred+bpyrami+mixed_refs)\n"
133
    "\n"
132 134
    "=======================================================\n", argv[0]
133 135
    );
134 136
  }
......
172 174
	int video_bitrate = -1;
173 175
	char *audio_codec = "mp2";
174 176
	char *video_codec = "mpeg4";
177
	char *codec_options = "";
175 178
	int live_source = 0; //tells to sleep before reading next frame in not live (i.e. file)
176 179
	int offset_av = 0; //tells to compensate for offset between audio and video in the file
177 180
	
......
214 217
	/* `getopt_long' stores the option index here. */
215 218
	int option_index = 0, c;
216 219
	int mandatories = 0;
217
	while ((c = getopt_long (argc, argv, "i:a:v:A:V:s:lop:q:tF:g:b:d:", long_options, &option_index)) != -1)
220
	while ((c = getopt_long (argc, argv, "i:a:v:A:V:s:lop:q:tF:g:b:d:x:", long_options, &option_index)) != -1)
218 221
	{
219 222
		switch (c) {
220 223
			case 0: //for long options
......
267 270
			case 'd':
268 271
				sscanf(optarg, "%d", &delay_audio);
269 272
				break;
273
			case 'x':
274
				codec_options = strdup(optarg);
275
				break;
270 276
			default:
271 277
				print_usage(argc, argv);
272 278
				return -1;
......
447 453
    default:
448 454
	fprintf(stderr, "INIT: Unsupported OUT VIDEO codec: %s!\n", video_codec);
449 455
  }
450
 
456

  
457
  if ((av_set_options_string(pCodecCtxEnc, codec_options, "=", ",")) < 0) {
458
    fprintf(stderr, "Error parsing options string: '%s'\n", codec_options);
459
    exit(1);
460
  }
461

  
451 462
	fprintf(stderr, "INIT: VIDEO timebase OUT:%d %d IN: %d %d\n", pCodecCtxEnc->time_base.num, pCodecCtxEnc->time_base.den, pCodecCtx->time_base.num, pCodecCtx->time_base.den);
452 463
 }
453 464

  

Also available in: Unified diff