mirror of
https://github.com/u2takey/ffmpeg-go.git
synced 2025-10-05 07:56:51 +08:00
ProbeReader (Probe but accepts io.Reader)
This commit is contained in:
20
probe_reader_test.go
Normal file
20
probe_reader_test.go
Normal file
@@ -0,0 +1,20 @@
|
||||
package ffmpeg_go
|
||||
|
||||
import (
|
||||
"fmt"
|
||||
"os"
|
||||
"testing"
|
||||
|
||||
"github.com/stretchr/testify/assert"
|
||||
)
|
||||
|
||||
func TestProbeReader(t *testing.T) {
|
||||
f, err := os.Open(TestInputFile1)
|
||||
assert.Nil(t, err)
|
||||
|
||||
data, err := ProbeReader(f, nil)
|
||||
assert.Nil(t, err)
|
||||
duration, err := probeOutputDuration(data)
|
||||
assert.Nil(t, err)
|
||||
assert.Equal(t, fmt.Sprintf("%f", duration), "7.036000")
|
||||
}
|
Reference in New Issue
Block a user