mirror of
https://github.com/jellyfin/jellyfin.git
synced 2025-12-15 21:43:03 +03:00
add aac_adtstoasc bitstream filter for mpegts to mp4 conversion
This commit is contained in:
@@ -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;
|
||||
|
||||
Reference in New Issue
Block a user