dsovc00684 2018-06-13 06:21
浏览 32
已采纳

如何在PHP中获取视频时长和视频艺术家名称?

I want to know how to get the duration and Video Artist Name on upload video file in PHP. The file can be in any video format.

  • 写回答

1条回答 默认 最新

  • dss087358 2018-06-13 06:28
    关注

    You would need to add these variables when the video is uploaded by the user or yourself there is no reasonable way (that doesn't involve lots of work) to get that information given only a video file in php.

    Something like

    <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>
    

    Then in your php script you retrieve the post variables and add it to a database table or whatever you want to do with it, your question is short on details.

    You could also use php-mp4info library to read the video file meta data but that requires every video has meta data attached.

    本回答被题主选为最佳回答 , 对您是否有帮助呢?
    评论

报告相同问题?

悬赏问题

  • ¥20 怎么用dlib库的算法识别小麦病虫害
  • ¥15 华为ensp模拟器中S5700交换机在配置过程中老是反复重启
  • ¥15 java写代码遇到问题,求帮助
  • ¥15 uniapp uview http 如何实现统一的请求异常信息提示?
  • ¥15 有了解d3和topogram.js库的吗?有偿请教
  • ¥100 任意维数的K均值聚类
  • ¥15 stamps做sbas-insar,时序沉降图怎么画
  • ¥15 买了个传感器,根据商家发的代码和步骤使用但是代码报错了不会改,有没有人可以看看
  • ¥15 关于#Java#的问题,如何解决?
  • ¥15 加热介质是液体,换热器壳侧导热系数和总的导热系数怎么算