将 avi 转换为 asf 的代码

发布于 2024-07-16 15:31:31 字数 3121 浏览 1 评论 0 原文

无论使用什么库/SDK,我都希望非常快速地从 avi 转换为 asf(我什至可以牺牲一些视频和音频的质量)。 我正在Windows平台上工作(Vista和2008 Server),更好的.Net SDK/代码,C++代码也可以。 :-)

我从下面的链接了解到,可能有一种非常快速的方法可以从 avi 转换为 asf 以更好地支持流媒体,如前面提到的“可以使用简单的副本将视频从 AVI 转换为 ASF 格式(即内容是相同,但容器发生变化)。”。 我的问题是,经过几个小时的学习和试用各种 SDK/工具后,作为新手,我不知道如何开始,所以我要求参考示例代码来完成此任务。 :-)

(因为这是一个不同的问题,我们决定开始一个新主题。:-) )

问题带有流式 AVI 文件

提前致谢, 乔治

编辑1:

我试图从

http://ffmpeg.arrozcru.org/autobuilds/ffmpeg-latest-mingw32-static.tar.bz2

然后运行以下命令,

C:\software\ffmpeg-latest-mingw32-static\bin>ffmpeg.exe -i test.avi -acodec copy
 -vcodec copy test.asf
FFmpeg version SVN-r18506, Copyright (c) 2000-2009 Fabrice Bellard, et al.
  configuration: --enable-memalign-hack --prefix=/mingw --cross-prefix=i686-ming
w32- --cc=ccache-i686-mingw32-gcc --target-os=mingw32 --arch=i686 --cpu=i686 --e
nable-avisynth --enable-gpl --enable-zlib --enable-bzlib --enable-libgsm --enabl
e-libfaac --enable-pthreads --enable-libvorbis --enable-libmp3lame --enable-libo
penjpeg --enable-libtheora --enable-libspeex --enable-libxvid --enable-libfaad -
-enable-libschroedinger --enable-libx264
  libavutil     50. 3. 0 / 50. 3. 0
  libavcodec    52.25. 0 / 52.25. 0
  libavformat   52.32. 0 / 52.32. 0
  libavdevice   52. 2. 0 / 52. 2. 0
  libswscale     0. 7. 1 /  0. 7. 1
  built on Apr 14 2009 04:04:47, gcc: 4.2.4
Input #0, avi, from 'test.avi':
  Duration: 00:00:44.86, start: 0.000000, bitrate: 5291 kb/s
    Stream #0.0: Video: msvideo1, rgb555le, 1280x1024, 5 tbr, 5 tbn, 5 tbc
    Stream #0.1: Audio: pcm_s16le, 22050 Hz, mono, s16, 352 kb/s
Output #0, asf, to 'test.asf':
    Stream #0.0: Video: CRAM / 0x4D415243, rgb555le, 1280x1024, q=2-31, 1k tbn,
5 tbc
    Stream #0.1: Audio: pcm_s16le, 22050 Hz, mono, s16, 352 kb/s
Stream mapping:
  Stream #0.0 -> #0.0
  Stream #0.1 -> #0.1
Press [q] to stop encoding
frame=  224 fps=222 q=-1.0 Lsize=   29426kB time=44.80 bitrate=5380.7kbits/s

video:26910kB audio:1932kB global headers:0kB muxing overhead 2.023317%

C:\software\ffmpeg-latest-mingw32-static\bin>

http://www.microsoft.com/windows /windowsmedia/player/webhelp/default.aspx?&mpver=11.0.6001.7000&id=C00D11B1&contextid=230&originalid=C00D36E6

然后使用Windows Media Player播放时出现以下错误,是否有人有主意吗?

http://www.microsoft.com/windows/windowsmedia/player/webhelp/default.aspx?&mpver=11.0.6001.7000&id=C00D11B1&contextid=230&originalid=C00D36E6

