[FFmpeg-trac] #10332(undetermined:new): Transcodes using hevc_nvenc not copying audio as expected to the output
FFmpeg
trac at avcodec.org
Sun Apr 23 23:11:22 EEST 2023
#10332: Transcodes using hevc_nvenc not copying audio as expected to the output
-------------------------------------+-------------------------------------
Reporter: Jordan | Owner: (none)
Fearnley |
Type: defect | Status: new
Priority: minor | Component:
| undetermined
Version: git-master | Resolution:
Keywords: | Blocked By:
Blocking: | Reproduced by developer: 0
Analyzed by developer: 0 |
-------------------------------------+-------------------------------------
Description changed by Jordan Fearnley:
Old description:
> **Summary of the bug:**
>
> Since commit 9a245bdf5d7860b8bc5e5c21a105a075925b719a, transcodes using
> `-c:v hevc_nvenc -c:a copy` do not appear to copy over audio in the exact
> same manner as it did previously. In some limited playback scenarios, the
> resulting transcoded file's audio track can end up not being played at
> all.
>
> **How the bug was discovered:**
>
> Audio playback issues were encountered when playing a file via Jellyfin
> on an LG TV. I could not reproduce this playback issue on any other
> client as impacted transcodes playback fine on players tested on my PC,
> and even playback fine when served via Jellyfin on a android client. The
> impacted transcodes have all had a source framerate of 23.98fps.
>
> When using `ffprobe -show_streams -select_streams a` to try diagnose the
> issue, I observed that when the audio was 'copied' over during the
> transcode, any impacted files would have the profile set to `unknown`,
> rather than the expected (in this situation) value of `LC`.
>
> Additionally, the `ffprobe` output also indicated that the values for
> `duration_ts` & `duration` went from `N/A` in non-impacted files, to the
> actual expected values in impacted files.
>
> **Available logfile output:**
>
> https://gist.github.com/fearnlj01/e1a72c2b3aaa9666922bd4106efcb3d8
>
> This gist contains 4x files, as listed below. I can attach these directly
> to the bug report directly if need be.
>
> `nvenc-audioprofile-unknown-probe.log` | Impacted transcode, ffprobe
> audio stream output
> `nvenc-audioprofile-unknown-ffmpeg.log` | Impacted transcode, ffmpeg
> output
>
> `nvenc-audioprofile-aac_lc-ffmepg.log` | Non-impacted transcode, ffprobe
> audio stream output
> `nvenc-audioprofile-aac_lc-probe.log` | Non-impacted transcode, ffmpeg
> output
>
> I also have the 30s source file used for the above transcodes which I
> will try to attach to the ticket with filename of `nvenc-audioprofile-
> source.mkv`.
>
> **Steps for reproduction of the issue:**
>
> Note that the issue seems to only appear when using NVENC, so an
> appropriately capable gpu would be required to reproduce. This should, at
> the least, be specifically reproducible when using an Nvidia GeForce RTX
> 3060 Ti.
>
> - Using a build of ffmpeg from before commit
> 9a245bdf5d7860b8bc5e5c21a105a075925b719a:
> {{{ ffmpeg -i nvenc-audioprofile-source.mkv -c:v
> hevc_nvenc -c:a copy -y -f matroska output.mkv" }}}
> - Using `ffprobe -show_streams -select_streams a output.mkv`, verify that
> the output file has the expected encoding profile set for the audio
> stream
>
> - Using a build of ffmpeg which includes the aforementioned commit:
> {{{ ffmpeg -i nvenc-audioprofile-source.mkv -c:v
> hevc_nvenc -c:a copy -y -f matroska output.mkv" }}}
> - Using `ffprobe -show_streams -select_streams a output.mkv`, verify that
> the output file **does not** have the expected encoding profile set for
> the audio stream
>
> I am unsure as to what steps can be taken to reproduce the core issue of
> the audio track not being used for playback, however I suspect that this
> would be out of scope for FFMPEG even if easily reproducible. I would
> however expect that `ffprobe` should be able to show the audio encoding
> profile not as `unknown`, especially when copying from an AAC source with
> profile `LC`.
New description:
**Summary of the bug:**
Since commit 9a245bdf5d7860b8bc5e5c21a105a075925b719a, transcodes using
`-c:v hevc_nvenc -c:a copy` do not appear to copy over audio in the exact
same manner as it did previously. In some limited playback scenarios, the
resulting transcoded file's audio track can end up not being played at
all.
**How the bug was discovered:**
Audio playback issues were encountered when playing a file via Jellyfin on
an LG TV. I could not reproduce this playback issue on any other client as
impacted transcodes playback fine on players tested on my PC, and even
playback fine when served via Jellyfin on a android client. The impacted
transcodes have all had a source framerate of 23.98fps.
When using `ffprobe -show_streams -select_streams a` to try diagnose the
issue, I observed that when the audio was 'copied' over during the
transcode, any impacted files would have the profile set to `unknown`,
rather than the expected (in this situation) value of `LC`.
Additionally, the `ffprobe` output also indicated that the values for
`duration_ts` & `duration` went from `N/A` in non-impacted files, to the
actual expected values in impacted files.
**Available logfile output:**
https://gist.github.com/fearnlj01/e1a72c2b3aaa9666922bd4106efcb3d8
This gist contains 4x files, as listed below. These files have also been
attached to this ticket.
`nvenc-audioprofile-unknown-probe.log` | Impacted transcode, ffprobe audio
stream output
`nvenc-audioprofile-unknown-ffmpeg.log` | Impacted transcode, ffmpeg
output
`nvenc-audioprofile-aac_lc-ffmepg.log` | Non-impacted transcode, ffprobe
audio stream output
`nvenc-audioprofile-aac_lc-probe.log` | Non-impacted transcode, ffmpeg
output
I also have the 30s source file used for the above transcodes which I will
try to attach to the ticket with filename of `nvenc-audioprofile-
source.mkv`.
**Steps for reproduction of the issue:**
Note that the issue seems to only appear when using NVENC, so an
appropriately capable gpu would be required to reproduce. This should, at
the least, be specifically reproducible when using an Nvidia GeForce RTX
3060 Ti.
- Using a build of ffmpeg from before commit
9a245bdf5d7860b8bc5e5c21a105a075925b719a:
{{{ ffmpeg -i nvenc-audioprofile-source.mkv -c:v
hevc_nvenc -c:a copy -y -f matroska output.mkv" }}}
- Using `ffprobe -show_streams -select_streams a output.mkv`, verify that
the output file has the expected encoding profile set for the audio stream
- Using a build of ffmpeg which includes the aforementioned commit:
{{{ ffmpeg -i nvenc-audioprofile-source.mkv -c:v
hevc_nvenc -c:a copy -y -f matroska output.mkv" }}}
- Using `ffprobe -show_streams -select_streams a output.mkv`, verify that
the output file **does not** have the expected encoding profile set for
the audio stream
I am unsure as to what steps can be taken to reproduce the core issue of
the audio track not being used for playback, however I suspect that this
would be out of scope for FFMPEG even if easily reproducible. I would
however expect that `ffprobe` should be able to show the audio encoding
profile not as `unknown`, especially when copying from an AAC source with
profile `LC`.
--
--
Ticket URL: <https://trac.ffmpeg.org/ticket/10332#comment:1>
FFmpeg <https://ffmpeg.org>
FFmpeg issue tracker
More information about the FFmpeg-trac
mailing list