Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Possible bugs with (clip ...) #64

Open
srfoster opened this issue Mar 16, 2019 · 2 comments
Open

Possible bugs with (clip ...) #64

srfoster opened this issue Mar 16, 2019 · 2 comments

Comments

@srfoster
Copy link

srfoster commented Mar 16, 2019

I'm getting some confusing behavior with (clip ...) -- both when I (preview ...) and when I (render ...).

Here, I expected the previewer to show me a 1-second clip that starts at the 10-second mark of my original clip and ends at the 11-second mark of the original.

#lang racket

(require video/base video/player video/render)

(define m (clip "original.mp4"
                #:start 10 
                #:length 1))

(preview m)

Instead, it shows me a 1-second clip starting at the 0-second mark of my original.

The behavior with (render ...) is different, but also unexpected. Again, I expected the previewer to show me a 1-second clip that starts at the 10-second mark of my original clip and ends at the 11-second mark of the original.

#lang racket

(require video/base video/player video/render)

(define m (clip "original.mp4"
                #:start 10 
                #:length 1))

(render m "out.mp4" #:width 640 #:height 480)

Instead, I get a 10 second clip that actually does start at the right spot (the 10-second mark), and it has the 1-second of footage. But it seems to be padded at the end, making the clip 10-seconds long.

> ffmpeg -i out.mp4 2>&1 | grep "Duration"
Duration: 00:00:10.96, start: 0.000000, bitrate: 25 kb/s

I should mention that I'm on the #stable branch. I'm about to retry with the most recent version.

@srfoster
Copy link
Author

On #master, I get slightly different results -- but it still doesn't feel quite right.

#lang racket

(require video/base video/player video/render)

(define m (clip "original.mp4"
                #:start 10 
                #:length 1))

(render m "out.mp4" #:width 640 #:height 480)

This gives me an output file that begins with the 1-second bit that I wanted, but it appears to be padded with a bunch of blackness at the end. The file is about 30-minutes long -- the same length as my original.mp4.

>ffmpeg -i out.mp4 2>&1 | grep "Duration"
Duration: 00:29:21.34, start: 0.000000, bitrate: 0 kb/s

As for the previewer, it seems to have the same bug as on #stable: it just shows me a 1-second clip starting at the very beginning of my original.mp4 rather than the 10-second mark.

@khinsen
Copy link

khinsen commented Sep 21, 2020

Just installed video-testing with Racket 7.8 CS under macOS 10.14, and having similar issues.

The preview always starts at 0, no matter what I give for #:start.

What the previewer player shows as the current position oscillates rapidly between a credible value and something that looks random.

Trying to preview a playlist consisting of a few clip producers (which all work individually) runs out of memory inside DrRacket. From a plain Racket REPL,

(require video/player)
(preview vid)

opens a player with a black image area and then crashes:

; in-vertices: vertex #f not in graph #<weighted-graph>
; Context:
;  .../graph/graph-weighted.rkt:191:0 in-weighted-graph-neighbors
;  .../graph/graph-fns-basic.rkt:57:4 for-loop
;  .../graph/graph-fns-basic.rkt:46:0 bfs/generalized
;  .../private/ffmpeg-pipeline.rkt:1650:0 get-seek-point
;  .../private/ffmpeg-pipeline.rkt:1291:0 init-filter-graph
;  .../video/render.rkt:515:7
;  .../video/player.rkt:103:4 !play method in video-player-server%
;  .../video/player.rkt:458:0 preview
;  .../private/arrow-val-first.rkt:555:3

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants