播放 MPEG 电影,在特定位置开始和结束?

发布于 2024-09-16 11:02:51 字数 181 浏览 10 评论 0 原文

我已经使用 FFMPEG 将 MTS 视频编译为 MP4 格式。视频时长2分钟。

我希望能够播放视频,但从 0:15 秒开始并在 0:45 秒结束。实际上,我希望播放软件仅显示 30 秒的可用播放时间。该软件必须是基于 Flash 的应用程序,才能集成到 HTML 中。

有谁知道有什么软件可以做到这一点?提前致谢。

I've compiled an MTS video into MP4 format using FFMPEG. The video is 2 minutes long.

I want to be able to play the video back but start at 0:15 seconds and end at 0:45 seconds. Effectively I want the playback software to only show 30 seconds of playback available. The software must be a Flash-based application for integration into HTML.

Does anyone know any software that'll do this? Thanks in advance.

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

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

发布评论

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

评论(2

等待我真够勒 2024-09-23 11:02:51
<?xml version="1.0" encoding="utf-8"?>

<mx:Style>
    @font-face {
        src:url("assets/arial.ttf");
        font-family: Arial;
    }

    .timeStyle {
        color: #FFFFFF;
        font-family: Arial;
        font-size: 12;
    }

    .playPauseStyle {
        /* play button skins */
        skin: Embed('assets/control_play.png');
        downSkin: Embed('assets/control_play_blue.png');

        /* pause button skins */
        selectedUpSkin: Embed('assets/control_pause.png');
        selectedOverSkin: Embed('assets/control_pause.png');
        selectedDownSkin: Embed('assets/control_pause_blue.png');
    }

    .stopStyle {
        skin: Embed('assets/control_stop.png');
        downSkin: Embed('assets/control_stop_blue.png');
    }

    .controllerStyle {
        bottom: 5;
        left: 5;
        right: 5;
        paddingBottom: 5;
        paddingLeft: 5;
        paddingRight: 5;
        paddingTop: 5;
        alpha: 0;
        background-color: #000000;
        background-alpha: 0.5;
    }
</mx:Style>

<mx:Script>
    <![CDATA[
        import mx.events.VideoEvent;

        private function showControls():void {
            fadeIn.play([controls]);
        }

        private function hideControls():void {
            fadeOut.play([controls]);
        }

        private function videoDisplay_playheadUpdate(evt:VideoEvent):void {
            var pTime:Date = new Date(videoDisplay.playheadTime * 1000 || 100);
            var tTime:Date = new Date(videoDisplay.totalTime * 1000);
            time.text = dateFormatter.format(pTime) + " / " + dateFormatter.format(tTime);
        }

        private function playPauseButton_click(evt:MouseEvent):void {
            if (videoDisplay.playing) {
                videoDisplay.pause();
            } else {
                videoDisplay.playheadTime=**YOUR TIME HERE**
                videoDisplay.play();
            }
        }

        private function stopButton_click(evt:MouseEvent):void {
            videoDisplay.stop();
        }
    ]]>
</mx:Script>

<mx:Fade id="fadeIn" alphaFrom="0.0" alphaTo="1.0" />
<mx:Fade id="fadeOut" alphaFrom="1.0" alphaTo="0.0" />

<mx:DateFormatter id="dateFormatter" formatString="NN:SS" />

<mx:Label text="Mouse over the VideoDisplay control below to show control buttons." />
<mx:Canvas rollOver="showControls()" rollOut="hideControls()">
    <mx:VideoDisplay id="videoDisplay" source="http://www.helpexamples.com/flash/video/caption_video.flv" autoPlay="false" playheadUpdate="videoDisplay_playheadUpdate(event)" />
    <mx:HBox id="controls" styleName="controllerStyle" alpha="0.0">
        <mx:Button id="playPauseButton" styleName="playPauseStyle" toggle="true" selected="{videoDisplay.playing}" click="playPauseButton_click(event)" />
        <mx:Button id="stopButton" styleName="stopStyle" click="stopButton_click(event)" />
        <mx:Spacer width="100%" />
        <mx:Label id="time" styleName="timeStyle" />
    </mx:HBox>
</mx:Canvas>

或在此处查看更多信息
http://blog.flexexamples.com/2007/08/05/building-a-basic-controller-for-the-videodisplay-control/comment-page-1/#comment-329

<?xml version="1.0" encoding="utf-8"?>

<mx:Style>
    @font-face {
        src:url("assets/arial.ttf");
        font-family: Arial;
    }

    .timeStyle {
        color: #FFFFFF;
        font-family: Arial;
        font-size: 12;
    }

    .playPauseStyle {
        /* play button skins */
        skin: Embed('assets/control_play.png');
        downSkin: Embed('assets/control_play_blue.png');

        /* pause button skins */
        selectedUpSkin: Embed('assets/control_pause.png');
        selectedOverSkin: Embed('assets/control_pause.png');
        selectedDownSkin: Embed('assets/control_pause_blue.png');
    }

    .stopStyle {
        skin: Embed('assets/control_stop.png');
        downSkin: Embed('assets/control_stop_blue.png');
    }

    .controllerStyle {
        bottom: 5;
        left: 5;
        right: 5;
        paddingBottom: 5;
        paddingLeft: 5;
        paddingRight: 5;
        paddingTop: 5;
        alpha: 0;
        background-color: #000000;
        background-alpha: 0.5;
    }
</mx:Style>

<mx:Script>
    <![CDATA[
        import mx.events.VideoEvent;

        private function showControls():void {
            fadeIn.play([controls]);
        }

        private function hideControls():void {
            fadeOut.play([controls]);
        }

        private function videoDisplay_playheadUpdate(evt:VideoEvent):void {
            var pTime:Date = new Date(videoDisplay.playheadTime * 1000 || 100);
            var tTime:Date = new Date(videoDisplay.totalTime * 1000);
            time.text = dateFormatter.format(pTime) + " / " + dateFormatter.format(tTime);
        }

        private function playPauseButton_click(evt:MouseEvent):void {
            if (videoDisplay.playing) {
                videoDisplay.pause();
            } else {
                videoDisplay.playheadTime=**YOUR TIME HERE**
                videoDisplay.play();
            }
        }

        private function stopButton_click(evt:MouseEvent):void {
            videoDisplay.stop();
        }
    ]]>
</mx:Script>

<mx:Fade id="fadeIn" alphaFrom="0.0" alphaTo="1.0" />
<mx:Fade id="fadeOut" alphaFrom="1.0" alphaTo="0.0" />

<mx:DateFormatter id="dateFormatter" formatString="NN:SS" />

<mx:Label text="Mouse over the VideoDisplay control below to show control buttons." />
<mx:Canvas rollOver="showControls()" rollOut="hideControls()">
    <mx:VideoDisplay id="videoDisplay" source="http://www.helpexamples.com/flash/video/caption_video.flv" autoPlay="false" playheadUpdate="videoDisplay_playheadUpdate(event)" />
    <mx:HBox id="controls" styleName="controllerStyle" alpha="0.0">
        <mx:Button id="playPauseButton" styleName="playPauseStyle" toggle="true" selected="{videoDisplay.playing}" click="playPauseButton_click(event)" />
        <mx:Button id="stopButton" styleName="stopStyle" click="stopButton_click(event)" />
        <mx:Spacer width="100%" />
        <mx:Label id="time" styleName="timeStyle" />
    </mx:HBox>
</mx:Canvas>

or see more here
http://blog.flexexamples.com/2007/08/05/building-a-basic-controller-for-the-videodisplay-control/comment-page-1/#comment-329

生生漫 2024-09-23 11:02:51

我发现一些服务器端软件可以解决这个问题:

http://h264.code-shop.com /

有不同的版本,具体取决于您运行的网络服务器。允许视频流式传输。还可以让您决定从哪里开始和结束。

I found some server-side software that'll do the trick:

http://h264.code-shop.com/

Available in different flavours depending what web server you're running. Allows the video to be streamed. Also lets you decice where to start and end.

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