2024-06-21, 07:02 PM
(This post was last modified: 2024-06-21, 07:06 PM by TheDreadPirate. Edited 2 times in total.)
In your ffprobe you are specifying "default=noprint_wrappers=1:nokey=1", but then grepping on the key "language". When nokey is set to 1 the output is
As a result, the grep doesn't retrieve anything and LANG is always null. But when it is set to 0.
And debug output confirms that LANG is populated now.
Code:
chris@rat-trap:~$ /usr/bin/ffprobe -v error -select_streams a:0 -show_entries stream=codec_type:stream_tags=language:stream=codec_name -of default=noprint_wrappers=1:nokey=1 "/media/storage2/testMovies/Mad Max Fury Road/Mad Max Fury Road.mkv"
truehd
audio
eng
As a result, the grep doesn't retrieve anything and LANG is always null. But when it is set to 0.
Code:
chris@rat-trap:~$ /usr/bin/ffprobe -v error -select_streams a:0 -show_entries stream=codec_type:stream_tags=language:stream=codec_name -of default=noprint_wrappers=1:nokey=0 "/media/storage2/testMovies/Mad Max Fury Road/Mad Max Fury Road.mkv"
codec_name=truehd
codec_type=audio
TAG:language=eng
And debug output confirms that LANG is populated now.
Code:
+ grep -oP (?<=language=)[^,]+
+ + echohead /media/storage2/testMovies/Batman -n Begins/Batman 1 Begins.mkv
+ /usr/bin/ffprobe -v error -i /media/storage2/testMovies/Batman Begins/Batman Begins.mkv -select_streams a:0 -show_entries stream=codec_type:stream_tags=language:stream=codec_name -of default=noprint_wrappers=1:nokey=0
+ LANG=eng