2010-08-26 68 views
0

我已經使用FFMPEG將MTS視頻編譯爲MP4格式。該視頻是2分鐘長。播放MPEG電影,在特定的地方開始和結束?

我希望能夠播放視頻,但是從0:15秒開始並在0:45秒結束。實際上,我希望播放軟件只顯示30秒的播放時間。該軟件必須是基於Flash的應用程序才能集成到HTML中。

有沒有人知道任何軟件會這樣做?提前致謝。

+1

我知道這並不能回答你的問題,但是將視頻裁剪到你需要的部分不是更好嗎? – Zugwalt 2010-08-26 18:41:19

+0

你的意思是記錄30秒並將其保存爲單獨的剪輯? – Reado 2010-08-26 18:44:43

+1

葉,使用例如MS Movie Maker來裁剪它。 – Eugene 2010-08-27 14:44:25

回答

0

我發現了一些服務器端軟件,會做的伎倆:

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

根據您運行的Web服務器的不同而有不同的風格。允許視頻流式傳輸。也可以讓你決定從哪裏開始和結束。

0
<?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

+0

謝謝,只是想,如果你想要做的只是查看30秒,你將如何阻止播放器下載和緩衝整個視頻? YouTube似乎這樣做 - 如果您通過視頻中途切換到另一個SD/HD模式,則它會繼續中途而不是回到起點。或者是因爲他們使用視頻流媒體服務器? – Reado 2010-08-27 20:23:27

+0

哦,它是因爲它們是通過RTMP協議從服務器流式傳輸到FMS或Red5,並且您可以控制** live **視頻通道的緩衝。 – Eugene 2010-08-28 03:05:01