从VLC而不是Totem生成video缩略图的方法?
我遇到的问题是video缩略图在某些video文件中没有出现在nautilus中。 我刚发现这个bug类型查找:一些mpeg文件没有被识别为mpeg文件 ,似乎解决了这个问题。 我不明白这个错误报告中报告的具体细节,但听起来这是Totem与Gstreamer交互的问题。
由于我的所有video都可以与VLC一起使用(并且他们并不都玩Totem),所以我不会非常使用Totem。 有没有办法让VLC生成video缩略图,而不必依赖于错误的gstreamer / totem? 我将VLC设为我的默认video播放器,但这对video缩略图的显示没有影响。 如果Totem无法播放video文件,那么我就没有缩略图。 但是VLC可以很好地播放video,那么为什么VLC不能为它创建video缩略图呢?
首先,确保安装了所需的所有ffmpeg(vlc背面)组件:
sudo apt-get install ffmpeg ffmpegthumbnailer gstreamer0.10-ffmpeg
使用bleachbit,ubuntu tweak或此命令清除缩略图缓存:
rm ~/.thumbnails/fail/gnome-thumbnail-factory/* rm ~/.thumbnails/normal/*
现在我们需要告诉Ubuntu不要使用图腾,而是要使用ffmpeg。
sudo nano /usr/share/thumbnailers/totem.thumbnailer
并用以下内容替换totem.thumbnailer
所有ext:
[Thumbnailer Entry] TryExec=ffmpegthumbnailer Exec=ffmpegthumbnailer -s %s -i %i -o %o -c png -f -t 10 MimeType=application/mxf;application/ogg;application/ram;application/sdp;application/vnd.ms-wpl;application/vnd.rn-realmedia;application/x-extension-m4a;application/x-extension-mp4;application/x-flash-video;application/x-matroska;application/x-netshow-channel;application/x-ogg;application/x-quicktimeplayer;application/x-shorten;image/vnd.rn-realpix;image/x-pict;misc/ultravox;text/x-google-video-pointer;video/3gpp;video/dv;video/fli;video/flv;video/mp2t;video/mp4;video/mp4v-es;video/mpeg;video/msvideo;video/ogg;video/quicktime;video/vivo;video/vnd.divx;video/vnd.rn-realvideo;video/vnd.vivo;video/webm;video/x-anim;video/x-avi;video/x-flc;video/x-fli;video/x-flic;video/x-flv;video/x-m4v;video/x-matroska;video/x-mpeg;video/x-ms-asf;video/x-ms-asx;video/x-msvideo;video/x-ms-wm;video/x-ms-wmv;video/x-ms-wmx;video/x-ms-wvx;video/x-nsv;video/x-ogm+ogg;video/x-theora+ogg;video/x-totem-stream;audio/x-pn-realaudio;audio/3gpp;audio/ac3;audio/AMR;audio/AMR-WB;audio/basic;audio/midi;audio/mp2;audio/mp4;audio/mpeg;audio/ogg;audio/prs.sid;audio/vnd.rn-realaudio;audio/x-aiff;audio/x-ape;audio/x-flac;audio/x-gsm;audio/x-it;audio/x-m4a;audio/x-matroska;audio/x-mod;audio/x-mp3;audio/x-mpeg;audio/x-ms-asf;audio/x-ms-asx;audio/x-ms-wax;audio/x-ms-wma;audio/x-musepack;audio/x-pn-aiff;audio/x-pn-au;audio/x-pn-wav;audio/x-pn-windows-acm;audio/x-realaudio;audio/x-real-audio;audio/x-sbc;audio/x-speex;audio/x-tta;audio/x-wav;audio/x-wavpack;audio/x-vorbis;audio/x-vorbis+ogg;audio/x-xm;application/x-flac;
并退出鹦鹉螺:
nautilus -q
转到您的video,然后查看所有video的缩略图预览。
从Vivid开始,唯一需要的包是ffmpegthumbnailer
:
sudo apt-get update && sudo apt-get install ffmpegthumbnailer
并且要替换的行只有TryExec=[...]
和Exec=[...]
行(这是从命令行执行以替换两者的单行):
sudo sed -i 's/^TryExec=.*$/TryExec=ffmpegthumbnailer/; s/^Exec=.*$/Exec=ffmpegthumbnailer -s %s -i %i -o %o -c png -f -t 10/' /usr/share/thumbnailers/totem.thumbnailer
然后像往常一样应该关闭nautilus
并删除~/.cache/thumbnails
文件夹:
nautilus -q && rm -r ~/.cache/thumbnails