No matter what library/SDK to use, I want to convert from avi to asf very quickly (I could even sacrifice some quality of video and audio). I am working on Windows platform (Vista and 2008 Server), better .Net SDK/code, C++ code is also fine. :-)

I learned from the below link, that there could be a very quick way to convert from avi to asf to support streaming better, as mentioned "could convert the video from AVI to ASF format using a simple copy (i.e. the content is the same, but container changes).". My question is after some hours of study and trial various SDK/tools, as a newbie, I do not know how to begin with so I am asking for reference sample code to do this task. :-)

(as this is a different issue, we decide to start a new topic. :-) )

Issue with streaming AVI files

thanks in advance,
George

EDIT 1:

I have tried to get the binary of ffmpeg from,

http://ffmpeg.arrozcru.org/autobuilds/ffmpeg-latest-mingw32-static.tar.bz2

then run the following command,

C:\software\ffmpeg-latest-mingw32-static\bin>ffmpeg.exe -i test.avi -acodec copy
 -vcodec copy test.asf
FFmpeg version SVN-r18506, Copyright (c) 2000-2009 Fabrice Bellard, et al.
  configuration: --enable-memalign-hack --prefix=/mingw --cross-prefix=i686-ming
w32- --cc=ccache-i686-mingw32-gcc --target-os=mingw32 --arch=i686 --cpu=i686 --e
nable-avisynth --enable-gpl --enable-zlib --enable-bzlib --enable-libgsm --enabl
e-libfaac --enable-pthreads --enable-libvorbis --enable-libmp3lame --enable-libo
penjpeg --enable-libtheora --enable-libspeex --enable-libxvid --enable-libfaad -
-enable-libschroedinger --enable-libx264
  libavutil     50. 3. 0 / 50. 3. 0
  libavcodec    52.25. 0 / 52.25. 0
  libavformat   52.32. 0 / 52.32. 0
  libavdevice   52. 2. 0 / 52. 2. 0
  libswscale     0. 7. 1 /  0. 7. 1
  built on Apr 14 2009 04:04:47, gcc: 4.2.4
Input #0, avi, from 'test.avi':
  Duration: 00:00:44.86, start: 0.000000, bitrate: 5291 kb/s
    Stream #0.0: Video: msvideo1, rgb555le, 1280x1024, 5 tbr, 5 tbn, 5 tbc
    Stream #0.1: Audio: pcm_s16le, 22050 Hz, mono, s16, 352 kb/s
Output #0, asf, to 'test.asf':
    Stream #0.0: Video: CRAM / 0x4D415243, rgb555le, 1280x1024, q=2-31, 1k tbn,
5 tbc
    Stream #0.1: Audio: pcm_s16le, 22050 Hz, mono, s16, 352 kb/s
Stream mapping:
  Stream #0.0 -> #0.0
  Stream #0.1 -> #0.1
Press [q] to stop encoding
frame=  224 fps=222 q=-1.0 Lsize=   29426kB time=44.80 bitrate=5380.7kbits/s

video:26910kB audio:1932kB global headers:0kB muxing overhead 2.023317%

C:\software\ffmpeg-latest-mingw32-static\bin>

http://www.microsoft.com/windows/windowsmedia/player/webhelp/default.aspx?&mpver=11.0.6001.7000&id=C00D11B1&contextid=230&originalid=C00D36E6

then have the following error when using Windows Media Player to play it, does anyone have any ideas?

http://www.microsoft.com/windows/windowsmedia/player/webhelp/default.aspx?&mpver=11.0.6001.7000&id=C00D11B1&contextid=230&originalid=C00D36E6

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(1

还不是爱你 2024-07-23 15:31:31

也许你可以使用 FFMPEG 并运行这样的命令(我没有尝试过):

ffmpeg.exe -i test.avi -acodec copy -vcodec copy test.asf

Maybe you could use FFMPEG and run a command like this (I haven't tried):

ffmpeg.exe -i test.avi -acodec copy -vcodec copy test.asf
~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文