omz:forum

    • Register
    • Login
    • Search
    • Recent
    • Popular

    Welcome!

    This is the community forum for my apps Pythonista and Editorial.

    For individual support questions, you can also send an email. If you have a very short question or just want to say hello — I'm @olemoritz on Twitter.


    video edition

    Pythonista
    8
    33
    15128
    Loading More Posts
    • Oldest to Newest
    • Newest to Oldest
    • Most Votes
    Reply
    • Reply as topic
    Log in to reply
    This topic has been deleted. Only users with topic management privileges can see it.
    • JonB
      JonB @jmv38 last edited by

      @jmv38 I think what you probably are going to want is an AVVideoComposition, which lets you use standard or custom CIFilters to process a movie.

      I am playing around with getting AVAssetReader workng, though I might not get a lot of time to work on this for a few weeks

      1 Reply Last reply Reply Quote 0
      • jmv38
        jmv38 last edited by

        Thanks for your answer @JonB
        I had a look at apple's doc on videocomposition. It is way over my head, so I'll postpone this part of my project to an indefinite date. And for now I'll focus on the many other parts that still need to be written, and are more within my reach...
        Thanks!

        1 Reply Last reply Reply Quote 0
        • JonB
          JonB last edited by

          btw, in the meantime, you should be able to access the imageview.image to get a ui.image, which you can the convert to jpg or png to write to a sequence of files, or PIL image for processing, etc.

          1 Reply Last reply Reply Quote 0
          • jmv38
            jmv38 last edited by

            Correct. This is what i really needed in the first place. The video writing capability is just the 'cherry on the cake'.

            1 Reply Last reply Reply Quote 0
            • jmv38
              jmv38 last edited by jmv38

              i found this link http://stackoverflow.com/questions/5640657/avfoundation-assetwriter-generate-movie-with-images-and-audio
              The very first bloc of code in this topic is sufficient i think (i dont want to alter audio).
              Is it possible to embed the whole code and pass it just the video and the image? Or do I have to call each line with objc utils?

              1 Reply Last reply Reply Quote 0
              • SandraGarrett
                SandraGarrett last edited by

                This post is deleted!
                cvp 1 Reply Last reply Reply Quote 0
                • cvp
                  cvp @SandraGarrett last edited by ccc

                  @SandraGarrett more info on the .in_dll() method here

                  1 Reply Last reply Reply Quote 0
                  • SandraGarrett
                    SandraGarrett last edited by

                    This post is deleted!
                    1 Reply Last reply Reply Quote 0
                    • ashishkumarji
                      ashishkumarji last edited by

                      This post is deleted!
                      1 Reply Last reply Reply Quote 0
                      • Pythonised
                        Pythonised last edited by ccc

                        I'd like to be able to get a video from the photos module or a local .mov file and show a given frame in the console.

                        There seems to be 2 ways to do this but neither is working for me yet.

                        I tried running this:

                        https://github.com/jsbain/objc_hacks/blob/master/getframes.py

                        But the resulting view is just a transparent overlay.

                        It seems to me that this returns a 'NoneType' object.

                        cgimage_obj=generator.copyCGImageAtTime_actualTime_error_(t,byref(tactual),None,restype=c_void_p,argtypes=[CMTime,POINTER(CMTime),POINTER(c_void_p)])

                        type(cgimage_obj)
                        <class 'NoneType'>

                        It also looks like the photos module has a .seek function I am unable to get that to show me anything other than frame 1 using get_image().

                        Are there any working examples of this?

                        Thanks so much for your help.

                        1 Reply Last reply Reply Quote 0
                        • JonB
                          JonB last edited by

                          Did you try the modified version of the code posted by @jmv38 at the top of this thread?

                          The next thing to do would be to step through each line and see if you are getting objects back. For instance, is generator valid, etc. I'll have to check, but some of these methods may be depreciated now.

                          1 Reply Last reply Reply Quote 0
                          • Pythonised
                            Pythonised last edited by Pythonised

                            @JonB

                            Hi. Thanks for the reply.

                            Yea I did. It has a similar result with a transparent view and not able to see any images. I’ve started going through your code line by line but I’ve only just starting to use objc_util and there are other things you are doing that are new to me.

                            My concern is that it isn’t possible anymore and I’m going down the wrong path.

                            cvp 1 Reply Last reply Reply Quote 0
                            • cvp
                              cvp @Pythonised last edited by

                              @Pythonised In IOS 16/iPadOS 16, you will have Image at to replace deprecated copyCGImageAtTime_actualTime_error_

                              Pythonised 1 Reply Last reply Reply Quote 1
                              • B
                                bhuvahh last edited by

                                This post is deleted!
                                1 Reply Last reply Reply Quote 0
                                • H
                                  hamishduke last edited by hamishduke

                                  This post is deleted!
                                  1 Reply Last reply Reply Quote 0
                                  • Pythonised
                                    Pythonised @cvp last edited by

                                    @cvp Thanks for the reply. I’m a bit out of my depth trying to solve this. I haven’t used ctypes before and can’t work out how to call the swift “image(at:)“ function as you’ve suggested.

                                    cvp 1 Reply Last reply Reply Quote 0
                                    • cvp
                                      cvp @Pythonised last edited by

                                      @Pythonised image_at not shown in dir(generator), weird, can't help more, sorry

                                      1 Reply Last reply Reply Quote 1
                                      • First post
                                        Last post
                                      Powered by NodeBB Forums | Contributors