Versions Compared

Key

  • This line was added.
  • This line was removed.
  • Formatting was changed.

Radio/tv DOMS migrations

Fixing FFprobe data

Some of the ffprobe-data contain errors. The following bash magic fixes the errors we've encountered so far:

Code Block
languagebash
titlefixing FFprobe data
linenumberstrue
find . |grep \.stdout$ | xargs -Ił xmllint --noout ł 2>&1 | grep \\./ | cut -d':' -f1 | sort -u > broken-files
for line in $(grep \_plutre\.mp4\.stdout$ broken-files); do sed -i -e 's/value=\"\s/value=\"/g' $line; done
for line in $(grep \.\/mux broken-files); do echo "</ffprobe:ffprobe>" >> $line; done

xmllint is used to find faulty files (line 1), and the files typically have two types of errors: Files containing line-feed (^L) in attribute values (line 2) and files missing the ffprobe:ffprobe-end-tag (line 3).