Skip to content

Commit

Permalink
Updates before PR
Browse files Browse the repository at this point in the history
  • Loading branch information
leszko committed Aug 29, 2023
1 parent 8396865 commit 3948710
Show file tree
Hide file tree
Showing 7 changed files with 16 additions and 59 deletions.
6 changes: 2 additions & 4 deletions ffmpeg/ffmpeg.go
Original file line number Diff line number Diff line change
Expand Up @@ -423,15 +423,14 @@ func Transcode(input string, workDir string, ps []VideoProfile) error {
opt := TranscodeOptions{
Oname: oname,
Profile: param,
Accel: Nvidia,
Accel: Software,
}
opts[i] = opt
}
inopts := &TranscodeOptionsIn{
Fname: input,
Accel: Nvidia,
Accel: Software,
}
fmt.Printf("inopts: %v, opts: %v\n", inopts, opts)
return Transcode2(inopts, opts)
}

Expand Down Expand Up @@ -939,7 +938,6 @@ func (t *Transcoder) Transcode(input *TranscodeOptionsIn, ps []TranscodeOptions)
}
// Output configuration
params, finalizer, err := createCOutputParams(input, ps)
fmt.Printf("Output configuration, input: %v, ps: %v, params: %v\n", input, ps, params)
// This prevents C memory leaks
defer finalizer()
// Only now can we do this
Expand Down
9 changes: 0 additions & 9 deletions ffmpeg/ffmpeg_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -155,15 +155,6 @@ func TestSegmenter_DropLatePackets(t *testing.T) {
run(cmd)
}

func TestTranscoder_Quality(t *testing.T) {
err := Transcode(
"/home/rafal/lpms/test/input/chrome/0.ts", "/home/rafal/lpms/test/output/chrome/",
[]VideoProfile{CatalystDefault})
if err != nil {
t.Error(err)
}
}

