<html><head><meta http-equiv="content-type" content="text/html; charset=utf-8"></head><body dir="auto"><div></div><div>Im just laying in bed, but try double quotes instead of singles and then paste me the exact error if you get one. </div><div><br>On Oct 14, 2017, at 10:15 PM, Mark Phillips <<a href="mailto:mark@phillipsmarketing.biz">mark@phillipsmarketing.biz</a>> wrote:<br><br></div><blockquote type="cite"><div><div dir="ltr">I found a few (~120) .mkv files crept into my plex movie drive. Plex on my limited plex server has trouble transcoding these files in real time, so I need to transcode them into mp4s ahead of time. <div><br></div><div>I tried this script, but I have an problem with the second find command.</div><div><br></div><div><div><font face="monospace, monospace">find /media/plex/ -name '*.mkv' | while read line; do</font></div><div><font face="monospace, monospace"> echo "Processing file '$line'"</font></div><div><font face="monospace, monospace"> f=`basename "$line" .mkv`</font></div><div><font face="monospace, monospace"> echo "basename = $f"</font></div><div><font face="monospace, monospace"> if [ -n "$(find /media/plex/ -name '$f.mp4' )" ]; then</font></div><div><font face="monospace, monospace"> #ffmpeg -i {} -vcodec copy -acodec copy $f.mp4 > fix2-mkv.txt 2>&1</font></div><div><font face="monospace, monospace"> #echo {} > files_fixed.txt 2>$1</font></div><div><font face="monospace, monospace"> echo "**************need to convert $line"</font></div><div><font face="monospace, monospace"> else</font></div><div><font face="monospace, monospace"> echo "$f.mp4 already exists"</font></div><div><font face="monospace, monospace"> fi</font></div><div><font face="monospace, monospace">done</font></div></div><div><br></div><div>All of the file names contain special characters, eg '[', and others. </div><div><br></div><div>For example,</div><div>/media/plex/Movies/Disney (Classic)/Robin Hood (1973 Movie) [x264-AAC][DVD][C-W].mkv<br></div><div><br></div><div>I get a false negative on this file when I search for the corresponding mp4 file because of the '[' in the file name. </div><div><br></div><div>This works:</div><div><div><font face="monospace, monospace">find /media/plex -name 'Robin Hood (1973 Movie)*'</font></div><div><font face="monospace, monospace">/media/plex/Movies/Disney (Classic)/Robin Hood (1973 Movie) [x264-AAC][DVD][C-W].mkv</font></div></div><div><br></div><div>but this gives a false negative</div><div><div><font face="monospace, monospace">find /media/plex -name 'Robin Hood (1973 Movie) [x264-AAC]*'</font></div><div><font face="monospace, monospace">root@orca:/home/mark# </font></div></div><div><br></div><div>I searched the find man page for ways to handle the special characters, but no luck on finding a solution. Anyone have a suggestion?</div><div><br></div><div>Thanks!</div><div><br></div><div>Mark</div></div>
</div></blockquote><blockquote type="cite"><div><span>---------------------------------------------------</span><br><span>PLUG-discuss mailing list - <a href="mailto:PLUG-discuss@lists.phxlinux.org">PLUG-discuss@lists.phxlinux.org</a></span><br><span>To subscribe, unsubscribe, or to change your mail settings:</span><br><span><a href="http://lists.phxlinux.org/mailman/listinfo/plug-discuss">http://lists.phxlinux.org/mailman/listinfo/plug-discuss</a></span></div></blockquote></body></html>