dqz30992 2012-03-16 12:42
浏览 54
已采纳

如何在PHPmotion中使用ffmpeg&mp4box将视频从任何视频转换为mp4时减小文件大小?

I am using ffmpeg & mp4box in my PHPmotion site to convert videos to mp4 format. When I convert a 50MB video to mp4, the file size remain same. So Its affecting the video streaming in my site. So I want to reduce the file size of the video in conversion. This is my code example, that I've used the site for converting m4v videos in PHPmotion.

$ffmpeg_cmd2_2 = "$config[path_to_ffmpeg] -i $raw_video_path -vcodec libx264 -vpre veryfast -crf 15 -b 5120000 -threads 0 -acodec libfaac -ac 2 -ab 128k -ar 44100 -f mp4 $new_flv_1";
$mp4box_cmd = "$mp4box_path -add $new_flv_1 $new_flv_2" 

When I use this command,it converts the m4v file to mp4 format, but the filesize doesn't change. What command I should use in this to reduce the filesize during video conversion in PHPmotion? Can anyone write a ffmpeg command to reduce the filesize during conversion ?

  • 写回答

2条回答 默认 最新

  • dp709369831 2012-03-21 21:05
    关注

    There are two main factors involve in reducing the size of mp4 video

    i: width and height of video, greater their widths, greater will be size and slower will be streaming e,g 360p, 480p, 720p, 1080p

    ii: video bitrate, greater will be their bitrate, higher will be quality, size and slower will be their streaming.

    For faster streaming i recommend using

    i: 480x360 or lower width and height of video ii: -b value 360k or lower. iii: -ab value 64k (optional)

    Hope this will help you.

    本回答被题主选为最佳回答 , 对您是否有帮助呢?
    评论
查看更多回答(1条)

报告相同问题?

悬赏问题

  • ¥15 基于卷积神经网络的声纹识别
  • ¥15 Python中的request,如何使用ssr节点,通过代理requests网页。本人在泰国,需要用大陆ip才能玩网页游戏,合法合规。
  • ¥100 为什么这个恒流源电路不能恒流?
  • ¥15 有偿求跨组件数据流路径图
  • ¥15 写一个方法checkPerson,入参实体类Person,出参布尔值
  • ¥15 我想咨询一下路面纹理三维点云数据处理的一些问题,上传的坐标文件里是怎么对无序点进行编号的,以及xy坐标在处理的时候是进行整体模型分片处理的吗
  • ¥15 CSAPPattacklab
  • ¥15 一直显示正在等待HID—ISP
  • ¥15 Python turtle 画图
  • ¥15 stm32开发clion时遇到的编译问题