
Recherche avancée
Autres articles (48)
-
Les autorisations surchargées par les plugins
27 avril 2010, parMediaspip core
autoriser_auteur_modifier() afin que les visiteurs soient capables de modifier leurs informations sur la page d’auteurs -
Support audio et vidéo HTML5
10 avril 2011MediaSPIP utilise les balises HTML5 video et audio pour la lecture de documents multimedia en profitant des dernières innovations du W3C supportées par les navigateurs modernes.
Pour les navigateurs plus anciens, le lecteur flash Flowplayer est utilisé.
Le lecteur HTML5 utilisé a été spécifiquement créé pour MediaSPIP : il est complètement modifiable graphiquement pour correspondre à un thème choisi.
Ces technologies permettent de distribuer vidéo et son à la fois sur des ordinateurs conventionnels (...) -
HTML5 audio and video support
13 avril 2011, parMediaSPIP uses HTML5 video and audio tags to play multimedia files, taking advantage of the latest W3C innovations supported by modern browsers.
The MediaSPIP player used has been created specifically for MediaSPIP and can be easily adapted to fit in with a specific theme.
For older browsers the Flowplayer flash fallback is used.
MediaSPIP allows for media playback on major mobile platforms with the above (...)
Sur d’autres sites (6415)
-
How to force specific AVInputFormat in code (FFMPEG) ?
18 février 2020, par kugipark++Plaease understand that maybe some words or sentences could not be correct English.++
I’m novice programmer and developing a video player app for Android which can play 5ch .avi video from http. It based on ffplay.c in FFMPEG libarary.
Currently I have 2 problems for this below. It has occured only in android devices.
1) Too much time taken for detecting format.
- opening and finding stream info takes more than a minute when I trying to open 5ch video source whereas normal .mp4 (h264) source open almost immediately.
2) Demuxing is too slow when it comes to large size video.
- If the resolution of video getting larger, then displaying frame rate getting slower even though there are enough memory, network and CPU resources physically.
To resolve my problem, I tried to force the format and decoders but I couldn’t found some information for specifying the input source in code level.
The official doc site only refers to a sentence about those parameters like "If non-NULL, this parameter forces a specific input format. Otherwise the format is autodetected.". So I don’t have any clues how to set the number of streams, decoders, decoders’ private options, and etc. (And also which parameters should I manage.) If someone knows how to set the options(like AVDictionary), and pass to the av functions, please let me know an exmple. The source contains 2 video streams, 1 audio stream, and 2 more extra streams (for custom data like gps). The stream information of video is below. I printed it manually, and these are auto-detected information.---------- File format information ----------
flags=2097152
video_codec_id=0 (NONE)
audio_codec_id=0 (NONE)
ctx_flags=0
data_codec_id=0 (NONE)
format_whitelist=(null)
iformat=0xa19d0d2c
---------- Stream information ----------
stream 1 of 5:
----- common ----------
bit_rate: 11383235
bits_per_coded_sample: 24
bits_per_raw_sample: 0
codec_id: 0x1C (H264)
codec_tag: 875967048
extradata_size: 0
level: -99
profile: -99
sample_rate: 0
----- Video Stream ----------
chroma_location: 0
color_primaries: 2
color_space: 2
color_trc: 2
field_order: 0
format: -1 (NONE)
height: 1080
width: 1920
sample_aspect_ratio.den: 1
sample_aspect_ratio.num: 0
video_delay: 0
----------------------------------------
stream 2 of 5:
----- common ----------
bit_rate: 6185438
bits_per_coded_sample: 24
bits_per_raw_sample: 0
codec_id: 0x1C (H264)
codec_tag: 875967048
extradata_size: 0
level: -99
profile: -99
sample_rate: 0
----- Video Stream ----------
chroma_location: 0
color_primaries: 2
color_space: 2
color_trc: 2
field_order: 0
format: -1 (NONE)
height: 720
width: 1280
sample_aspect_ratio.den: 1
sample_aspect_ratio.num: 0
video_delay: 0
----------------------------------------
stream 3 of 5:
----- common ----------
bit_rate: 352800
bits_per_coded_sample: 16
bits_per_raw_sample: 0
codec_id: 0x10000 (PCM_S16LE)
codec_tag: 1
extradata_size: 0
level: -99
profile: -99
sample_rate: 22050
----- Audio Stream ----------
block_align: 2
channels: 1
channel_layout: 0
color_range: 0
frame_size: 0
initial_padding: 0
seek_preroll: 0
trailing_padding: 0
----------------------------------------
stream 4 of 5:
----- common ----------
bit_rate: 15625
bits_per_coded_sample: 0
bits_per_raw_sample: 0
codec_id: 0x0 (NONE)
codec_tag: 0
extradata_size: 0
level: -99
profile: -99
sample_rate: 0
----- Subtitle Stream ----------
----------------------------------------
stream 5 of 5:
----- common ----------
bit_rate: 33862
bits_per_coded_sample: 0
bits_per_raw_sample: 0
codec_id: 0x0 (NONE)
codec_tag: 0
extradata_size: 0
level: -99
profile: -99
sample_rate: 0
----- Subtitle Stream ---------- -
How to play video file with audio with DearPyGUI (Python) ?
1er mars 2023, par Vi TietI'm using DearPyGUI to make a simple media player that can play video file (mp4, etc.) together with it's audio. The pre-requisite is that DearPyGUI is a must, however video feature will not exist until v2.0, which is still far in the future.


