And refactor choose_best_stream() a little. videotestsrc pattern=ball ! x264enc ! mpegpsmux ! ... plays much nicer now.