mirror of
https://github.com/giongto35/cloud-game.git
synced 2026-01-23 02:34:42 +00:00
Add some notes on recording in regards to ffconcat
This commit is contained in:
parent
f78bcf3e4b
commit
0c768bb3d6
3 changed files with 28 additions and 12 deletions
|
|
@ -15,17 +15,6 @@ type RecordingFrontend struct {
|
|||
}
|
||||
|
||||
func WithRecording(fe Emulator, rec bool, user string, game string, conf config.Recording, log *logger.Logger) *RecordingFrontend {
|
||||
|
||||
pix := ""
|
||||
switch fe.PixFormat() {
|
||||
case 0:
|
||||
pix = "rgb1555"
|
||||
case 1:
|
||||
pix = "brga"
|
||||
case 2:
|
||||
pix = "rgb565"
|
||||
}
|
||||
|
||||
rr := &RecordingFrontend{Emulator: fe, rec: recorder.NewRecording(
|
||||
recorder.Meta{UserName: user},
|
||||
log,
|
||||
|
|
@ -36,7 +25,6 @@ func WithRecording(fe Emulator, rec bool, user string, game string, conf config.
|
|||
Zip: conf.Zip,
|
||||
Vsync: true,
|
||||
Flip: fe.Flipped(),
|
||||
Pix: pix,
|
||||
})}
|
||||
rr.ToggleRecording(rec, user)
|
||||
return rr
|
||||
|
|
@ -70,6 +58,7 @@ func (r *RecordingFrontend) LoadGame(path string) error {
|
|||
}
|
||||
r.rec.SetFramerate(float64(r.Emulator.FPS()))
|
||||
r.rec.SetAudioFrequency(r.Emulator.AudioSampleRate())
|
||||
r.rec.SetPixFormat(r.Emulator.PixFormat())
|
||||
return nil
|
||||
}
|
||||
|
||||
|
|
|
|||
|
|
@ -17,6 +17,21 @@ const demuxFile = "input.txt"
|
|||
//
|
||||
// !to change
|
||||
//
|
||||
// - can't read pix_fmt from ffconcat
|
||||
// - maybe change raw output to yuv420?
|
||||
// - frame durations and size can change dynamically
|
||||
// - or maybe merge encoded streams
|
||||
//
|
||||
// new:
|
||||
//
|
||||
// ffmpeg -f image2 -framerate 59 -video_size 384x224 -pixel_format rgb565le \
|
||||
// -i "./f%07d__384x224__768.raw" \
|
||||
// -ac 2 -channel_layout stereo -i audio.wav -b:a 192K \
|
||||
// -c:v libx264 -pix_fmt yuv420p -crf 20 \
|
||||
// output.mp4
|
||||
//
|
||||
// old:
|
||||
//
|
||||
// ffmpeg -f concat -i input.txt \
|
||||
// -ac 2 -channel_layout stereo -i audio.wav \
|
||||
// -b:a 192K -crf 23 -vf fps=30 -pix_fmt yuv420p \
|
||||
|
|
|
|||
|
|
@ -165,6 +165,18 @@ func (r *Recording) Set(enable bool, user string) {
|
|||
|
||||
func (r *Recording) SetFramerate(fps float64) { r.opts.Fps = fps }
|
||||
func (r *Recording) SetAudioFrequency(fq int) { r.opts.Frequency = fq }
|
||||
func (r *Recording) SetPixFormat(fmt uint32) {
|
||||
pix := ""
|
||||
switch fmt {
|
||||
case 0:
|
||||
pix = "rgb1555"
|
||||
case 1:
|
||||
pix = "brga"
|
||||
case 2:
|
||||
pix = "rgb565le"
|
||||
}
|
||||
r.opts.Pix = pix
|
||||
}
|
||||
|
||||
func (r *Recording) Enabled() bool {
|
||||
r.Lock()
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue