Пример #1
0
def player(*argv, **argd):
    screen = VideoSurface()
    screen_in_scene = PygameWrapper(wrap=screen, position=(0, 0,-8), rotation=(-30,15,3)).activate()

    i1 = MatchedTranslationInteractor(target=screen_in_scene).activate()

    return Pipeline(
               DiracDecoder(),
               ToRGB_interleaved(),
               screen,
           )
Пример #2
0
                self.pause()

            yield 1

#        self.send(Axon.Ipc.producerFinished(message=self.display), "displayctrl")
        self.send(None, "yuvdata")


#        print "OK, we're done"

__kamaelia_components__ = (VideoOverlay, )

if __name__ == "__main__":
    from Kamaelia.Codec.Dirac import DiracDecoder
    from Kamaelia.Chassis.Pipeline import Pipeline
    from Kamaelia.File.ReadFileAdaptor import ReadFileAdaptor
    from Kamaelia.Codec.RawYUVFramer import RawYUVFramer

    #    Pipeline( ReadFileAdaptor("/data/dirac-video/snowboard-jum-352x288x75.yuv", readmode="bitrate", bitrate = 2280960*8),
    Pipeline(
        ReadFileAdaptor("/data/dirac-video/snowboard-jum-352x288x75.dirac.drc",
                        readmode="bitrate",
                        bitrate=2280960 * 8),
        #    Pipeline( ReadFileAdaptor("test.yuv", readmode="bitrate", bitrate = 2280960*8),
        DiracDecoder(),
        #              RawYUVFramer(size=(352,288), pixformat = "YUV420_planar" ),
        #    Pipeline( ReadFileAdaptor("/data/dirac-video/snowboard-jum-720x576x50.yuv", readmode="bitrate", bitrate = 2280960*8*4),
        #              RawYUVFramer(size=(720,576), pixformat = pygame.IYUV_OVERLAY),
        VideoOverlay(),
    ).run()
Пример #3
0
from Kamaelia.Codec.Dirac import DiracDecoder
from Kamaelia.File.ReadFileAdaptor import ReadFileAdaptor
from Kamaelia.Util.RateFilter import MessageRateLimit
from VideoSurface import VideoSurface
from PixFormatConversion import ToRGB_interleaved

from Kamaelia.UI.PygameDisplay import PygameDisplay
from Kamaelia.UI.OpenGL.OpenGLDisplay import OpenGLDisplay
from Kamaelia.UI.OpenGL.PygameWrapper import PygameWrapper
from Kamaelia.UI.OpenGL.SkyGrassBackground import SkyGrassBackground
from Kamaelia.UI.OpenGL.Movement import SimpleRotator

file = "../../../Code/Python/Kamaelia/Examples/VideoCodecs/Dirac/snowboard-jump-352x288x75.0.5.4.drc"
framerate = 15

# override pygame display service
ogl_display = OpenGLDisplay.getDisplayService()
PygameDisplay.setDisplayService(ogl_display[0])

SkyGrassBackground(size=(5000, 5000, 0), position=(0, 0, -100)).activate()
screen = VideoSurface()
screen__in_scene = PygameWrapper(wrap=screen,
                                 position=(0, 0, -5),
                                 rotation=(-30, 15, 3)).activate()
rotator = SimpleRotator(amount=(0.0, 0.0, 0.5)).activate()
rotator.link((rotator, "outbox"), (screen__in_scene, "rel_rotation"))

Pipeline(ReadFileAdaptor(file, readmode="bitrate", bitrate=300000 * 8 / 5),
         DiracDecoder(), ToRGB_interleaved(),
         MessageRateLimit(framerate, buffer=15), screen).run()
Пример #4
0
def player(*argv, **argd):
    return Pipeline(
        DiracDecoder(),
        ToRGB_interleaved(),
        VideoSurface(),
    )
from Kamaelia.File.ReadFileAdaptor import ReadFileAdaptor
from Kamaelia.Codec.RawYUVFramer import RawYUVFramer
from Kamaelia.Codec.Dirac import DiracEncoder, DiracDecoder
from Kamaelia.UI.Pygame.VideoOverlay import VideoOverlay

# Download and build dirac first!
#
# Get the source raw video file (in rgb format) from here, and gunzip it:
# http://sourceforge.net/project/showfiles.php?group_id=102564&package_id=119507
#
# To convert RGB to YUV:
#   RGBtoYUV420 snowboard-jum-352x288x75.rgb snowboard-jum-352x288x75.yuv 352 288 75
#
# Alternatively, source your own AVI file and convert with:
#   ffmpeg -i file_from_digital_camera.avi rawvideo.yuv
#
# and alter the config below as required.

FILENAME = "/data/dirac-video/snowboard-jum-352x288x75.yuv"
SIZE = (352, 288)
DIRACPRESET = "CIF"  # dirac resolution and encoder settings preset

# encoder param sets it to iframe only (no motion based coding, faster)
# (overrides preset)
ENCPARAMS = {"num_L1": 0}

Pipeline(ReadFileAdaptor(FILENAME, readmode="bitrate", bitrate=1000000),
         RawYUVFramer(size=SIZE),
         DiracEncoder(preset=DIRACPRESET, encParams=ENCPARAMS), DiracDecoder(),
         VideoOverlay()).run()
Пример #6
0
#!/usr/bin/env python

#
# Generated with Kamaelia: Compose
# (first real app created using it :-)
#

from Kamaelia.UI.Pygame.VideoOverlay import VideoOverlay
from Kamaelia.File.ReadFileAdaptor import ReadFileAdaptor
from Kamaelia.Internet.TCPClient import TCPClient
from Kamaelia.Util.RateFilter import MessageRateLimit
from Kamaelia.Codec.Dirac import DiracDecoder
from Kamaelia.Internet.SingleServer import SingleServer
from Kamaelia.Chassis.Graphline import Graphline
Graphline(RFA1=ReadFileAdaptor(
    filename=
    "/home/michaels/Development/Projects/Kamaelia/Code/Python/Kamaelia/Examples/VideoCodecs/Dirac/snowboard-jum-352x288x75.dirac.drc",
    bitrate=400000),
          TCPC3=TCPClient(host="127.0.0.1", port=1500),
          SS2=SingleServer(port=1500),
          MRL5=MessageRateLimit(messages_per_second=15, buffer=15),
          DD4=DiracDecoder(),
          VO6=VideoOverlay(),
          linkages={
              ('RFA1', 'outbox'): ('SS2', 'inbox'),
              ('TCPC3', 'outbox'): ('DD4', 'inbox'),
              ('DD4', 'outbox'): ('MRL5', 'inbox'),
              ('MRL5', 'outbox'): ('VO6', 'inbox'),
          }).run()