15 Replies Latest reply on Feb 19, 2016 2:12 PM by adamneer

    every 7th frame is a duplicate of the 6th

    nickn35634941 Level 1

      Hi there,

       

      I've been sent some footage to slow down and grade, but as soon as I tried slowing it down I realised the original footage contains uniformly distributed duplicate frames.. every 6th and 7th frame are identical. I've never come up against an issue like this before and am not quite sure what the best way to approach is.

       

      I've asked what camera was used, what frame rate it was shooting at and whether the file is taken straight from the camera but I haven't got back a reply yet. I'm not sure if I will actually get one either, so I thought I better ask here in advance.

       

      Things I've tried:

      - Duplicate frames removal script (Duplicate Frame Remover - aescripts + aeplugins - aescripts.com) but it doesn't work with cc 2015

      - time remapping script ( Deleting every nth frame (again)) "framesToTime(Math.floor(timeToFrames()*(1+(1/6)))+1);" I tried 0 to 6 and neither worked, I also tried 1/7 and that didn't work either.. I also tried some other similar scripts..

      I'm especially confounded by this since its a uniformly distanced duplicate frame, this script should fix it.

      - interpreting footage, I tried all the different settings for fields, guess pull-down, remove pull-down etc.

       

      I was thinking, since its uniform, I could use time remapping and tried a time stretch to "%85.714285714285714285714285714286" with "from frame" set to the first 7th duplicate frame. this works for the first 70~ frames or so then gets messed up, same happened when I tried using the script mentioned earlier.

       

      I used a program called Media Info to try and get some more details about the footage, the info can be seen here:

      General

      Complete name :ARECO 40.1.mov
      Format :MPEG-4
      Format profile :QuickTime
      Codec ID :qt 0000.00 (qt )
      File size :11.0 GiB
      Duration :18mn 42s
      Overall bit rate mode :Variable
      Overall bit rate :83.8 Mbps
      Movie name :Untitled Project
      Description :This video is about Untitled Project
      Encoded date :UTC 2016-02-10 19:49:19
      Tagged date :UTC 2016-02-10 19:56:29
      Writing library :Apple QuickTime
      com.apple.quicktime.keywords :2-10-16
      com.apple.quicktime.author :
      com.apple.quicktime.title :Untitled Project

       

      Video

      ID :1
      Format :ProRes
      Format version :Version 0
      Format profile :422 LT
      Codec ID :apcs
      Duration :18mn 42s
      Bit rate mode :Variable
      Bit rate :81.5 Mbps
      Width :1 920 pixels
      Height :1 080 pixels
      Display aspect ratio :16:9
      Frame rate mode :Constant
      Frame rate :25.000 fps
      Color space :YUV
      Chroma subsampling :4:2:2
      Scan type :Progressive
      Bits/(Pixel*Frame) :1.571
      Stream size :10.6 GiB (97%)
      Title :Core Media Video
      Writing library :Apple
      Encoded date :UTC 2016-02-10 19:49:24
      Tagged date :UTC 2016-02-10 19:56:29
      Color primaries :BT.709
      Transfer characteristics :BT.709
      Matrix coefficients :BT.709

       

      Audio

      ID :2
      Format :PCM
      Format settings, Endianness :Little
      Format settings, Sign :Signed
      Codec ID :lpcm
      Duration :18mn 42s
      Source duration :18mn 43s
      Bit rate mode :Constant
      Bit rate :2 304 Kbps
      Channel(s) :2 channels
      Channel positions :Front: L R
      Sampling rate :48.0 KHz
      Bit depth :24 bits
      Stream size :308 MiB (3%)
      Source stream size :308 MiB (3%)
      Title :Core Media Audio
      Encoded date :UTC 2016-02-10 19:49:24
      Tagged date :UTC 2016-02-10 19:56:29

       

      Other

      ID :3
      Type :Time code
      Format :QuickTime TC
      Duration :18mn 42s
      Time code of first frame :00:00:00:00
      Time code, striped :Yes
      Title :Core Media Time Code
      Encoded date :UTC 2016-02-10 19:49:24
      Tagged date :UTC 2016-02-10 19:56:29
      Bit rate mode :CBR


      areco details.jpg


        • 1. Re: every 7th frame is a duplicate of the 6th
          Rick Gerard Adobe Community Professional & MVP

          The first thing I would suspect is that the footage was transcoded from the original to ProRez and the person doing the work didn't match the frame rate. The first thing I would do would be to try and get my hands on the original footage and then render the original footage as an image sequence that is 16 bit or better.

           

          If you can't get the original footage you could dry writing an expression for Time remapping that uses time and java math to skip every seventh frame. It shcouldn't be that difficult to write a formula that simply counted up and skipped every multiple of 7.

           

          Something like this applied to Time Remapping:

          n = 7 // frame number to skip

          s = thisComp.frameDuration * n;

          sf = Math.floor(time/s);

          fr = time/thisComp.frameDuration;

          fr + sf

          n is the frequency of the duplicate frames, every 7th is a duplicate.

          s converts time to frames and multiplies that by n

          sf rounds the skipped frame to a whole numer

          fr converts the time to frames.

          Then you just add the number of frames to skip to the frame number and you'll skip every seventh frame.

           

          Now all you have to do is make sure that your first duplicate frame is on frame seven of the composition.

           

          How much are you trying to slow down the footage? What are you using to slow it down? 25 fps original can probably be slowed down about 50% in AE without too much problem using the built in tools and frame blending. a duplicate 7th frame may not even be noticeable when played back at full speed.

          • 2. Re: every 7th frame is a duplicate of the 6th
            chrisw44157881 Level 4

            how are you slowing it down? if you're using whole frames to slow it down, adobe itself will duplicate frames to fill in the blanks! Does it play fine in a media player at normal speed? That should give an indication where the problem lies.

            • 3. Re: every 7th frame is a duplicate of the 6th
              nickn35634941 Level 1

              Sorry, I meant that slowing it down drew my attention to the duplicate frames, I need to edit my post for clarification.

               

              When I look at the original footage in an AFX comp with the same framerate as the source, without doing anything to it, I am seeing the duplicate frames.

              • 4. Re: every 7th frame is a duplicate of the 6th
                Rick Gerard Adobe Community Professional & MVP

                The expression I provided will remove the duplicate frames from your original source files. Just create a new comp from the footage, enable time remapping, add the expression, then adjust the starting position of the first duplicate frame so that it falls on the comp frame #7.

                 

                For example if your first duplicate frame was frame #3 then position the CTI on frame number 7 and slide the footage in the timeline until the duplicate frame was under the CTI then apply the expression. This will remove every duplicate frame as long as they are exactly 7 frames apart.

                • 5. Re: every 7th frame is a duplicate of the 6th
                  nickn35634941 Level 1

                  Hi Rick,

                   

                  Thanks as usual for the fast response, I tried your script as advised but it seems to be making my footage skip multiple frames every frame..

                  timeremap.jpg

                  • 6. Re: every 7th frame is a duplicate of the 6th
                    Rick Gerard Adobe Community Professional & MVP

                    Sorry. Forgot to correct frames for time. Try this:

                    n = 7 // frame number to skip

                    s = thisComp.frameDuration * n;

                    sf = Math.floor(time/s);

                    fr = time/thisComp.frameDuration;

                    thisComp.frameDuration*(fr + sf)

                    1 person found this helpful
                    • 7. Re: every 7th frame is a duplicate of the 6th
                      Rick Gerard Adobe Community Professional & MVP

                      That's what I get for doing expressions in my head.

                      • 8. Re: every 7th frame is a duplicate of the 6th
                        nickn35634941 Level 1

                        Thanks, I tried this new version;

                        the first 2 frames of the footage are the same, so I tried your script with the footage starting at 7th frame in, and I tried it with the second frame on the 7th comp frame, in both cases, it starts skipping normal frames, and keeping duplicate frames after the 20th frame.

                        This doesn't make sense, shouldn't I get different results depending on what time the footage is placed, as you said?

                        when the footage is in the position shown in my last attached image, frame 20 is a duplicate of 19 and theres a noticeable jump between frame 21 and 22.

                        When I move the footage one frame to the right, so it starts at frame 6, the exact same thing happens, 20 is a dupe and jump is between 21 and 22.

                         

                        It probably makes it sound like my footage is not duplicating frames at uniform time intervals, but its nearly 20 minutes long and I've skipped to various sections, including right near the end, and every 7th frame is still a dupe of the 6th

                        • 9. Re: every 7th frame is a duplicate of the 6th
                          Rick Gerard Adobe Community Professional & MVP

                          This is starting to sound more to me like a decoding error. Try rendering your footage to an image sequence using the Adobe media encoder her and check for duplicates frames.

                           

                          If you change your time display to frames and check the frame numbers in the time remapping property you'll see that every seventh frame is skipped. Time remapping should show frame six when the timeline shows frame six and frame eight when the timeline shows frame seven. 14  should be 16, 21 should be 19.

                           

                          You can change the time display of the timeline by holding down the ctrl/command key and clicking on the timecode display.

                          1 person found this helpful
                          • 10. Re: every 7th frame is a duplicate of the 6th
                            chrisw44157881 Level 4

                            I modified dan ebbert's script. if this doesn't work, consider transcoding before importing into AE. btw, does it play ok in quicktime?

                             

                            If you really want to remove every 7th frame, you could use a Time Remapping expression like this:

                            n = 7; // skip every nth frame

                            frameToSkip = 0; // 0,1,2 ...n-1

                            currFrame = Math.round(time/thisComp.frameDuration);

                            currFrame += Math.floor((currFrame - frameToSkip)/(n-1)) + 1;

                            framesToTime(currFrame);

                             

                             

                            De-converting NTSC to PAL : Adobe After Effects Expressions

                            1 person found this helpful
                            • 11. Re: every 7th frame is a duplicate of the 6th
                              Rick Gerard Adobe Community Professional & MVP

                              Either expression would work.

                              • 12. Re: every 7th frame is a duplicate of the 6th
                                chrisw44157881 Level 4

                                im only brining it up because  there was a bug introduced in AE CS5.5. His fix was to "roll your own" time-to-frames function.

                                • 13. Re: every 7th frame is a duplicate of the 6th
                                  nickn35634941 Level 1

                                  Hi guys,

                                   

                                  Good news. I was finally sent the original footage straight from the camera, it was 50fps and theres no dupes this time.

                                   

                                  I'm really busy now so I only quickly pasted in Chris' code, it seemed to behave same way as Rick's but like I said I literally just pasted it in and checked around 30 frames and I didn't play around with start frame etc.

                                  Might have some time week after next to check the footage in another media player, its a pretty curious case for me.

                                  1 person found this helpful
                                  • 14. Re: every 7th frame is a duplicate of the 6th
                                    Rick Gerard Adobe Community Professional & MVP

                                    Just as I expected, bad transcoding by someone that did not know what they're doing. You'll have a lot better luck slowing drown 50 frame per second footage especially in a 25  24 even 29.97 comp.

                                    • 15. Re: every 7th frame is a duplicate of the 6th
                                      adamneer Level 2

                                      I've come across this exact issue before as well and what really sucks is that the Duplicate Detective script used to work great until CC2014, at which point the developer stopped updating it. His other script Edit Detective still works great and sees consistent updates, but for whatever reason, he gave up on what I thought was a highly useful script. You can't always count on people to do their jobs properly before handing off footage, it's nice to have easy fixes when you need them.