MiniDLNA 1.2.1编译 添加对rmvb格式的支持

因为电视为安卓系统,屏幕大,所以看电影时喜欢在TV上看,之前都是PC端通过samba(网上邻居)来分享视频,但在TV上观看时,在多人同时用上网时偶尔会卡顿,体验不怎么好。所以就想换个方式来共享视频,所以就选定DLNA了。


Windows:

Windows Media Player----即DLNA服务端又为DLNA客户端,可直接推送视频至TV上,当时系统为Win7,XP的MediaPlayer就不清楚了

AirPlay(官方网站)----DLNA服务端,这款软件可以直接将电脑桌面推送至TV上(带声音),效果同双显示器,发现它后就再也没有使用过HDMI线连接TV了。也可以单独推送视频/图片/音乐至TV上


之后一段时间,PPTV、迅雷视频、腾讯视频等等播放软件都开始支持DLNA了,现在因工作需要已经转至Linux了,所以不怎么玩Windows了,这些软件的DLNA功能怎么样不太清楚。


Linux :

rygel----DLNA服务端,Debain Wheezy源里的版本,因不支持mov、flv、rm、rmvb、mkv等格式的文件分享,用过一段时间后放弃了

MiniDLNA(官网)----DLNA服务端,不支持rm、rmvb格式的文件分享,但可以自己修改源文件来支持,所以就选它了。它还自带一个Web网页,可以显示分享资源数与当前客户端名字等等,在浏览器里打开http://本机IP:8200


1、下载源代码,目前minidlna最新版本1.2.1, 下载地址sourceforge.net

2、修改源文件

metadata.c

[cpp]  view plain  copy
  1. //line 840  
  2. else if( strncmp(ctx->iformatctx->name, "matroska", 8) == 0 )  
  3.     xasprintf(&m.mime, "video/x-matroska");  
  4. else if( strcmp(ctx->iformatctx->name, "flv") == 0 )  
  5.     xasprintf(&m.mime, "video/x-flv");  
  6. //----添加----  
  7. else if( strcmp(ctx->iformat->name, "rm") == 0 )  
  8.     xasprintf(&m.mime, "video/x-pn-realvideo");  
  9. else if( strcmp(ctx->iformat->name, "rmvb") == 0 )  
  10.     xasprintf(&m.mime, "video/x-pn-realvideo");  
  11. //---结束----  
  12. if( m.mime )  
  13.     goto video_nodlna;  

upnpglobalvars.h
[cpp]  view plain  copy
  1. // Line 169  
  2.     "http-get:*:audio/mp4:*," \  
  3.     "http-get:*:audio/x-wav:*," \  
  4.     "http-get:*:audio/x-flac:*," \  
  5.     "http-get:*:application/ogg:*," \  
  6. //----add----  
  7.     "http-get:*:video/x-pn-realvideo:*"  
  8. //----end----  
  9.   
  10. #define DLNA_FLAG_DLNA_V1_5      0x00100000  
  11. #define DLNA_FLAG_HTTP_STALLING  0x00200000  

utils.c

[cpp]  view plain  copy
  1. //line 381  
  2.         ends_with(file, ".m2t") || ends_with(file, ".mkv")   ||  
  3.         ends_with(file, ".vob") || ends_with(file, ".ts")    ||  
  4.         ends_with(file, ".flv") || ends_with(file, ".xvid")  ||  
  5. //----add----  
  6.         ends_with(file, ".rm")  || ends_with(file, ".rmvb")  ||  
  7. //----end----  
  8. #ifdef TIVO_SUPPORT  
  9.         ends_with(file, ".TiVo") ||  
  10. #endif  
  11.         ends_with(file, ".mov") || ends_with(file, ".3gp"));  



3、编译步骤

[plain]  view plain  copy
  1. sudo apt-get install build-essential libexif-dev libjpeg-dev \  
  2. libid3tag0-dev libFLAC-dev libvorbis-dev libsqlite3-dev libavformat-dev \  
  3. autoconf automake  
  4.   
  5. ./autogen.sh  
  6. ./configure  
  7. make  
  8. make install  
  9. sudo cp ./linux/minidlna.inot.d.script.tmpl  /etc/init.d/minidlna  
  10. sudo cp ./minidlna.conf  /etc/minidlna.conf  
  11.   
  12. # 第一次启动使用-d –v选项看有没有出错  
  13. sudo /usr/local/sbin/minidlnad -d -v  
  14. # 没出错就ctrl+c 结束进程  
  15.   
  16. # 正常启动  
  17. sudo service minidlna start  
  18. # 刷新列表  
  19. sudo service minidlna restart  


4. Minidlna配置

minidlna.conf

