2

When I run this command

ffmpeg.exe -i test.mp3 -metadata title="The Title You  Want" -metadata artist="ÄÄÄßß!`n  Artist Name" -metadata album="Name Fö#'ddp+!of the Album" -c:a copy -id3v2_version 3  write_id3v1 1 out.mp3

The resulting meta data encoding seems to be wrong.

Name: ÄÄÄßß!`n  Artist Name
Title: Name Fö#'ddp+!of the Album

I'm using foobar2000 to check the result. So any ideas how to get this done properly? I've already run chcp 65001 which sets the code page of Windows to UTF8, but no change.

I need to get this reliable working on my Windows 8 box and any Linux distribution.

I could use -i meta.txt -map_metadata 1 instead of writing all the data directly, but the issue persists: Even when I write the meta data to a file, the file looks correct, but the result in the MP3 file does not. I'm auto-generating the file via a PHP script.


My FFmpeg version:

ffmpeg version N-46146-g11d695d Copyright (c) 2000-2012 the FFmpeg developers
  built on Oct 29 2012 18:10:27 with gcc 4.7.2 (GCC)
  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 --enab
le-libgsm --enable-libmp3lame --enable-libnut --enable-libopenjpeg --enable-libopus --enable-librtmp --enable-libschroed
inger --enable-libspeex --enable-libtheora --enable-libutvideo --enable-libvo-aacenc --enable-libvo-amrwbenc --enable-li
bvorbis --enable-libvpx --enable-libx264 --enable-libxavs --enable-libxvid --enable-zlib
1
  • Well, I cannot reproduce this with FFmpeg 1.0 on OS X. It might very well be an issue of the command line not handling the characters properly.
    – slhck
    Nov 15, 2012 at 9:51

2 Answers 2

1

Try just a 'chcp 65001' to change codepage to UTF-8 before your use ffmpeg

2
  • 4
    Can you elaborate on this a little more?
    – Toto
    Apr 29, 2018 at 9:26
  • 5
    The question says that the user has already tried this, without success. Apr 29, 2018 at 19:31
0

I'm using a batch file to add subtitles to a media file using ffmpeg. For French-Forced subtitles I have following line :

-metadata:s:s:%subMap0% language=fre -metadata:s:s:%subMap0% title="Français [Forced]" -disposition:s:s:%subMap0% forced

As you may see in the title, I have a special char 'ç'. The batch file is encoded in UTF-8 so here it's shown like I expects it. But when I run this batch file in a cmd (windows10) the character is stored false. The title is given after ffmeg like :

Français [Forced]

When I just type the command 'chcp' at the commandline, it tells me the codepage of cmd is 850. This is for my country, Belgium, the default. But it doesn't accept utf-8 characters. Entering the command 'chcp 65001' will change the command's codepage to utf-8, and so when ffmpeg is called with special characters in it's parameters, they all will be accepted as utf8 chars, giving me the result I expects.

So in my batchfiles which uses special characters, I preceed the ffmpeg-command with 'chcp 65001', this to be sure special (utf8) characters are handled by ffmpeg the way I expect it to be.

For example :

@ECHO OFF
CLS
SETLOCAL
chcp 65001
ffmpeg -hide_banner -y -i input.mp4 -i sub.srt -map 0:v -map 0:a -map 1 -c:v copy -c:a copy -c:s copy -metadata:s:s:0 language=fre -metadata:s:s:0 title="Français [Forced]" -disposition:s:s:0 forced output.mp4
ENDLOCAL

'chcp' is a Windows command. I don't know what the equivalent is in linux (I checked).

1
  • 1
    As it’s currently written, your answer is unclear. Please edit to add additional details that will help others understand how this addresses the question asked. You can find more information on how to write good answers in the help center.
    – Community Bot
    Mar 9, 2023 at 19:02

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .