2011-08-24 15 views
9

मैं वर्तमान में एक HTML5 वीडियो प्लेयर को कस्टमाइज़ करने की कोशिश कर रहा हूं ताकि मैं एक बटन जोड़ सकूं जो वर्तमान फ्रेम नंबर लौटाता है।क्या मुझे एचटीएमएल 5 वीडियो में मौजूदा फ्रेम की संख्या मिल सकती है?

आइए कहें कि मेरे पास 30 सेकंड्स वीडियो है जो 90 सेकंड तक रहता है। जब मैं उस बटन पर क्लिक करता हूं तो मैं चाहता हूं कि यह मुझे वर्तमान फ्रेम की संख्या मुद्रित करे। क्या यह संभव है?

उत्तर

1

मुझे नहीं लगता कि ब्राउज़र में एक सेट मानक फ़्रेमेट है या एचटीएमएल 5 वीडियो के साथ बॉक्स के मौजूदा फ्रेम तक पहुंचने का कोई भी तरीका है। हालांकि आप क्या कर सकते हैं, प्रति सेकंड 2 9.9 7 फ्रेम के टेलीविजन मानक फ़्रेमेट का उपयोग करें और वीडियो की वर्तमान समय से इसे गुणा करें: (vid.currentTime * 29.97).toPrecision(6)

यहाँ एक बेला मैं प्रदर्शन कैसे एक बटन को यह बाध्य करने के लिए वर्तमान फ्रेम पाने के लिए की स्थापना की है: http://jsfiddle.net/893aM/1/

+1

हालांकि यह एक पुराने जवाब है, कृपया ध्यान दें है कि "टीवी मानक" नहीं अमेरिका में एक ही दुनिया के बाकी हिस्सों में के रूप में है। अधिकांश वेब वीडियो एन्कोड किए जाते हैं और वैसे भी @ 25FPS फिल्माए जाते हैं। – WesleyE

+0

'.currentTime' प्रति-फ्रेम स्तर तक पहुंचने के लिए लगभग सटीक नहीं है। – Brad

3

मुझे लगता है कि आप वेबकिट के लिए निम्नलिखित एपीआई का उपयोग कर सकते हैं/मोज़िला आधारित ब्राउज़र:

मोज़िला निम्नलिखित आंकड़ों को फ़ायरफ़ॉक्स में कार्यान्वित किया है:

mozParsedFrames - number of frames that have been demuxed and extracted out of the media. 
mozDecodedFrames - number of frames that have been decoded - converted into YCbCr. 
mozPresentedFrames - number of frames that have been presented to the rendering pipeline for rendering - were "set as the current image". 
mozPaintedFrames - number of frames which were presented to the rendering pipeline and ended up being painted on the screen. Note that if the video is not on screen (e.g. in another tab or scrolled off screen), this counter will not increase. 
mozFrameDelay - the time delay between presenting the last frame and it being painted on screen (approximately). 

मोज़िला यहां सूचीबद्ध कुछ आंकड़ों पर भी काम कर रहा है।

webkitAudioBytesDecoded - number of audio bytes that have been decoded. 
webkitVideoBytesDecoded - number of video bytes that have been decoded. 
webkitDecodedFrames - number of frames that have been demuxed and extracted out of the media. 
webkitDroppedFrames - number of frames that were decoded but not displayed due to performance issues. 

मैं अभी भी IE9 पर संकल्प की जांच कर ...

संदर्भ: http: //wiki.whatwg.org/wiki/Video_Metrics

1

वहाँ

वेबकिट इन लागू कर दिया है फ्रेम के साथ काम करने के लिए एक सभ्य वीडियो फ्रेम जेएस लिब है https://github.com/X3TechnologyGroup/VideoFrame

यह बहुत पुराना सवाल है, लेकिन यह उपयोगी हो सकता है नए पाठक

रेफरी: Get frame numbers in HTML5 Video

संबंधित मुद्दे