[FFmpeg-trac] #1951(undetermined:new): Ffmpeg meta data fails to write UTF-8 and screws up files

FFmpeg trac at avcodec.org
Thu Nov 22 22:26:10 CET 2012


#1951: Ffmpeg meta data fails to write UTF-8 and screws up files
-------------------------------------+-------------------------------------
             Reporter:  burzum       |                    Owner:
                 Type:  defect       |                   Status:  new
             Priority:  normal       |                Component:
              Version:  unspecified  |  undetermined
             Keywords:  win          |               Resolution:
             Blocking:               |               Blocked By:
Analyzed by developer:  0            |  Reproduced by developer:  0
-------------------------------------+-------------------------------------

Comment (by burzum):

 Yes, I'm also pretty sure it is a windows specific issue.

 I've also started looking at cmdutils.c ~line 217 master branch, but as
 far as I can tell (I don't know C) this seems to already do the job? Or
 should do it? It's taking the input and should change it to UTF8.

 Here is the whole log from my php application:

 {{{
 2012-11-22 21:16:19 Shell-processor: \Lib\Utility\ShellProcessor.php Line:
 102
 2012-11-22 21:16:19 Shell-processor: \Bin\Win\ffmpeg\bin\ffmpeg.exe -i
 "\tmp\test-files\cd-quality-song.mp3" -metadata title="! Äüß!*" -metadata
 artist="Burzum #äääüüüüüß" -metadata track="11" -metadata date="2012"
 -metadata album="Test Album" -c:a copy -id3v2_version 3 -write_id3v1 1 -y
 "\tmp\test-files\cd-quality-song.mp3" 2>&1
 2012-11-22 21:16:19 Shell-processor: \Lib\MetaData\FfmpegId3v2.php Line:
 81
 2012-11-22 21:16:19 Shell-processor: Array
 (
     [0] => ffmpeg version N-46146-g11d695d Copyright (c) 2000-2012 the
 FFmpeg developers
     [1] =>   built on Oct 29 2012 18:10:27 with gcc 4.7.2 (GCC)
     [2] =>   configuration: --enable-gpl --enable-version3 --disable-
 pthreads --enable-runtime-cpudetect --enable-avisynth --enable-bzlib
 --enable-frei0r --enable-libass --enable-libopencore-amrnb --enable-
 libopencore-amrwb --enable-libfreetype --enable-libgsm --enable-libmp3lame
 --enable-libnut --enable-libopenjpeg --enable-libopus --enable-librtmp
 --enable-libschroedinger --enable-libspeex --enable-libtheora --enable-
 libutvideo --enable-libvo-aacenc --enable-libvo-amrwbenc --enable-
 libvorbis --enable-libvpx --enable-libx264 --enable-libxavs --enable-
 libxvid --enable-zlib
     [3] =>   libavutil      52.  1.100 / 52.  1.100
     [4] =>   libavcodec     54. 69.100 / 54. 69.100
     [5] =>   libavformat    54. 35.100 / 54. 35.100
     [6] =>   libavdevice    54.  3.100 / 54.  3.100
     [7] =>   libavfilter     3. 20.109 /  3. 20.109
     [8] =>   libswscale      2.  1.101 /  2.  1.101
     [9] =>   libswresample   0. 16.100 /  0. 16.100
     [10] =>   libpostproc    52.  1.100 / 52.  1.100
     [11] => [mp3 @ 0000000001eb3180] max_analyze_duration 5000000 reached
 at 5015510
     [12] => Input #0, mp3, from '\tmp\test-files\cd-quality-song.mp3':
     [13] =>   Metadata:
     [14] =>     encoder         : Lavf54.0.100
     [15] =>   Duration: 00:03:18.97, start: 0.000000, bitrate: 256 kb/s
     [16] =>     Stream #0:0: Audio: mp3, 44100 Hz, stereo, s16, 256 kb/s
     [17] => Output #0, mp3, to '\tmp\test-files\cd-quality-song.mp3':
     [18] =>   Metadata:
     [19] =>     TALB            : Test Album
     [20] =>     TIT2            : ! Äüß!*
     [21] =>     TPE1            : Burzum #äääüüüüüß
     [22] =>     TRCK            : 11
     [23] =>     TYER            : 2012
     [24] =>     TSSE            : Lavf54.35.100
     [25] =>     Stream #0:0: Audio: mp3, 44100 Hz, stereo, 256 kb/s
     [26] => Stream mapping:
     [27] =>   Stream #0:0 -> #0:0 (copy)
     [28] => Press [q] to stop, [?] for help
     [29] => size=     192kB time=00:00:06.16 bitrate= 255.7kbits/s
     [30] => video:0kB audio:191kB subtitle:0 global headers:0kB muxing
 overhead 0.595177%
     [31] =>
 )

 2012-11-22 21:16:19 Shell-processor: \Lib\Utility\ShellProcessor.php Line:
 102
 2012-11-22 21:16:19 Shell-processor: \Bin\Win\ffmpeg\bin\ffmpeg.exe -i
 "\tmp\test-files\cd-quality-song.ogg" -metadata title="! Äüß!*" -metadata
 artist="Burzum #äääüüüüüß" -metadata track="11" -metadata date="2012"
 -metadata album="Test Album" -c:a copy -id3v2_version 3 -write_id3v1 1 -y
 "\tmp\test-files\cd-quality-song.ogg" 2>&1
 2012-11-22 21:16:19 Shell-processor: \Lib\MetaData\FfmpegId3v2.php Line:
 81
 2012-11-22 21:16:19 Shell-processor: Array
 (
     [0] => ffmpeg version N-46146-g11d695d Copyright (c) 2000-2012 the
 FFmpeg developers
     [1] =>   built on Oct 29 2012 18:10:27 with gcc 4.7.2 (GCC)
     [2] =>   configuration: --enable-gpl --enable-version3 --disable-
 pthreads --enable-runtime-cpudetect --enable-avisynth --enable-bzlib
 --enable-frei0r --enable-libass --enable-libopencore-amrnb --enable-
 libopencore-amrwb --enable-libfreetype --enable-libgsm --enable-libmp3lame
 --enable-libnut --enable-libopenjpeg --enable-libopus --enable-librtmp
 --enable-libschroedinger --enable-libspeex --enable-libtheora --enable-
 libutvideo --enable-libvo-aacenc --enable-libvo-amrwbenc --enable-
 libvorbis --enable-libvpx --enable-libx264 --enable-libxavs --enable-
 libxvid --enable-zlib
     [3] =>   libavutil      52.  1.100 / 52.  1.100
     [4] =>   libavcodec     54. 69.100 / 54. 69.100
     [5] =>   libavformat    54. 35.100 / 54. 35.100
     [6] =>   libavdevice    54.  3.100 / 54.  3.100
     [7] =>   libavfilter     3. 20.109 /  3. 20.109
     [8] =>   libswscale      2.  1.101 /  2.  1.101
     [9] =>   libswresample   0. 16.100 /  0. 16.100
     [10] =>   libpostproc    52.  1.100 / 52.  1.100
     [11] => Input #0, ogg, from '\tmp\test-files\cd-quality-song.ogg':
     [12] =>   Duration: 00:03:18.93, start: 0.000000, bitrate: 455 kb/s
     [13] =>     Stream #0:0: Audio: vorbis, 44100 Hz, stereo, s16, 499
 kb/s
     [14] =>     Metadata:
     [15] =>       ENCODER         : Lavf54.0.100
     [16] => Output #0, ogg, to '\tmp\test-files\cd-quality-song.ogg':
     [17] =>   Metadata:
     [18] =>     title           : ! Äüß!*
     [19] =>     artist          : Burzum #äääüüüüüß
     [20] =>     TRACKNUMBER     : 11
     [21] =>     date            : 2012
     [22] =>     album           : Test Album
     [23] =>     encoder         : Lavf54.35.100
     [24] =>     Stream #0:0: Audio: vorbis, 44100 Hz, stereo, 499 kb/s
     [25] =>     Metadata:
     [26] =>       ENCODER         : Lavf54.0.100
     [27] => Stream mapping:
     [28] =>   Stream #0:0 -> #0:0 (copy)
     [29] => Press [q] to stop, [?] for help
     [30] => size=      64kB time=00:00:01.11 bitrate= 465.7kbits/s
     [31] => video:0kB audio:59kB subtitle:0 global headers:0kB muxing
 overhead 7.393971%
     [32] =>
 )

 2012-11-22 21:16:19 Shell-processor: \Lib\Utility\ShellProcessor.php Line:
 102
 2012-11-22 21:16:19 Shell-processor: \Bin\Win\ffmpeg\bin\ffmpeg.exe -i
 "\tmp\test-files\cd-quality-song.flac" -metadata title="! Äüß!*" -metadata
 artist="Burzum #äääüüüüüß" -metadata track="11" -metadata date="2012"
 -metadata album="Test Album" -c:a copy -id3v2_version 3 -write_id3v1 1 -y
 "\tmp\test-files\cd-quality-song.flac" 2>&1
 2012-11-22 21:16:19 Shell-processor: \Lib\MetaData\FfmpegId3v2.php Line:
 81
 2012-11-22 21:16:19 Shell-processor: Array
 (
     [0] => ffmpeg version N-46146-g11d695d Copyright (c) 2000-2012 the
 FFmpeg developers
     [1] =>   built on Oct 29 2012 18:10:27 with gcc 4.7.2 (GCC)
     [2] =>   configuration: --enable-gpl --enable-version3 --disable-
 pthreads --enable-runtime-cpudetect --enable-avisynth --enable-bzlib
 --enable-frei0r --enable-libass --enable-libopencore-amrnb --enable-
 libopencore-amrwb --enable-libfreetype --enable-libgsm --enable-libmp3lame
 --enable-libnut --enable-libopenjpeg --enable-libopus --enable-librtmp
 --enable-libschroedinger --enable-libspeex --enable-libtheora --enable-
 libutvideo --enable-libvo-aacenc --enable-libvo-amrwbenc --enable-
 libvorbis --enable-libvpx --enable-libx264 --enable-libxavs --enable-
 libxvid --enable-zlib
     [3] =>   libavutil      52.  1.100 / 52.  1.100
     [4] =>   libavcodec     54. 69.100 / 54. 69.100
     [5] =>   libavformat    54. 35.100 / 54. 35.100
     [6] =>   libavdevice    54.  3.100 / 54.  3.100
     [7] =>   libavfilter     3. 20.109 /  3. 20.109
     [8] =>   libswscale      2.  1.101 /  2.  1.101
     [9] =>   libswresample   0. 16.100 /  0. 16.100
     [10] =>   libpostproc    52.  1.100 / 52.  1.100
     [11] => [flac @ 00000000037c3180] max_analyze_duration 5000000 reached
 at 5015510
     [12] => Input #0, flac, from '\tmp\test-files\cd-quality-song.flac':
     [13] =>   Metadata:
     [14] =>     ENCODER         : Lavf54.0.100
     [15] =>   Duration: 00:03:18.93, bitrate: 1045 kb/s
     [16] =>     Stream #0:0: Audio: flac, 44100 Hz, stereo, s16
     [17] => Output #0, flac, to '\tmp\test-files\cd-quality-song.flac':
     [18] =>   Metadata:
     [19] =>     album           : Test Album
     [20] =>     title           : ! Äüß!*
     [21] =>     artist          : Burzum #äääüüüüüß
     [22] =>     TRACKNUMBER     : 11
     [23] =>     date            : 2012
     [24] =>     encoder         : Lavf54.35.100
     [25] =>     Stream #0:0: Audio: flac, 44100 Hz, stereo
     [26] => Stream mapping:
     [27] =>   Stream #0:0 -> #0:0 (copy)
     [28] => Press [q] to stop, [?] for help
     [29] => size=     768kB time=00:00:06.26 bitrate=1003.7kbits/s
     [30] => video:0kB audio:760kB subtitle:0 global headers:0kB muxing
 overhead 1.083087%
     [31] =>
 )
 }}}

 Here is the code that generated that:


 {{{
 /**
  * Executes
  *
  * @param string $params
  * @return array
  */
         public function execute($params = '') {
                 $params = $this->beforeExecute($params);
                 $command = $this->bin . ' ' . $params . ' 2>&1';
                 $this->log($command, 'shell-processor');
                 $this->rawData = shell_exec($command);
                 return $this->afterExecute($this->rawData);
         }
 }}}

-- 
Ticket URL: <https://ffmpeg.org/trac/ffmpeg/ticket/1951#comment:2>
FFmpeg <http://ffmpeg.org>
FFmpeg issue tracker


More information about the FFmpeg-trac mailing list