[FFmpeg-trac] #2502(FFprobe:new): ffprobe Produces Invalid JSON

FFmpeg trac at avcodec.org
Wed Aug 21 03:34:05 CEST 2013


#2502: ffprobe Produces Invalid JSON
-------------------------------------+-----------------------------------
             Reporter:  dnicolson    |                    Owner:
                 Type:  defect       |                   Status:  new
             Priority:  normal       |                Component:  FFprobe
              Version:  unspecified  |               Resolution:
             Keywords:               |               Blocked By:
             Blocking:               |  Reproduced by developer:  0
Analyzed by developer:  0            |
-------------------------------------+-----------------------------------

Comment (by dnicolson):

 I have made a reduced case and attached a file (test-pattern.avi), as
 requested.

 I created an AVI file with ffmpeg using the following command:

 ffmpeg -i test-pattern-orig.avi -metadata title="æ" -metadata
 artist="`echo -e \"\xe6\"`" -vcodec copy -acodec copy test-pattern.avi
 (backticks need to be added around the monospaced text).

 This creates the file test-pattern.avi with the title as a UTF-8 encoded
 lowercase AE and the artist as a ISO-8859-1 encoded lowercase AE. VLC
 displays metadata in ISO-8859-1 so the artist is correctly displayed as
 "æ" but displays the title as "æ".

 Because ffprobe assumes all valid UTF-8 in the metadata, the following
 command produces invalid JSON:

 ffprobe -v quiet -print_format json -show_format -show_streams test-
 pattern.avi | python -c 'import json,sys; json.load(sys.stdin)'

 A possible solution would be to strip invalid UTF-8 characters, or maybe
 provide an alternate switch to replace invalid characters?

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


More information about the FFmpeg-trac mailing list