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.

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

报告相同问题?

悬赏问题

  • ¥15 用visualstudio2022创建vue项目后无法启动
  • ¥15 问一下,定向解包是什么意思
  • ¥15 x趋于0时tanx-sinx极限可以拆开算吗
  • ¥500 把面具戴到人脸上,请大家贡献智慧
  • ¥15 任意一个散点图自己下载其js脚本文件并做成独立的案例页面,不要作在线的,要离线状态。
  • ¥15 各位 帮我看看如何写代码,打出来的图形要和如下图呈现的一样,急
  • ¥30 c#打开word开启修订并实时显示批注
  • ¥15 如何解决ldsc的这条报错/index error
  • ¥15 VS2022+WDK驱动开发环境
  • ¥30 关于#java#的问题,请各位专家解答!