func TestTranscoder_UnevenRes(t *testing.T) {
// Ensure transcoding still works on input with uneven resolutions
// and that aspect ratio is maintained
Expand Down
42 changes: 14 additions & 28 deletions ffmpeg/videoprofile.go
Original file line number Diff line number Diff line change
Expand Up @@ -106,34 +106,20 @@ type VideoProfile struct {

// Some sample video profiles
var (
P720p60fps16x9 = VideoProfile{Name: "P720p60fps16x9", Bitrate: "6000k", Framerate: 60, AspectRatio: "16:9", Resolution: "1280x720"}
P720p30fps16x9 = VideoProfile{Name: "P720p30fps16x9", Bitrate: "4000k", Framerate: 30, AspectRatio: "16:9", Resolution: "1280x720"}
P720p25fps16x9 = VideoProfile{Name: "P720p25fps16x9", Bitrate: "3500k", Framerate: 25, AspectRatio: "16:9", Resolution: "1280x720"}
P720p30fps4x3 = VideoProfile{Name: "P720p30fps4x3", Bitrate: "3500k", Framerate: 30, AspectRatio: "4:3", Resolution: "960x720"}
P576p30fps16x9 = VideoProfile{Name: "P576p30fps16x9", Bitrate: "1500k", Framerate: 30, AspectRatio: "16:9", Resolution: "1024x576"}
P576p25fps16x9 = VideoProfile{Name: "P576p25fps16x9", Bitrate: "1500k", Framerate: 25, AspectRatio: "16:9", Resolution: "1024x576"}
P360p30fps16x9 = VideoProfile{Name: "P360p30fps16x9", Bitrate: "1200k", Framerate: 30, AspectRatio: "16:9", Resolution: "640x360"}
P360p25fps16x9 = VideoProfile{Name: "P360p25fps16x9", Bitrate: "1000k", Framerate: 25, AspectRatio: "16:9", Resolution: "640x360"}
P360p30fps4x3 = VideoProfile{Name: "P360p30fps4x3", Bitrate: "1000k", Framerate: 30, AspectRatio: "4:3", Resolution: "480x360"}
P240p30fps16x9 = VideoProfile{Name: "P240p30fps16x9", Bitrate: "600k", Framerate: 30, AspectRatio: "16:9", Resolution: "426x240"}
P240p25fps16x9 = VideoProfile{Name: "P240p25fps16x9", Bitrate: "600k", Framerate: 25, AspectRatio: "16:9", Resolution: "426x240"}
P240p30fps4x3 = VideoProfile{Name: "P240p30fps4x3", Bitrate: "600k", Framerate: 30, AspectRatio: "4:3", Resolution: "320x240"}
P144p30fps16x9 = VideoProfile{Name: "P144p30fps16x9", Bitrate: "400k", Framerate: 30, AspectRatio: "16:9", Resolution: "256x144"}
P144p25fps16x9 = VideoProfile{Name: "P144p25fps16x9", Bitrate: "400k", Framerate: 25, AspectRatio: "16:9", Resolution: "256x144"}
CatalystDefault = VideoProfile{
Name: "720p0",
// Check what Catalyst sends for FPS
//FPS: 0,
// Check what Catalyst sends for Bitrate
//Bitrate: 1_000_000,
Bitrate: "1000k",
Resolution: "1280x720",
// Check if these values are what Catalyst sends
Framerate: 30,
AspectRatio: "16:9",
CRF: 23,
Profile: ProfileH264High,
}
P720p60fps16x9 = VideoProfile{Name: "P720p60fps16x9", Bitrate: "6000k", Framerate: 60, AspectRatio: "16:9", Resolution: "1280x720"}
P720p30fps16x9 = VideoProfile{Name: "P720p30fps16x9", Bitrate: "4000k", Framerate: 30, AspectRatio: "16:9", Resolution: "1280x720"}
P720p25fps16x9 = VideoProfile{Name: "P720p25fps16x9", Bitrate: "3500k", Framerate: 25, AspectRatio: "16:9", Resolution: "1280x720"}
P720p30fps4x3 = VideoProfile{Name: "P720p30fps4x3", Bitrate: "3500k", Framerate: 30, AspectRatio: "4:3", Resolution: "960x720"}
P576p30fps16x9 = VideoProfile{Name: "P576p30fps16x9", Bitrate: "1500k", Framerate: 30, AspectRatio: "16:9", Resolution: "1024x576"}
P576p25fps16x9 = VideoProfile{Name: "P576p25fps16x9", Bitrate: "1500k", Framerate: 25, AspectRatio: "16:9", Resolution: "1024x576"}
P360p30fps16x9 = VideoProfile{Name: "P360p30fps16x9", Bitrate: "1200k", Framerate: 30, AspectRatio: "16:9", Resolution: "640x360"}
P360p25fps16x9 = VideoProfile{Name: "P360p25fps16x9", Bitrate: "1000k", Framerate: 25, AspectRatio: "16:9", Resolution: "640x360"}
P360p30fps4x3 = VideoProfile{Name: "P360p30fps4x3", Bitrate: "1000k", Framerate: 30, AspectRatio: "4:3", Resolution: "480x360"}
P240p30fps16x9 = VideoProfile{Name: "P240p30fps16x9", Bitrate: "600k", Framerate: 30, AspectRatio: "16:9", Resolution: "426x240"}
P240p25fps16x9 = VideoProfile{Name: "P240p25fps16x9", Bitrate: "600k", Framerate: 25, AspectRatio: "16:9", Resolution: "426x240"}
P240p30fps4x3 = VideoProfile{Name: "P240p30fps4x3", Bitrate: "600k", Framerate: 30, AspectRatio: "4:3", Resolution: "320x240"}
P144p30fps16x9 = VideoProfile{Name: "P144p30fps16x9", Bitrate: "400k", Framerate: 30, AspectRatio: "16:9", Resolution: "256x144"}
P144p25fps16x9 = VideoProfile{Name: "P144p25fps16x9", Bitrate: "400k", Framerate: 25, AspectRatio: "16:9", Resolution: "256x144"}
)

var VideoProfileLookup = map[string]VideoProfile{
Expand Down
18 changes: 0 additions & 18 deletions test/input/hunter/output.m3u8

This file was deleted.

Binary file removed test/input/hunter/source/0.ts
Binary file not shown.
Binary file removed test/input/hunter/source/1.ts
Binary file not shown.
Binary file removed test/input/hunter/source/3.ts
Binary file not shown.

0 comments on commit 3948710

Please sign in to comment.