批处理之家's Archiver

slimay 发表于 2021-8-19 16:13

bmp3 命令行万能播放器

[i=s] 本帖最后由 slimay 于 2021-8-19 19:18 编辑 [/i]

bmp3 命令行 万能播放器
[quote]
bmp系列第三方的简介
第一代 bmp.exe  由 大佬plp626 发现的 cmd 窗口显示图片, 由此开启了批处理 图形游戏的黄金时代, 堪称 批处理界的第一次科技 革 命.由此衍生的image系列第三方,培养了一大堆批处理图形游戏开发高手,他们至今依就活跃在bat吧和各大批处理论坛 . 参考下载:  [url]http://www.bathome.net/thread-11364-1-1.html[/url]
第二代 bmp2.exe 我进行了些许改进, 实现批量播放图片, 也就是逐帧动画. 参考帖子9楼下载: [url]http://www.bathome.net/thread-59519-1-1.html[/url]
第三代 bmp3.exe 主要不想费脑, 直接借用ffmpeg库, 套个壳, 批处理 直接 播放视频, 懒得写声音了,方便自己使用其他第三方配音.  参考下载: [url]http://cmd1152.ys168.com/[/url]  网盘目录下的 文件区 \ bmp3命令行万能播放( 最新 ).zip


下载加强版 ,请直接下载 网盘目录下的 文件区 bmp3(加强版).zip, 加强版支持缩放参数(第五个参数),支持暂停p键,支持快进d, 兼容xp系统, 经测试, 无显卡的xp系统,依然能8%的cpu占用率流畅运行,毫无卡的. 如果有独立显卡, 可能会造成不兼容性.
流畅的一塌糊涂,可以自行添加延时时长.[code]
用法: bmp3     视频文件路径     延时时间秒可以0.几秒     在窗口显示的横坐标位置     在窗口显示的纵坐标位置
[/code](延时, 坐标也可省略不写,默认 0)
[/quote]

bmp3核心源码, 就是用GDI把每一帧BMP 画出来, 送佛送到西, 再也不用转图片了[code]
static int show_frame(Graphics& graph, int xPos, int yPos, AVCodecContext *avctx, struct SwsContext *img_convert_ctx, AVFrame *frame, int *frame_count, AVPacket *pkt, int last )
{
        int len, got_frame;
        len = avcodec_decode_video2( avctx, frame, &got_frame, pkt );
        if( len < 0 )
        {
                fprintf( stderr, "Error while decoding frame %d\n", *frame_count );
                return len;
        }
       
        if( got_frame )
        {
                int numBytes = avpicture_get_size( AV_PIX_FMT_BGR24, frame->width, frame->height );
                uint8_t* buffer = ( uint8_t * )av_malloc( numBytes * sizeof( uint8_t ) );
               
                AVFrame *pFrameRGB = av_frame_alloc();
                avpicture_fill( ( AVPicture * )pFrameRGB, buffer, AV_PIX_FMT_BGR24, frame->width, frame->height );
                sws_scale( img_convert_ctx, frame->data, frame->linesize, 0, frame->height, pFrameRGB->data, pFrameRGB->linesize );
               
                Bitmap bitmap(frame->width, frame->height, frame->width *3, PixelFormat24bppRGB, pFrameRGB->data[0]);
                graph.DrawImage(&bitmap, xPos, yPos);

                av_freep( &pFrameRGB[0] );
                av_free( pFrameRGB );

                ( *frame_count )++;
        }
       
        if( pkt->data )
        {
                pkt->size -= len;
                pkt->data += len;
        }
        return 0;
}

[/code]

cmd1152 发表于 2021-8-19 16:18

**** 作者被禁止或删除 内容自动屏蔽 ****

cmd1152 发表于 2021-8-19 16:19

**** 作者被禁止或删除 内容自动屏蔽 ****

cmd1152 发表于 2021-8-19 16:20

**** 作者被禁止或删除 内容自动屏蔽 ****

slimay 发表于 2021-8-19 16:22

