none
Powerpoint get frame numbers for slides and animations in exported video RRS feed

  • Question

  • Hi all, 

    I'm hoping someone can help me out, I'm trying to get the exact frames of the slides and their transitions / animations etc. from the exported movie. 

    I have gotten close by exporting as a 25fps wmv video and using VB to create a 2D array based on [SlideIndex][Animation Durations In Seconds] when the presentations are simple slides that display for 1 second this is ok (as I've told the video exported to give each slide a 1 second duration) but when transitions are used with durations that aren't rounded to whole seconds the frames get exponentially more unstable. 

    Below is my VB code I'm currently using, I feel like I'm missing some extra form of animation or am rounding incorrectly etc (I round to nearest frame currently, don't use floor / ceiling etc)

    For example, if I have a video export that is 29.36 seconds and 734 frames, my exported array times might give me a video 29.3 seconds long with 732 frames so somewhere in the presentation the slides go out of place, i.e. I get the last frame from one slide where I should be getting the start frame of the next

    If anybody has any suggestions of what to change or a better way to get this information that would be greatly appreciated :)

    Thanks!

    Lisa

    Sub SlideInfo()
        Dim sl As Slide
        Dim ef As Effect
        Dim shp As Shape
        Dim js As String
        Dim co As Integer
        Dim jpath As String
        Dim debugPrintOut As String
    
        jpath = ActivePresentation.Path
        jpath = jpath & "\js_array.js"
    
        co = 0
        js = "["
        
        debugPrintOut = debugPrintOut & "Slides range: " & CStr(ActivePresentation.Slides.Range.Count) & vbCrLf
        
        For Each sl In ActivePresentation.Slides.Range
            co = co + 1
    
            Dim doesSlideHaveOpeningAnim As Boolean
            doesSlideHaveOpeningAnim = False
    
            debugPrintOut = debugPrintOut & "No: " & CStr(co) & vbCrLf
            ' Check that the slide is not hidden
            
            If sl.SlideShowTransition.Hidden = False Then
                ' Where the important stuff happens
               
                If sl.SlideShowTransition.Duration > 0 Then
                    js = js & "[" & sl.SlideShowTransition.Duration
                    doesSlideHaveOpeningAnim = True
                End If
        
                If sl.TimeLine.MainSequence.Count > 0 Then
                    debugPrintOut = debugPrintOut & vbTab & "Inner slide annimation found" & vbCrLf
                    For Each ef In sl.TimeLine.MainSequence
                        js = js & "," & ef.Timing.Duration
                    Next ef
                Else
                    If doesSlideHaveOpeningAnim = True Then
                        debugPrintOut = debugPrintOut & vbTab & "No Inner slide annimation found but opening animation found" & vbCrLf
                        js = js & ", 1"
                    Else
                        js = js & "[" & 1
                    End If
                End If
        
                For Each shp In sl.Shapes
                    If shp.Type = msoMedia Then
                        js = js & "," & (shp.MediaFormat.Length / 1000)
                    End If
                Next shp
        
                js = js & "]"
                If co <> ActivePresentation.Slides.Range.Count Then
                    js = js & ","
                End If
            Else
                 debugPrintOut = debugPrintOut & vbTab & "Hidden" & vbCrLf
            End If
        Next sl
    
        js = js & "]"
        Debug.Print "Path: " & jpath
        Debug.Print js
        MsgBox debugPrintOut
    End Sub
    


    • Moved by Steve Fan Wednesday, July 20, 2016 8:28 AM VB code
    Tuesday, July 19, 2016 1:20 PM

All replies