• 设为首页
  • 点击收藏
  • 手机版
    手机扫一扫访问
    迪恩网络手机版
  • 关注官方公众号
    微信扫一扫关注
    公众号

Java VGet类代码示例

原作者: [db:作者] 来自: [db:来源] 收藏 邀请

本文整理汇总了Java中com.github.axet.vget.VGet的典型用法代码示例。如果您正苦于以下问题:Java VGet类的具体用法?Java VGet怎么用?Java VGet使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。



VGet类属于com.github.axet.vget包,在下文中一共展示了VGet类的7个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于我们的系统推荐出更棒的Java代码示例。

示例1: map

import com.github.axet.vget.VGet; //导入依赖的package包/类
public void map(LongWritable key, Text url, OutputCollector<Text, Text> output, Reporter reporter) throws IOException {

            File videoDownloadDir = Files.createTempDir();
            VGet v = new VGet(new URL(url.toString()), videoDownloadDir);
            v.download();
            System.loadLibrary(Core.NATIVE_LIBRARY_NAME);
            File[] videoFiles = videoDownloadDir.listFiles();
            Arrays.sort(videoFiles);
            File[] videoFramesFiles = VideoProcessing.parseVideo(videoFiles[0], 70);
            File[] processedVideoFrames = VideoProcessing.cutImages(videoFramesFiles);

            Tesseract instance = Tesseract.getInstance();
            instance.setDatapath("/usr/share/tesseract-ocr");
            instance.setTessVariable("LC_NUMERIC", "C");

            for (File image: processedVideoFrames) {
                String result = null;
                try {
                    result = instance.doOCR(image);
                } catch (TesseractException e) {
                    e.printStackTrace();
                }
                if (!result.isEmpty()) {
                    word.set(result);
                    output.collect(url, word);
                }
            }
        }
 
开发者ID:yurinnick,项目名称:hadoop-video-ocr,代码行数:29,代码来源:HadoopOCR.java


示例2: downloadVideo

import com.github.axet.vget.VGet; //导入依赖的package包/类
/**
 * Download video from youtube
 *
 * @param url Youtube url
 * @return name of video
 */
public static File downloadVideo(String url)
{
	try
	{
		VGet v = new VGet(new URL(url), new File("tmp/"));
		VGetParser user = new YouTubeMPGParser();
		v.download(user);
		DownloadedFileLogger.addYoutubeLink(url, "tmp/" + v.getTarget().getName());
		return v.getTarget();
	}
	catch (Exception | NoClassDefFoundError e)
	{
		Log.stackTrace(e.getStackTrace());
		return null;
	}
}
 
开发者ID:BITeam,项目名称:Telegram_Bot,代码行数:23,代码来源:FileDownloader.java


示例3: VGetVideo

import com.github.axet.vget.VGet; //导入依赖的package包/类
/**
 * @param url
 * @throws MalformedURLException 
 */
public VGetVideo(String url) throws MalformedURLException {
	VGet v = new VGet(new URL(url));
	v.extract();
	this.vid = new XuggleVideo(v.getVideo().getInfo().getSource());
	
}
 
开发者ID:openimaj,项目名称:openimaj,代码行数:11,代码来源:VGetVideo.java


示例4: testGetVideoStorage

import com.github.axet.vget.VGet; //导入依赖的package包/类
@Test
public void testGetVideoStorage() throws MalformedURLException {
       System.out.println("Test get video storage.");
	VimeoDownloader vimeoDownloader = new VimeoDownloader("https://www.vimeo.com/32369539", false);

	VideoInfo videoInfo = new VimeoInfoRetriever().retrieveVideoInfo("https://www.vimeo.com/32369539");
	VGet v = new VGet(videoInfo, new File(""));

	Path p = vimeoDownloader.getVideoStorage(v);
	assertNotNull(p);
	assertEquals(Paths.get(CacheConstants.cachePath, "03110","750","73389900.mp4"), p);
}
 
开发者ID:smartenit-eu,项目名称:smartenit,代码行数:13,代码来源:VimeoDownloaderTest.java


