【问题标题】:How to get video duration and video Artist name in PHP?如何在 PHP 中获取视频时长和视频艺术家姓名?
【发布时间】:2018-06-13 06:21:21
【问题描述】:

我想知道如何在 PHP 中上传视频文件时获取持续时间和视频艺术家姓名。该文件可以是任何视频格式。

【问题讨论】:

  • 这些变量(持续时间、视频艺术家姓名)在首次上传时需要与视频文件一起添加,没有合理的方法来检索这些信息,因为视频文件仅在 php 中提供。

标签: php codeigniter file-upload image-uploading


【解决方案1】:

您需要在用户或您自己上传视频时添加这些变量>

有点像

<head>
    <meta charset="utf-8">
    <meta http-equiv="X-UA-Compatible" content="IE=edge">
    <meta name="viewport" content="width=device-width, initial-scale=1">
    <title>Bootstrap 101 Template</title>
    <!-- HTML5 Shim and Respond.js IE8 support of HTML5 elements and media queries -->
    <!-- WARNING: Respond.js doesn't work if you view the page via file:// -->
    <!--[if lt IE 9]>
        <script src="https://oss.maxcdn.com/html5shiv/3.7.2/html5shiv.min.js"></script>
        <script src="https://oss.maxcdn.com/respond/1.4.2/respond.min.js"></script>
    <![endif]-->
</head>

<body>
     <input type="text" name="video_name" placeholder="Video Name">
     <input type="text" name="video_duration" placeholder="Video Duration">
     <input type="file" name="video_file">
</body>

然后在您的 php 脚本中检索 post 变量并将其添加到数据库表或任何您想要对其执行的操作,您的问题缺少详细信息。

您也可以使用php-mp4info 库来读取视频文件元数据,但这需要每个视频都附加元数据。

【讨论】:

    猜你喜欢
    • 1970-01-01
    • 2012-09-09
    • 2012-12-04
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    相关资源
    最近更新 更多