Add detection of container/video_codec/audio_codec compatibility for live file streaming or transcoding (#384)

* add forceMKV, forceHEVC config options
* drop audio stream instead of trying to transcode for ffmpeg unsupported/unknown audio codecs
This commit is contained in:
bnkai
2020-04-10 01:38:34 +03:00
committed by GitHub
parent dc37a3045b
commit d5617307f1
21 changed files with 632 additions and 60 deletions

View File

@@ -50,10 +50,10 @@ func (qb *SceneQueryBuilder) Create(newScene Scene, tx *sqlx.Tx) (*Scene, error)
ensureTx(tx)
result, err := tx.NamedExec(
`INSERT INTO scenes (checksum, path, title, details, url, date, rating, size, duration, video_codec,
audio_codec, width, height, framerate, bitrate, studio_id, cover,
audio_codec, format, width, height, framerate, bitrate, studio_id, cover,
created_at, updated_at)
VALUES (:checksum, :path, :title, :details, :url, :date, :rating, :size, :duration, :video_codec,
:audio_codec, :width, :height, :framerate, :bitrate, :studio_id, :cover,
:audio_codec, :format, :width, :height, :framerate, :bitrate, :studio_id, :cover,
:created_at, :updated_at)
`,
newScene,
@@ -534,3 +534,16 @@ func (qb *SceneQueryBuilder) queryScenes(query string, args []interface{}, tx *s
return scenes, nil
}
func (qb *SceneQueryBuilder) UpdateFormat(id int, format string, tx *sqlx.Tx) error {
ensureTx(tx)
_, err := tx.Exec(
`UPDATE scenes SET format = ? WHERE scenes.id = ? `,
format, id,
)
if err != nil {
return err
}
return nil
}