×

Discussion Board

Results 1 to 10 of 10
  1. #1
    Registered User
    Join Date
    Feb 2008
    Posts
    17

    video streaming on python

    Dear nokia expert:

    I did video streaming on python using pys60, but is to slow the functions what can i do to improve the speed of process of pys60 or my N95 cellphones

    Thanks for any tip I would appreciate so much

  2. #2
    Regular Contributor
    Join Date
    Jan 2004
    Location
    Helsinki
    Posts
    376

    Re: video streaming on python

    Quote Originally Posted by Alpinet View Post
    Dear nokia expert:

    I did video streaming on python using pys60, but is to slow the functions what can i do to improve the speed of process of pys60 or my N95 cellphones

    Thanks for any tip I would appreciate so much
    1. Access raw video interface (using OpenGL?)

    2. Do image processing in C extension

    3. Try to direct pointer access and avoid memory blitting in operations

    4. Use hardware acceleration available in the phones

    In any case, you probably need mix in some C, since Python is not designed for computational sensitive tasks and it is assumed the software designer does such tasks in C extensions.
    Mikko Ohtamaa

    http://mfabrik.com
    http://blog.mfabrik.com

  3. #3
    Registered User
    Join Date
    Jun 2009
    Posts
    17

    Smile Re: video streaming on python

    Hello,
    Can somebody help me with the video streaming code

    Thanks

  4. #4
    Regular Contributor
    Join Date
    Jan 2004
    Location
    Helsinki
    Posts
    376

    Unhappy Re: video streaming on python

    Quote Originally Posted by mt.jijo View Post
    Hello,
    Can somebody help me with the video streaming code

    Thanks
    How much you pay?

    Asking generic questions or pleding for help when you don't state what are you trying to do does not result to good answers.
    Mikko Ohtamaa

    http://mfabrik.com
    http://blog.mfabrik.com

  5. #5
    Registered User
    Join Date
    Jun 2009
    Posts
    17

    Re: video streaming on python

    Hello,
    I am actually trying to do some application which should use my N82 camera and stream the video to the web.
    can anyone help for trying this out

    Thanks

  6. #6
    Super Contributor
    Join Date
    Nov 2007
    Location
    Sertaozinho/Brazil
    Posts
    768

    Re: video streaming on python

    Quote Originally Posted by mt.jijo View Post
    Hello,
    I am actually trying to do some application which should use my N82 camera and stream the video to the web.
    can anyone help for trying this out

    Thanks
    Hi mt.jijo

    To take a screenshot or record a video is easy. You can see how in the pys60 doc and searching at forum nokia. But your problems will begin if you decide to do a live streaming. You do not have access to the streaming, only to final video. Moreover, if you decide to use several images to create a video, you will not have any encoder to create an streaming from them.

    So, there is a lot of interesting work to be done. Who knows Alpinet does not share his code with us ?

  7. #7
    Regular Contributor
    Join Date
    Jan 2004
    Location
    Helsinki
    Posts
    376

    Smile Re: video streaming on python

    Quote Originally Posted by marcelobarrosalmeida View Post
    Hi mt.jijo

    But your problems will begin if you decide to do a live streaming.
    Maybe this can help: http://movino.org/
    Mikko Ohtamaa

    http://mfabrik.com
    http://blog.mfabrik.com

  8. #8
    Super Contributor
    Join Date
    Nov 2007
    Location
    Sertaozinho/Brazil
    Posts
    768

    Re: video streaming on python

    Quote Originally Posted by miohtama View Post
    Maybe this can help: http://movino.org/
    Hi miohtama ! Well remembered ! \o/
    A long time ago I was interested in decoding the streaming sent by movino and I wrote the following (ugly) code. In fact, movino uses a compression similar to libjpeg. You will see jpeg images without tables in jpeg header. I did not studied how libjpeg is implemented and my test stopped at this point but I think it can be a good starting point for you. It is GPL3

    Code:
    #!/usr/bin/python
    # -*- coding: utf-8 -*-
    # Marcelo Barros de Almeida <marcelobarrosalmeida@gmail.com>
    # License: GPL3
    
    from socket import *
    from struct import *
    from threading import *
    from time import *
    
    def save_jpeg_header(payload):
        #p = payload.find('\xff\xc0')
        #hdr = payload
        pass
    
    def save_jpeg(hdr,img):
        p = img.find('\xff\xc0')
        data = img[:p] + hdr[2:-2] + img[p:]
        fn = ctime(time()) + '.jpg'
        f = open(fn,'wb')
        f.write(data)
        f.close()
        
        
    def process_cmd(s,cmd,payload):
        hdr = ''
        cmd_lst = { 0:'Garbage',
                   1:'YUV frame',
                   2:'PCM audio',
                   3:'JPEG header',
                   4:'JPEG frame',
                   5:'μlaw audio',
                   6:'AMR audio',
                   7:'Start MTU measurement',
                   8:'Stop MTU measurement',
                   9:'Video file',
                   10:'MPEG frame',
                   11:'Video chunk',
                   12:'Theora header',
                   13:'Theora frame',
                   14:'Handshake',
                   15:'Stream info',
                   16:'Stream closed' }
    
    
        print "CMD=%d (%s)" % (cmd,cmd_lst[cmd])
        print "PAYLOAD=%d" % len(payload)
    
        if cmd == 8:
            s.sendall(mtu())
    
        if cmd == 3:
            hdr = payload
    	#save_jpeg_header(payload)
    
        if cmd == 4:
            save_jpeg(hdr,payload[4:])
            
        
    def recv_tsk(s):
        data=''
        while True:
            #print "waiting data"
            inp = s.recv(1024);
            if not inp:
                break
            data = data + inp
            #print "already received %d bytes" % len(data)
            # complete header ?
            if len(data) < 5:
                continue
            (cmd,sz) = unpack(">BL",data[:5])
            # complete payload ?
            if len(data) - 5 < sz:
                continue
            payload = data[5:5+sz]
            data = data[5+sz:]
            process_cmd(s,cmd,payload)
    
    def mtu():
        return pack(">BLL",1,4,1024)
                
    def handshake():
        return pack(">BLBB",2,2,1,1)
    
    def ping():
        return pack(">BL",3,0)
                
    def movino(s):
        rcv = Thread(target=recv_tsk,args=(s,))
        rcv.start()
    
        print "Sendign handshake"
        s.sendall(handshake())
        #sleep(5)
        #s.sendall(ping())
        
        while True: pass
    
    s = socket(AF_INET,SOCK_STREAM)
    s.bind(("",30710))
    s.listen(10)
    
    while True:
        comm,addr = s.accept()
        movino(comm)
        comm.close()

  9. #9
    Registered User
    Join Date
    Jun 2009
    Posts
    17

    Smile Re: video streaming on python

    Thank you guys, Let me try with this.

    Thank you so much for your fast response

  10. #10
    Registered User
    Join Date
    Nov 2009
    Posts
    1

    Re: video streaming on python

    Quote Originally Posted by Alpinet View Post
    Dear nokia expert:

    I did video streaming on python using pys60, but is to slow the functions what can i do to improve the speed of process of pys60 or my N95 cellphones

    Thanks for any tip I would appreciate so much
    hi thr
    using pys60 how did u managed to do video streaming, which api or module did u used,can u provide me with some source code
    actually i am doing a final year project and my project is related to video streaming from a cell phone i am using nokia 5800 xpress music.reply asap

    wakasbinkhalid@gmail.com

Similar Threads

  1. video streaming in mobile
    By premlathiya in forum Mobile Java General
    Replies: 5
    Last Post: 2009-06-04, 22:13
  2. Streaming Video over Bluetooth
    By davmt in forum Streaming and Video
    Replies: 3
    Last Post: 2009-03-27, 02:00
  3. Video Streaming Buffer
    By alessiobwb in forum Symbian Media (Closed)
    Replies: 1
    Last Post: 2007-07-22, 08:03
  4. Streaming Video
    By Asheesh in forum Symbian Media (Closed)
    Replies: 37
    Last Post: 2007-04-21, 16:05
  5. RTSP video streaming issue on 6280
    By olivier_irac in forum General Development Questions
    Replies: 0
    Last Post: 2006-12-04, 15:11

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  
×