def METHOD_NAME(outfilename, frames, caps="image/svg",
                    container="ts"):
    """Given a list (or generator) of video frames generates a video and writes
    it to disk.  The video is MPEG4 encoded, with a silent stereo audio track
    encoded as AAC.
    :param outfilename: The filename of the video that is to be created
    :param frames:      A list of frames of the format `[(data, duration), ...]`
                        where duration is in nanoseconds and data will
                        typically be a string.
    :param caps:        GStreamer caps description as a string that describes
                        the format of the data passed in as frames.
    :param container:   The container format to use.  Valid choices are `"ts"`
                        for mpeg-ts and `"mp4"`
    The video/audio format was chosen as it seems to be most supported by most
    TVs.
    This function is typically used to generate a video from a list of SVGs.
    You can define a generator that yields slightly different SVGs in a
    sequence and get a video out the other side.  It can also be used for
    simple slideshows, etc."""
    muxer = {'ts': 'mpegtsmux', 'mp4': 'mp4mux'}[container]
    pipeline = Gst.parse_launch(
        """
        appsrc name=videosrc format=time caps=%s,framerate=(fraction)25/1 !
          queue ! decodebin ! videoconvert !
          videorate ! video/x-raw,framerate=(fraction)25/1 ! queue !
          avenc_mpeg4 bitrate=3000000 ! mpeg4videoparse ! queue ! mux.
        appsrc name=audiosrc format=time
          caps=audio/x-raw,format=S16LE,channels=2,rate=48000,layout=interleaved
          ! audioconvert ! queue ! voaacenc ! aacparse ! queue ! mux.
        %s name=mux ! queue ! filesink location="%s" """ %
        (caps, muxer, outfilename))
    vsrc = pipeline.get_by_name('videosrc')
    asrc = pipeline.get_by_name('audiosrc')
    r = PipelineRunner(pipeline)
    t = 0
    for data, duration in frames:
        _appsrc_push_data(vsrc, data, t, duration)
        _appsrc_push_data(asrc, '\0\0\0\0' * int(duration * 48000 / Gst.SECOND),
                          t, duration)
        t += duration
    if t == 0:
        raise ValueError("Sequence argument frames must not be empty")
    _appsrc_push_data(vsrc, data, t, 0)  # pylint:disable=undefined-loop-variable
    vsrc.emit("end-of-stream")
    asrc.emit('end-of-stream')
    r.run()
    return 0