guacamole-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Roman (JIRA)" <j...@apache.org>
Subject [jira] [Commented] (GUACAMOLE-110) Guacenc framerate rounding results in incorrect video length
Date Mon, 03 Oct 2016 15:54:20 GMT

    [ https://issues.apache.org/jira/browse/GUACAMOLE-110?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=15542726#comment-15542726
] 

Roman commented on GUACAMOLE-110:
---------------------------------

Hi Michael,
Sure thing, https://github.com/apache/incubator-guacamole-server/pull/22

> Guacenc framerate rounding results in incorrect video length
> ------------------------------------------------------------
>
>                 Key: GUACAMOLE-110
>                 URL: https://issues.apache.org/jira/browse/GUACAMOLE-110
>             Project: Guacamole
>          Issue Type: Bug
>          Components: guacamole-server
>            Reporter: Roman
>
> guacenc produces video shorter than the actual length (based on the timestamps in the
input file). In one of my tests: 16s vs 22s. This is caused by timestamp deltas being rounded
to frames in guacenc_video_advance_timeline.
> Sample patch:
> {code:none}
> @@ -209,6 +209,8 @@
>  int guacenc_video_advance_timeline(guacenc_video* video,
>          guac_timestamp timestamp) {
>  
> +    guac_timestamp next_timestamp = timestamp;
> +
>      /* Flush frames as necessary if previously updated */
>      if (video->last_timestamp != 0) {
>  
> @@ -219,6 +221,10 @@
>          /* Keep previous timestamp if insufficient time has elapsed */
>          if (elapsed == 0)
>              return 0;
> +
> +        /* Use frame time, not the current timestamp for last_timestamp */
> +        next_timestamp = video->last_timestamp
> +                       + elapsed * 1000 / GUACENC_VIDEO_FRAMERATE;
>  
>          /* Flush frames to bring timeline in sync, duplicating if necessary */
>          do {
> @@ -228,7 +234,7 @@
>      }
>  
>      /* Update timestamp */
> -    video->last_timestamp = timestamp;
> +    video->last_timestamp = next_timestamp;
>      return 0;
>  
>  }
> {code}



--
This message was sent by Atlassian JIRA
(v6.3.4#6332)

Mime
View raw message