Currently, I can only render the frames using OpenCV library for Python, however, the problem is how can I play the audio as well as play it in sync with the output video frames ?


For context, I'm quite new to Python, and I don't know much about video and audio streaming, but I've thought of some approaches to this problem by looking through help posts online (However, I still have no idea how I can implement any of these seamlessly) :


- 

-
OpenCV for video frames, and audio ??? some libraries like ffmpeg-python or miniaudio to play sound... (How...?)


-
Extract video frames and audio here and then use the raw data to play it (How...?)


-
This example here is pretty close to what I want excluding the playing video and audio part, but I have no idea where to go from there. The video stream and the audio stream are instances of ffmpeg.nodes.FilterableStream, and they appear to hold addresses to somewhere. (No idea...)


-
Another very close idea is using ffpyplayer I was able to get the video frame. However, the below code yields a blueish purple color tint to the video, and the frame rate is very slow compared to original (So close...)












import time
import numpy as np
import cv2 as cv
from ffpyplayer.player import MediaPlayer


# https://github.com/Kazuhito00/Image-Processing-Node-Editor/blob/main/node_editor/util.py 
def cv2dpg(frame): 

 data = cv.resize(frame, (VIDEO_WIDTH, VIDEO_HEIGHT))
 data = np.flip(frame, 2)
 data = data.ravel()
 data = np.asfarray(data, dtype=np.float32)

 return np.true_divide(data, 255.0)


# https://stackoverflow.com/questions/59611075/how-would-i-go-about-playing-a-video-stream-with-ffpyplayer
# https://matham.github.io/ffpyplayer/examples.html#examples
def play_video(loaded_file_path):

 global player, is_playing
 player = MediaPlayer(loaded_file_path)

 while is_playing:

 frame, val = player.get_frame()

 if val == 'eof':
 is_playing = False
 break

 elif not frame:
 time.sleep(0.01)

 elif val != 'eof' and frame is not None:
 img, t = frame
 w = img.get_size()[0]
 h = img.get_size()[1]
 cv_mat = np.uint8(np.asarray(list(img.to_bytearray()[0])).reshape((h, w, 3)))
 texture_data = cv2dpg(cv_mat)
 dpg.set_value(VIDEO_CANVAS_TAG, texture_data)

 dpg.set_value(VIDEO_CANVAS_TAG, DEFAULT_VIDEO_TEXTURE)



I still need to do more research, but any pointer to somewhere good to start off (either handling raw data or using different libraries) would be greatly appreciated !


EDIT :
For more context, I'm using raw texture like this example of DearPyGUI official documentation to render the video frames that were extracted in the while loop.


-
-
Piwik Developer Guides : helping you make the most of the Piwik platform
At Piwik we are creating the leading open analytics platform that gives every user full control over their data. Today we are excited to announce the official launch of the Piwik Developer Guides at developer.piwik.org. The Developer Guides complement existing User Guides and more than 250 FAQs.
Piwik Developer Guides
The Developer guides will help you whenever you need to :
- Integrate Piwik analytics in your website or application — Integration guides explain (1) how to track users of your apps (with JavaScript Tracking or other Tracking API Clients) and (2) how to query Piwik’s reporting data to integrate it into your application (Accessing Piwik data).
- Develop a new Plugin for Piwik — Plugin development guides introduce the Piwik Platform and explain how to get started with creating a new plugin to extend and customise Piwik.
- Piwik API references — API References include the references for Tracking API, Analytics API, JavaScript Tracking API and the Database schema.
- See what’s changed in the platform — Changelog for Piwik platform developers lists all changes to our HTTP API’s, Plugins, Themes, etc.
Helping Developers innovate with Piwik
Piwik is an open platform – it is open because users control their data, users control the Piwik software (it is Free/libre software) and also because users can extend the platform via the powerful plugins architecture. Piwik users can already choose from 49 plugins available on the Marketplace ! (as of 2015 April 16th)
Now that developer guides are officially released, we are hopeful that even more talented developers will be able to create Plugins and distribute them on the Marketplace.
Share your feedback
We are committed to providing excellent Developer Guides and to achieve this, we need to hear your feedback and suggestions. To send us a message, click on the “Give Feedback” link in the footer of pages (we are listening !).
What’s coming next ?
- Platform Developer Changelog will continue to list all changes to the Piwik Platform and APIs.
- We will regularly update the guides when there are changes in the platform.
- We will improve existing guides based on users’ feedback and suggestions (tasks are tracked in this issue tracker on Github.)
We hope you find the guides useful, and thank you for being part of the Piwik community !