mirror of
https://github.com/jellyfin/jellyfin.git
synced 2026-08-04 07:02:58 +00:00
add aac_adtstoasc bitstream filter for mpegts to mp4 conversion
This commit is contained in:
parent
536b054873
commit
32bb73acbb
3 changed files with 66 additions and 7 deletions
|
|
@ -596,10 +596,17 @@ namespace MediaBrowser.Controller.MediaEncoding
|
|||
|| codec.IndexOf("hevc", StringComparison.OrdinalIgnoreCase) != -1;
|
||||
}
|
||||
|
||||
// TODO This is auto inserted into the mpegts mux so it might not be needed
|
||||
// https://www.ffmpeg.org/ffmpeg-bitstream-filters.html#h264_005fmp4toannexb
|
||||
public bool IsAAC(MediaStream stream)
|
||||
{
|
||||
var codec = stream.Codec ?? string.Empty;
|
||||
|
||||
return codec.IndexOf("aac", StringComparison.OrdinalIgnoreCase) != -1;
|
||||
}
|
||||
|
||||
public string GetBitStreamArgs(MediaStream stream)
|
||||
{
|
||||
// TODO This is auto inserted into the mpegts mux so it might not be needed
|
||||
// https://www.ffmpeg.org/ffmpeg-bitstream-filters.html#h264_005fmp4toannexb
|
||||
if (IsH264(stream))
|
||||
{
|
||||
return "-bsf:v h264_mp4toannexb";
|
||||
|
|
@ -608,6 +615,11 @@ namespace MediaBrowser.Controller.MediaEncoding
|
|||
{
|
||||
return "-bsf:v hevc_mp4toannexb";
|
||||
}
|
||||
else if (IsAAC(stream))
|
||||
{
|
||||
// convert adts header(mpegts) to asc header(mp4)
|
||||
return "-bsf:a aac_adtstoasc";
|
||||
}
|
||||
else
|
||||
{
|
||||
return null;
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue