jrottenberg / ffmpeg

Docker build for FFmpeg on Ubuntu / Alpine / Centos / Scratch / nvidia / vaapi
https://hub.docker.com/r/jrottenberg/ffmpeg/
Apache License 2.0
1.37k stars 450 forks source link

metadata dropped when converting from flac to aac #291

Open boizoe opened 3 years ago

boizoe commented 3 years ago

Hello, I tried to use container like below: docker run -it --rm -v $(pwd):$(pwd) jrottenberg/ffmpeg -i in.flac -c:a libfdk_aac -b:a 128k out.aac

I pretty sure it works before, but now all metadata dropped, however it is there in the Output. The only metadata output file has is ;FFMETADATA1 encoder=Lavf58.20.100.

I have the same issue with different versions and base image combinations - 3.2-4.1-alpine, centos, ubuntu. -map_metadata with different keys didn't help. I tried to use default codec -c:a aac too, no luck.

Also I tried -i input.flac output.mp3, output.ogg, output.opus. Metadata and pictures were only copied with mp3, with ogg and opus they were dropped too.

Command output is below. Other version provides the same output except for 'ffmpeg version' and 'build with ...'

ffmpeg version 4.1 Copyright (c) 2000-2018 the FFmpeg developers built with gcc 5.4.0 (Ubuntu 5.4.0-6ubuntu1~16.04.11) 20160609 configuration: --disable-debug --disable-doc --disable-ffplay --enable-shared --enable-avresample --enable-libopencore-amrnb --enable-libopencore-amrwb --enable-gpl --enable-libass --enable-libfreetype --enable-libvidstab --enable-libmp3lame --enable-libopenjpeg --enable-libopus --enable-libtheora --enable-libvorbis --enable-libvpx --enable-libx265 --enable-libxvid --enable-libx264 --enable-nonfree --enable-openssl --enable-libfdk_aac --enable-libkvazaar --enable-libaom --extra-libs=-lpthread --enable-postproc --enable-small --enable-version3 --extra-cflags=-I/opt/ffmpeg/include --extra-ldflags=-L/opt/ffmpeg/lib --extra-libs=-ldl --prefix=/opt/ffmpeg libavutil 56. 22.100 / 56. 22.100 libavcodec 58. 35.100 / 58. 35.100 libavformat 58. 20.100 / 58. 20.100 libavdevice 58. 5.100 / 58. 5.100 libavfilter 7. 40.101 / 7. 40.101 libavresample 4. 0. 0 / 4. 0. 0 libswscale 5. 3.100 / 5. 3.100 libswresample 3. 3.100 / 3. 3.100 libpostproc 55. 3.100 / 55. 3.100 Splitting the commandline. Reading option '-i' ... matched as input url with argument '/mzkSrc/Babymetal/2012 Headbanger/01 Headbanger!! (ヘドバンギャー!!).flac'. Reading option '-c:a' ... matched as option 'c' (codec name) with argument 'libfdk_aac'. Reading option '/mzkDst/headbanger.aac' ... matched as output url. Reading option '-loglevel' ... matched as option 'loglevel' (set logging level) with argument 'debug'. Finished splitting the commandline. Parsing a group of options: global . Applying option loglevel (set logging level) with argument debug. Successfully parsed a group of options. Parsing a group of options: input url /mzkSrc/Babymetal/2012 Headbanger/01 Headbanger!! (ヘドバンギャー!!).flac. Successfully parsed a group of options. Opening an input file: /mzkSrc/Babymetal/2012 Headbanger/01 Headbanger!! (ヘドバンギャー!!).flac. [NULL @ 0x11baf40] Opening '/mzkSrc/Babymetal/2012 Headbanger/01 Headbanger!! (ヘドバンギャー!!).flac' for reading [file @ 0x11bb8c0] Setting default whitelist 'file,crypto' [flac @ 0x11baf40] Format flac probed with size=2048 and score=100 [flac @ 0x11baf40] Before avformat_find_stream_info() pos: 2149961 bytes read:312165 seeks:1 nb_streams:2 [mjpeg @ 0x11bdac0] marker=d8 avail_size_in_buf=278596 [mjpeg @ 0x11bdac0] marker parser used 0 bytes (0 bits) [mjpeg @ 0x11bdac0] marker=e0 avail_size_in_buf=278594 [mjpeg @ 0x11bdac0] marker parser used 16 bytes (128 bits) [mjpeg @ 0x11bdac0] marker=db avail_size_in_buf=278576 [mjpeg @ 0x11bdac0] index=0

[mjpeg @ 0x11bdac0] marker parser used 67 bytes (536 bits) [mjpeg @ 0x11bdac0] marker=db avail_size_in_buf=278507 [mjpeg @ 0x11bdac0] index=1

[mjpeg @ 0x11bdac0] marker parser used 67 bytes (536 bits) [mjpeg @ 0x11bdac0] marker=c0 avail_size_in_buf=278438 [mjpeg @ 0x11bdac0] Changing bps from 0 to 8 [mjpeg @ 0x11bdac0] sof0: picture: 480x478 [mjpeg @ 0x11bdac0] component 0 1:1 id: 0 quant:0 [mjpeg @ 0x11bdac0] component 1 1:1 id: 1 quant:1 [mjpeg @ 0x11bdac0] component 2 1:1 id: 2 quant:1 [mjpeg @ 0x11bdac0] pix fmt id 11111100 [mjpeg @ 0x11bdac0] Format yuvj444p chosen by get_format(). [mjpeg @ 0x11bdac0] marker parser used 17 bytes (136 bits) [mjpeg @ 0x11bdac0] marker=c4 avail_size_in_buf=278419 [mjpeg @ 0x11bdac0] marker parser used 0 bytes (0 bits) [mjpeg @ 0x11bdac0] marker=c4 avail_size_in_buf=278386 [mjpeg @ 0x11bdac0] marker parser used 0 bytes (0 bits) [mjpeg @ 0x11bdac0] marker=c4 avail_size_in_buf=278324 [mjpeg @ 0x11bdac0] marker parser used 0 bytes (0 bits) [mjpeg @ 0x11bdac0] marker=c4 avail_size_in_buf=278293 [mjpeg @ 0x11bdac0] marker parser used 0 bytes (0 bits) [mjpeg @ 0x11bdac0] escaping removed 733 bytes [mjpeg @ 0x11bdac0] marker=da avail_size_in_buf=278219 [mjpeg @ 0x11bdac0] marker parser used 277486 bytes (2219888 bits) [mjpeg @ 0x11bdac0] marker=d9 avail_size_in_buf=0 [mjpeg @ 0x11bdac0] decode frame unused 0 bytes [flac @ 0x11baf40] All info found [flac @ 0x11baf40] After avformat_find_stream_info() pos: 2152009 bytes read:344933 seeks:1 frames:2 Input #0, flac, from '/mzkSrc/Babymetal/2012 Headbanger/01 Headbanger!! (ヘドバンギャー!!).flac': Metadata: TITLE : Headbanger (ヘドバンギャー!!) ARTIST : Babymetal album_artist : Babymetal ALBUM : Headbanger!! disc : 01 DISCTOTAL : 01 DATE : 2012 track : 01 TRACKTOTAL : 04 GENRE : Metal Duration: 00:04:03.05, start: 0.000000, bitrate: 1161 kb/s Stream #0:0, 1, 1/44100: Audio: flac, 44100 Hz, stereo, s16 Stream #0:1, 1, 1/90000: Video: mjpeg, 1 reference frame, yuvj444p(pc, bt470bg/unknown/unknown, center), 480x478 [SAR 300:300 DAR 240:239], 0/1, 90k tbr, 90k tbn, 90k tbc Metadata: comment : Cover (front) Successfully opened the file. Parsing a group of options: output url /mzkDst/headbanger.aac. Applying option c:a (codec name) with argument libfdk_aac. Successfully parsed a group of options. Opening an output file: /mzkDst/headbanger.aac. [file @ 0x11c18c0] Setting default whitelist 'file,crypto' Successfully opened the file. detected 8 logical cores Stream mapping: Stream #0:0 -> #0:0 (flac (native) -> aac (libfdk_aac)) Press [q] to stop, [?] for help cur_dts is invalid (this is harmless if it occurs once at the start per stream) Last message repeated 9 times [graph_0_in_0_0 @ 0x127c9c0] Setting 'time_base' to value '1/44100' [graph_0_in_0_0 @ 0x127c9c0] Setting 'sample_rate' to value '44100' [graph_0_in_0_0 @ 0x127c9c0] Setting 'sample_fmt' to value 's16' [graph_0_in_0_0 @ 0x127c9c0] Setting 'channel_layout' to value '0x3' [graph_0_in_0_0 @ 0x127c9c0] tb:1/44100 samplefmt:s16 samplerate:44100 chlayout:0x3 [format_out_0_0 @ 0x127d540] Setting 'sample_fmts' to value 's16' [format_out_0_0 @ 0x127d540] Setting 'sample_rates' to value '96000|88200|64000|48000|44100|32000|24000|22050|16000|12000|11025|8000' [format_out_0_0 @ 0x127d540] Setting 'channel_layouts' to value '0x4|0x3|0x7|0x107|0x37|0x3f|0xff|0x63f' [AVFilterGraph @ 0x11ee9c0] query_formats: 4 queried, 9 merged, 0 already done, 0 delayed Output #0, adts, to '/mzkDst/headbanger.aac': Metadata: TITLE : Headbanger (ヘドバンギャー!!) ARTIST : Babymetal album_artist : Babymetal ALBUM : Headbanger!! disc : 01 DISCTOTAL : 01 DATE : 2012 track : 01 TRACKTOTAL : 04 GENRE : Metal encoder : Lavf58.20.100 Stream #0:0, 0, 1/44100: Audio: aac (libfdk_aac), 44100 Hz, stereo, s16, delay 2048, 128 kb/s Metadata: encoder : Lavc58.35.100 libfdk_aac [flac @ 0x11baf40] first_dts 0 not matching first dts 10555392 (pts 10555392, duration 4096) in the queue [out_0_0 @ 0x127dac0] EOF on sink link out_0_0:default. No more output streams to write to, finishing. [libfdk_aac @ 0x11c09c0] Trying to remove 580 more samples than there are in the queue size= 3807kB time=00:04:03.06 bitrate= 128.3kbits/s speed=55.5x
video:0kB audio:3807kB subtitle:0kB other streams:0kB global headers:0kB muxing overhead: 0.000000% Input file #0 (/mzkSrc/Babymetal/2012 Headbanger/01 Headbanger!! (ヘドバンギャー!!).flac): Input stream #0:0 (audio): 2617 packets read (33143000 bytes); 2617 frames decoded (10718652 samples); Input stream #0:1 (video): 1 packets read (278598 bytes); Total: 2618 packets (33421598 bytes) demuxed Output file #0 (/mzkDst/headbanger.aac): Output stream #0:0 (audio): 10468 frames encoded (10718652 samples); 10470 packets muxed (3898620 bytes); Total: 10470 packets (3898620 bytes) muxed 2617 frames successfully decoded, 0 decoding errors [AVIOContext @ 0x11c16c0] Statistics: 0 seeks, 15 writeouts [AVIOContext @ 0x11c3cc0] Statistics: 33455165 bytes read, 1 seeks