[html]  view plain  copy
  1. # port for HTTP (descriptions, SOAP, media transfer) traffic  
  2. port=8200  
  3.   
  4. # network interfaces to serve, comma delimited  
  5. #network_interface=eth0  
  6.   
  7. # specify the user account name or uid to run as  
  8. #user=jmaggard  
  9.   
  10. # set this to the directory you want scanned.  
  11. # * if you want multiple directories, you can have multiple media_dirlines  
  12. # * if you want to restrict a media_dir to specific content types, you  
  13. #   can prepend the types, followed by a comma, to the directory:  
  14. #   + "A" for audio  (eg. media_dir=A,/home/jmaggard/Music)  
  15. #   + "V" for video  (eg. media_dir=V,/home/jmaggard/Videos)  
  16. #   + "P" for images (eg. media_dir=P,/home/jmaggard/Pictures)  
  17. #   + "PV" for pictures and video (eg. media_dir=PV,/home/jmaggard/digital_camera)  
  18. media_dir=/opt  
  19.   
  20. # set this to merge all media_dir base contents into the root container  
  21. # note: the default is no  
  22. #merge_media_dirs=no  
  23.   
  24. # set this if you want to customize the name that shows up on your clients  
  25. #friendly_name=My DLNA Server  
  26.   
  27. # set this if you would like to specify the directory where you want MiniDLNA to store its database and album art cache  
  28. #db_dir=/var/cache/minidlna  
  29.   
  30. # set this if you would like to specify the directory where you want MiniDLNA to store its log file  
  31. #log_dir=/var/log  
  32.   
  33. # set this to change the verbosity of the information that is logged  
  34. # each section can use a different level: off, fatal, error, warn, info, or debug  
  35. #log_level=general,artwork,database,inotify,scanner,metadata,http,ssdp,tivo=warn  
  36.   
  37. # this should be a list of file names to check for when searching for album art  
  38. # note: names should be delimited with a forward slash ("/")  
  39. album_art_names=Cover.jpg/cover.jpg/AlbumArtSmall.jpg/albumartsmall.jpg/AlbumArt.jpg/albumart.jpg/Album.jpg/album.jpg/Folder.jpg/folder.jpg/Thumb.jpg/thumb.jpg  
  40.   
  41. # set this to no to disable inotify monitoring to automatically discover new files  
  42. # note: the default is yes  
  43. inotify=yes  
  44.   
  45. # set this to yes to enable support for streaming .jpg and .mp3 files to a TiVo supporting HMO  
  46. enable_tivo=no  
  47.   
  48. # set this to strictly adhere to DLNA standards.  
  49. # * This will allow server-side downscaling of very large JPEG images,  
  50. #   which may hurt JPEG serving performance on (at least) Sony DLNA products.  
  51. strict_dlna=no  
  52.   
  53. # default presentation url is http address on port 80  
  54. #presentation_url=http://www.mylan/index.php  
  55.   
  56. # notify interval in seconds. default is 895 seconds.  
  57. notify_interval=900  
  58.   
  59. # serial and model number the daemon will report to clients  
  60. # in its XML description  
  61. serial=12345678  
  62. model_number=1  
  63.   
  64. # specify the path to the MiniSSDPd socket  
  65. #minissdpdsocket=/var/run/minissdpd.sock  
  66.   
  67. # use different container as root of the tree  
  68. # possible values:  
  69. #   + "." - use standard container (this is the default)  
  70. #   + "B" - "Browse Directory"  
  71. #   + "M" - "Music"  
  72. #   + "V" - "Video"  
  73. #   + "P" - "Pictures"  
  74. #   + Or, you can specify the ObjectID of your desired root container (eg. 1$F for Music/Playlists)  
  75. # if you specify "B" and client device is audio-only then "Music/Folders" will be used as root  
  76. #root_container=.  
  77.   
  78. # always force SortCriteria to this value, regardless of the SortCriteria passed by the client  
  79. #force_sort_criteria=+upnp:class,+upnp:originalTrackNumber,+dc:title  
  80.   
  81. # maximum number of simultaneous connections  
  82. # note: many clients open several simultaneous connections while streaming  
  83. #max_connections=50  

一般只需修改media_dir参数即可
[html]  view plain  copy
  1. # V 即视频  
  2. # 此目录下只分享视频文件  
  3. media_dir=V,/home/aa/Videos  
  4. # P 即图片  
  5. # A 即音乐  
  6. # 此目录下分享图片与音乐文件  
  7. media_dir=PA,/home/aa/Public  


Debian版minidlna_1.1.4_x64_支持rmvb

注:编译时Linux版本为Kali/Debian Wheezy x64

http://pan.baidu.com/s/1sjNoo3r


添加RMVB支持后的源代码

http://cloud.189.cn/t/eqI7Zz6jAzMv



minidlna_1.1.5_x64_支持rmvb

注:编译时Linux版本为Kali 2.0 x64

http://pan.baidu.com/s/1A2ndO

minidlna_1.1.5_支持RMVB_源代码


sudo apt-get install build-essential libexif-dev libjpeg-dev \ libid3tag0-dev libFLAC-dev libvorbis-dev libsqlite3-dev libavformat-dev \ autoconf automake

  • 3
    点赞
  • 4
    收藏
    觉得还不错? 一键收藏
  • 2
    评论
评论 2
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值