slhck / ffmpeg-normalize

Audio Normalization for Python/ffmpeg
MIT License
1.28k stars 118 forks source link

Track titles get removed #221

Closed joshinils closed 1 year ago

joshinils commented 1 year ago

Checklist

Expected behavior The titles of the individual tracks get copied over.

Actual behavior The names of the tracks get deleted, I don't know which are which. Names like "Surround 5.1" and "Surround 7.1" and "Commentary" get deleted, and I end up with multiple tracks of the same language code, no knowing what they are.

Command

ffmpeg-normalize -pr -f -ar "${sample_rate}" --extension $extension -c:a "${codec}" "${1}" -e "-strict -2" >> "${1}".log 2>&1

Any output you get when running the command with the --debug flag:

<add output here>

Environment (please complete the following information): Ubuntu 20.04.5 LTS Python 3.8.10

ffmpeg version 4.2.7-0ubuntu0.1 Copyright (c) 2000-2022 the FFmpeg developers
built with gcc 9 (Ubuntu 9.4.0-1ubuntu1~20.04.1)
configuration: --prefix=/usr --extra-version=0ubuntu0.1 --toolchain=hardened --libdir=/usr/lib/x86_64-linux-gnu --incdir=/usr/include/x86_64-linux-gnu --arch=amd64 --enable-gpl --disable-stripping --enable-avresample --disable-filter=resample --enable-avisynth --enable-gnutls --enable-ladspa --enable-libaom --enable-libass --enable-libbluray --enable-libbs2b --enable-libcaca --enable-libcdio --enable-libcodec2 --enable-libflite --enable-libfontconfig --enable-libfreetype --enable-libfribidi --enable-libgme --enable-libgsm --enable-libjack --enable-libmp3lame --enable-libmysofa --enable-libopenjpeg --enable-libopenmpt --enable-libopus --enable-libpulse --enable-librsvg --enable-librubberband --enable-libshine --enable-libsnappy --enable-libsoxr --enable-libspeex --enable-libssh --enable-libtheora --enable-libtwolame --enable-libvidstab --enable-libvorbis --enable-libvpx --enable-libwavpack --enable-libwebp --enable-libx265 --enable-libxml2 --enable-libxvid --enable-libzmq --enable-libzvbi --enable-lv2 --enable-omx --enable-openal --enable-opencl --enable-opengl --enable-sdl2 --enable-libdc1394 --enable-libdrm --enable-libiec61883 --enable-nvenc --enable-chromaprint --enable-frei0r --enable-libx264 --enable-shared
libavutil      56. 31.100 / 56. 31.100
libavcodec     58. 54.100 / 58. 54.100
libavformat    58. 29.100 / 58. 29.100
libavdevice    58.  8.100 / 58.  8.100
libavfilter     7. 57.100 /  7. 57.100
libavresample   4.  0.  0 /  4.  0.  0
libswscale      5.  5.100 /  5.  5.100
libswresample   3.  5.100 /  3.  5.100
libpostproc    55.  5.100 / 55.  5.100
slhck commented 1 year ago

Can you please include the debug output as requested?

joshinils commented 1 year ago

yes, it takes a long time to normalize a 10G file, when it is done i will add it

slhck commented 1 year ago

It could be that you're hitting this bug: https://github.com/slhck/ffmpeg-normalize/issues/107

In principle I just wanted to see the output of "ffmpeg -i input.mp4" to get an idea of the metadata. A small sample would be even better.

joshinils commented 1 year ago

here is the complete log; https://gist.github.com/joshinils/53c5bfba7d216b68ce10a66ea978bd98

joshinils commented 1 year ago

I just tried:

ffmpeg -i $title -map_metadata 0 -map 0 title.mp4

and with no different result

ffmpeg -i $title -map_metadata 0 -map 0 -codec copy title_copy.mp4

both of the outputs no longer contain the audio tracks titles

And it seems ffmpeg is indeed to blame for losing the track titles, ugh.

see the output of ffmpeg -i: https://gist.github.com/joshinils/2ededcb9f4f8be2091c31963ce167f2d

And mediainfo too shows a title for all three files (handbreak output and both variants above). This leads me to blame VLC for no longer showing the track title. Compared with the behavior of mpv — mpv shows no title for all three.

But since emby shows them correctly i don't care :)

I guess I could have a look into extracting, temporarily storing, and after normalizing re-adding the titles in my script which I call to normalize files automagically. If that is even possible.

slhck commented 1 year ago

Thanks for confirming. Just note that you have a somewhat older version of ffmpeg. Not that I think this is fixed in 5.1 but you might want to update.

joshinils commented 1 year ago

I just remuxed in handbrake to mkv, not mp4 and then normalized from mkv to mkv. now vlc does show the track title as before with the "Surround 5.1" not just the language (code).

weird that it depends on the container, but oh well somehow it has to be the fault of vlc.