The catalyst wave open Excel 37 - audio and video files metadata extraction (resolution, duration, sample rate)

Previous mentioned extract picture meta information Exif, of course, there is a class of audio and video files, too many valuable storage metadata, it would open in the end chant, although the process is very hard to find their own ups and downs, we have to see harvest, just under a lot of communication, so that the previous work can be more valuable.

Excel catalytic function corresponding to achieve this post: 83 Wave - specific information file folder information traversing particular image, audio and video https://www.jianshu.com/p/ad98adc64f0b

Extract audio and video metadata, uses MediaToolkit libraries than other complex programs, this most friendly to me this amateur developers, and finally was fortunate enough to meet it.

MediaToolkit library

Directly on the code, is also just a few lines of code can get the core information.

        private void AddMediaInfo(DataRow dr, string filePath)
        {
            try
            {
                using (var engine = new Engine())
                {
                    var inputFile = new MediaToolkit.Model.MediaFile { Filename = filePath };
                    engine.GetMetadata(inputFile);
                    var videoData = inputFile.Metadata.VideoData;
                    var audioData = inputFile.Metadata.AudioData;
                    dr[ColNameOfVideoDuration] = Math.Round(inputFile.Metadata.Duration.TotalSeconds / 60.0, 2);

                    if (videoData != null)
                    {
                        dr[ColNameOfVideoFormat] = videoData.Format;
                        string sizeStr = videoData.FrameSize;
                        dr[ColNameOfVideoWidth] = sizeStr.Split('x')[0];
                        dr[ColNameOfVideoHeight] = sizeStr.Split('x')[1];
                    }

                    if (audioData != null)
                    {
                        dr[ColNameOfAudioFormat] = audioData.Format;
                        dr[ColNameOfAudioBitRateKbs] = audioData.BitRateKbs;
                        dr[ColNameOfAudioSampleRate] = audioData.SampleRate;
                    }
                }
            }
            catch (Exception)
            {

            }

        }

Technical exchange QQ group

QQ group name: Excel catalyst open discussion groups, QQ group number: 788 145 319
Excel catalyst dimensional code open source discussion groups

About Excel catalyst

Excel catalyst name, first a public micro-channel number, then shun its name, officially launched the Excel plug-in, plug-continuous updates, the update cycle depends on my time may be able to fight for one week on a line function modules. Excel catalyst plug-permanent commitment to individual users free of charge!

Excel catalyst plugin uses the latest deployment of technology, once installed, all future updates automatically update is complete, no need to repeat concerns updates, manually download the installation package to reinstall, you can always keep the latest version with a single installation!

The catalyst Excel plug-in download link: https://pan.baidu.com/s/1Iz2_NZJ8v7C9eqhNjdnP3Q

Contact the author

No public

取名催化剂,因Excel本身的强大,并非所有人能够立马享受到,大部分人还是在被Excel软件所虐的阶段,就是头脑里很清晰想达到的效果,而且高手们也已经实现出来,就是自己怎么弄都弄不出来,或者更糟的是还不知道Excel能够做什么而停留在不断地重复、机械、手工地在做着数据,耗费着无数的青春年华岁月。所以催生了是否可以作为一种媒介,让广大的Excel用户们可以瞬间点燃Excel的爆点,无需苦苦地挣扎地没日没夜的技巧学习、高级复杂函数的烧脑,最终走向了从入门到放弃的道路。

最后Excel功能强大,其实还需树立一个观点,不是所有事情都要交给Excel去完成,也不是所有事情Excel都是十分胜任的,外面的世界仍然是一个广阔的世界,Excel只是其中一枚耀眼的明星,还有其他更多同样精彩强大的技术、工具等。*Excel催化剂也将借力这些其他技术,让Excel能够发挥更强大的爆发!

关于Excel催化剂作者

姓名:李伟坚,从事数据分析工作多年(BI方向),一名同样在路上的学习者。
服务过行业:零售特别是鞋服类的零售行业,电商(淘宝、天猫、京东、唯品会)

技术路线从一名普通用户,通过Excel软件的学习,从此走向数据世界,非科班IT专业人士。
历经重重难关,终于在数据的道路上达到技术平原期,学习众多的知识不再太吃力,同时也形成了自己的一套数据解决方案(数据采集、数据加工清洗、数据多维建模、数据报表展示等)。

擅长技术领域:Excel等Office家族软件、VBA&VSTO的二次开发、Sqlserver数据库技术、Sqlserver的商业智能BI技术、Powerbi技术、云服务器布署技术等等。

2018 began his career made a major adjustment, from the original full-time job, turned freelance, no fixed income, temporarily on the road ahead is not clear, bitter return to full-time job, for Excel catalyst operations and development must be greatly affected (within the time could not maintain full-time job can not just put the results in a work published in time, the time outside of work is very limited, because he has thirty years of age, family responsibility).

And the majority of advocates with expectations: Excel catalyst has been able to run down, I have the benefit of the group were able to support ( multi-message encouragement, friend circle under forwarded the recommendation under small a reward and the most focused and where the company can and recommended recommended peers, so I can maximize the value of technology in your company to achieve a win-win (you can imagine how the data is preliminary consultant or small projects to develop forms of cooperation).

Guess you like

Origin www.cnblogs.com/ExcelCuiHuaJi/p/11225036.html