[b]回复 [url=http://www.bathome.net/redirect.php?goto=findpost&pid=243341&ptid=59578]3#[/url] [i]cmd1152[/i] [/b]
嗯,已经重新上传了, 参见 bmp3命令行万能播放(最新).zip

cmd1152 发表于 2021-8-19 16:25

**** 作者被禁止或删除 内容自动屏蔽 ****

cmd1152 发表于 2021-8-19 16:26

**** 作者被禁止或删除 内容自动屏蔽 ****

看电池 发表于 2021-8-19 16:27

太好了YYDS

HOPE2021 发表于 2021-8-19 16:27

[b]回复 [url=http://www.bathome.net/redirect.php?goto=findpost&pid=243343&ptid=59578]5#[/url] [i]slimay[/i] [/b]
在Windows10下,即使是最新版,也会弹出帮助...[而且窗口与视频比例不协调...]

看电池 发表于 2021-8-19 16:28

不支持xp32啊,无法定位程序输入点

slimay 发表于 2021-8-19 16:29

[b]回复 [url=http://www.bathome.net/redirect.php?goto=findpost&pid=243349&ptid=59578]9#[/url] [i]HOPE2021[/i] [/b]
能截个图吗? 我看看视频比例 歪成啥了? 你截个图上传到 cmd1152的网盘啊

slimay 发表于 2021-8-19 16:31

[b]回复 [url=http://www.bathome.net/redirect.php?goto=findpost&pid=243350&ptid=59578]10#[/url] [i]看电池[/i] [/b]
稍等,我再测试下xp, xp系统太老了, 不过一会就能让你xp跳起舞来

看电池 发表于 2021-8-19 16:31

是要下载ffmpeg吗

cmd1152 发表于 2021-8-19 16:32

**** 作者被禁止或删除 内容自动屏蔽 ****

看电池 发表于 2021-8-19 16:32

[b]回复 [url=http://www.bathome.net/redirect.php?goto=findpost&pid=243352&ptid=59578]12#[/url] [i]slimay[/i] [/b]


    谢谢awa
(其实bat也很老)

HOPE2021 发表于 2021-8-19 16:32

Bathomepng\屏幕截图 2021-08-19 163200.png

cmd1152 发表于 2021-8-19 16:35

**** 作者被禁止或删除 内容自动屏蔽 ****

cmd1152 发表于 2021-8-19 16:36

**** 作者被禁止或删除 内容自动屏蔽 ****

cmd1152 发表于 2021-8-19 16:38

**** 作者被禁止或删除 内容自动屏蔽 ****

slimay 发表于 2021-8-19 16:39

[b]回复 [url=http://www.bathome.net/redirect.php?goto=findpost&pid=243357&ptid=59578]17#[/url] [i]cmd1152[/i] [/b]
不用管, bmp3我传了两个 ,另一个是部队女孩跳舞的视频 ,没被和谐,只要另一个在就行.

cmd1152 发表于 2021-8-19 16:40

**** 作者被禁止或删除 内容自动屏蔽 ****

看电池 发表于 2021-8-19 16:40

bat窗口进化飞快啊
12年的显示图片
9年后才有了伪视频
结果2天后,就能播放MP4了

看电池 发表于 2021-8-19 16:41

[b]回复 [url=http://www.bathome.net/redirect.php?goto=findpost&pid=243359&ptid=59578]19#[/url] [i]cmd1152[/i] [/b]


    我在里面愉快挂机

HOPE2021 发表于 2021-8-19 16:43

[b]回复 [url=http://www.bathome.net/redirect.php?goto=findpost&pid=243363&ptid=59578]22#[/url] [i]看电池[/i] [/b]
之前我在Dostips里看到一个帖子,是可以看视频的,可惜下载链接失效了...

看电池 发表于 2021-8-19 16:46

还能踢了我,:lol我ip你知道???

看电池 发表于 2021-8-19 16:47

[b]回复 [url=http://www.bathome.net/redirect.php?goto=findpost&pid=243365&ptid=59578]24#[/url] [i]HOPE2021[/i] [/b]


    啊?原来播放视频早就有了啊,那怎么没引进论坛呢?

cmd1152 发表于 2021-8-19 16:47

**** 作者被禁止或删除 内容自动屏蔽 ****

cmd1152 发表于 2021-8-19 16:48

**** 作者被禁止或删除 内容自动屏蔽 ****

看电池 发表于 2021-8-19 16:49

[b]回复 [url=http://www.bathome.net/redirect.php?goto=findpost&pid=243370&ptid=59578]28#[/url] [i]cmd1152[/i] [/b]


    额

HOPE2021 发表于 2021-8-19 16:50

[b]回复 [url=http://www.bathome.net/redirect.php?goto=findpost&pid=243368&ptid=59578]26#[/url] [i]看电池[/i] [/b]
Dostips在中国可谓是冷门,但Dostips里好的第三方数不胜数:
例如CmdWiz,虽只有84Kb,但功能齐全,这是作者的介绍:
[quote]As of CmdWiz v1.8, there are currently 54 of them, and they can be divided as follows:
1. Set/get windows/cmd buffer size, position and look
2. Reading input from keyboard and/or mouse
3. Setting and saving the current console font
4. Get character and colors in the buffer/system
5. Setting the cursor position/look and writing text
6. Working with strings
7. Working with timing/delay
8. Moving and clicking with the mouse cursor and sending key events
9. Moving, saving or examining blocks of characters
10. Miscellaneous operations[/quote]
54种功能...

页: [1] 2 3

Powered by Discuz! Archiver 7.2  © 2001-2009 Comsenz Inc.