将压缩的 swf 转换为 mp4 [英] Convert compressed swf to mp4

查看:29
本文介绍了将压缩的 swf 转换为 mp4的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我正在寻找一个批处理脚本来将 swf 转换为 mp4,无损.我尝试同时使用 ffmpeg 和手刹,但显然 swf 是压缩的,我无法以这种方式转换它们.

I'm looking for a batch script to convert swf to mp4, lossless. I tried using both ffmpeg and handbrake, but apparently swf is compressed and I can't convert them this way.

ffmpeg -i input -c:v libx264 -preset ultrafast -qp 0 output.mkv

HandBrakeCLI -i source -o destination

我知道我使用像 xilisoft 这样的工具,但我有 3000 多个视频,需要自动运行.是否有脚本/算法可以帮助我自动执行此过程?

I know I acn use a tool like xilisoft, but I've more than 3000 videos and would need to run this automatically. Is there a script/ algorithm that can help me automate this process?

推荐答案

获得咬牙切齿:

git clone git://git.sv.gnu.org/gnash.git

在构建之前,您需要一堆依赖项(应该能够全部获取):

You'll need a bunch of dependencies before you can build it (should be able to apt-get them all):

libsdl-dev
libboost-dev
libagg-dev

然后配置和构建 gnash 视频转储器:

Then configure and build the gnash video dumper:

cd gnash

./autogen.sh

./configure --enable-renderer=agg 
               --enable-gui=dump 
               --disable-menus 
               --enable-media=ffmpeg 
               --disable-jemalloc

make

然后您可以将 dump-gnash 指向 swf,它会渲染出原始视频和音频

you can then point dump-gnash at a swf and it will render out the raw video and audio

dump-gnash -1 
                   -D /tmp/out.raw@30 
                   -A /tmp/out.wav                       
                   -P "FlashVars=myURL=http://example.com/blah&online=true" 
                   http://example.com/blah/some.swf 

这将以 30fps(@30 位)和 /tmp/out.wav

This will write out /tmp/out.raw (which is bgra aka rgb32 video) at 30fps (the @30 bit) and /tmp/out.wav

这些需要重新组合成例如mp4 使用:

These need re-combining into e.g. mp4 using:

ffmpeg -i /tmp/out.wav 
       -f rawvideo 
       -pix_fmt rgb32 
       -s:v 800x550 
       -r 30 
       -i /tmp/out.raw 
       -c:v libx264 
       -r 30 
       -b 160k 
       /tmp/out.mp4

由于其原始视频,ffmpeg 需要知道颜色空间 (rga32) 尺寸和输入 fps.我们告诉它结合音频(160kbps mp3),以 30fps 的速度渲染视频

because its raw video, ffmpeg needs to know colourspace (rga32) dimensions and input fps. We tell it to combine the audio (160kbps mp3), render the video back out at 30fps

您需要额外的标志才能获得无损 mp4.

You'll need additional flags to get the lossless mp4.

这篇关于将压缩的 swf 转换为 mp4的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