I apologize for the very late reply. I've been busy with other projects and this one got put on the back burner.
I appreciate the feedback, leelynds. I tried your ffmpeg example using the audio filter, but the resulting AAC audio stream too has the crackly audio. Though I didn't output it to an audio file and remux, I simply mapped it to the output MKV file, where it still crackled when direct streamed on the Plex Roku app. It did not have the crackly audio when played in VLC media player, which is consistent with all the other files that exhibit this problem. This is the command line used:
ffmpeg -i "input file.mkv" -map 0 -map a:0 -codec:a:0 aac -ac:a:0 2 -af "pan=stereo|FL=FC+FL+BL|FR=FC+FR+BR" -b:a:0 192k -metadata:s:a:0 title="Stereo" -codec:v copy -codec:s copy -f matroska "output file.tmp"
To provide some more information as requested by drinehart: I was using ffmpeg to bulk transcode MKV Blu-ray (and some DVD) rips to be direct-play compatible with the Plex Roku app. This included converting the video to H.264 using a crf of 20 (which mostly keeps the bitrate at 20 mbps or less) and creating an AAC stereo (or mono, depending on the source movie) stream. The following is generally the ffmpeg command line used (though I used -crf 18 for DVDs, and -tune animation for some other inputs):
ffmpeg -i "input file.mkv" -map 0 -map a:0 -codec copy -codec:v libx264 -preset medium -crf 20 -tune film -codec:a:0 aac -ac:a:0 2 -b:a:0 192k -metadata:s:a:0 title="Stereo" -f matroska "output file.tmp"
This will copy all streams from the input file to the temporary output file, and will additionally create an AAC stereo stream as the first audio track with the label 'Stereo'. After the encoding process was done, the input file would be replaced by the temporary output file. This way the change would be transparent to Plex since the encoding process was happening in the Plex library.
If I play the affected MKV files locally on my desktop PC using VLC media player the crackly audio is not present when playing the AAC stereo streams. Additionally, I'm able to direct stream via the Plex Android app, and it too can play the AAC stereo streams without the crackling.
Interestingly, if I use Handbrake to do my encoding and create an AAC stereo stream, it does not have the cracking audio when direct played on the Plex Roku app.
As I indicated in my previous post, the workaround to this issue is to simply select one of the other streams in the movie, such as the DTS or AC3 tracks, which forces Plex to transcode it to AAC stereo, and results in clean (no crackling) audio, though it's usually quieter. While this is an easy workaround, it has to be done manually for each movie as Plex defaults to selecting the first audio stream, which is where I purposely had ffmpeg place the AAC stereo stream.
My copy of ffmpeg was upgraded several times during this bulk transcoding (which took several months), but the files all exhibit the same behavior regardless of ffmpeg version. The last version I used was:
Sorry for the long winded post, but trying to give as much information as possible. Let me know if there's any other info I can provide.