示例5: doDownload

import com.github.axet.vget.VGet; //导入依赖的package包/类
public void doDownload(VGet v, VGetParser user, VGetStatus notify, AtomicBoolean stop) {
	v.download(user, stop, notify);
}
 
开发者ID:callakrsos,项目名称:Gargoyle,代码行数:4,代码来源:UtubeDownloaderComposite.java


示例6: get

import com.github.axet.vget.VGet; //导入依赖的package包/类
/**
 * Gets a youtube video at the given url
 *
 * @param url - Youtube url
 * @return - Title of the video
 * @throws Exception - We really need to generalize these exceptions
 */
public static String get(URL url) throws Exception {
    //initates a VGet object with the temp directory, creating it if necessary
    File temp = new File(EzHttp.TEMP_LOCATION);
    temp.mkdir();
    VGet axetGetter = new VGet(url, temp);

    axetGetter.download(); //starts the download
    System.out.println("YT source: " + axetGetter.getVideo().getSource().toString()); //debug print

    //Determine whether one or two files were downloaded
    List<VideoFileInfo> info = axetGetter.getVideo().getInfo();
    int files = info.size();

    //more debug printouts
    System.out.println(files);
    System.out.println(info.get(0).getTarget().getAbsolutePath());

    String title = axetGetter.getVideo().getTitle(); //title of video

    /**
     * By default, vget downloads either one or two files - either a webm with both video and audio in it for less
     * secure videos, or seperate video and audio streams as an mp4 and webm file respectively.
     *
     * The following code block processes these files based on how many were downloaded, and packages them into a
     * nice single mp4 file in the actual download directory that the user specified.
     */
    if (files == 1) {
        Converter converter = new Converter();
        converter.convert(info.get(0).getTarget().getAbsoluteFile(), EzHttp.getDownloadLocation(), EzHttp.cleanseName(title) + ".mp4");
    } else if (files == 2) {
        Merge merger = new Merge();
        merger.merge(
                info.get(0).getTarget().getAbsoluteFile(),
                info.get(1).getTarget().getAbsoluteFile(),
                new File(EzHttp.getDownloadLocation()).getAbsolutePath(),
                EzHttp.cleanseName(title) + ".mp4"
        );
    }

    return title;
}
 
开发者ID:s-zeng,项目名称:ZTVDC,代码行数:49,代码来源:VGetInterface.java


示例7: getVideoStorage

import com.github.axet.vget.VGet; //导入依赖的package包/类
/**
 * The method that extracts the path where the video will be downloaded.
 * 
 * @param v
 *            The video information, as extracted by Vimeo.
 * 
 * @return The path where the video will be downloaded.
 * 
 */
public Path getVideoStorage(VGet v) {
    Pattern p = Pattern.compile(VimeoPatterns.vimeoFolders);
    Matcher m = p.matcher(v.getVideo().getInfo().getSource().toString());
    if (m.find()) {
        return Paths.get(CacheConstants.cachePath, m.group(2), m.group(3));
    }
    return null;
}
 
开发者ID:smartenit-eu,项目名称:smartenit,代码行数:18,代码来源:VimeoDownloader.java



注:本文中的com.github.axet.vget.VGet类示例整理自Github/MSDocs等源码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。


鲜花

握手

雷人

路过

鸡蛋
该文章已有0人参与评论

请发表评论

全部评论

专题导读
上一篇:
Java XMLReaderComposite类代码示例发布时间:2022-05-23
下一篇:
Java NormalAnnotationExpr类代码示例发布时间:2022-05-23
热门推荐
阅读排行榜

扫描微信二维码

查看手机版网站

随时了解更新最新资讯

139-2527-9053

在线客服(服务时间 9:00~18:00)

在线QQ客服
地址:深圳市南山区西丽大学城创智工业园
电邮:jeky_zhao#qq.com
移动电话:139-2527-9053

Powered by 互联科技 X3.4© 2001-2213 极客世界.|Sitemap