
Recherche avancée
Autres articles (47)
-
Des sites réalisés avec MediaSPIP
2 mai 2011, parCette page présente quelques-uns des sites fonctionnant sous MediaSPIP.
Vous pouvez bien entendu ajouter le votre grâce au formulaire en bas de page. -
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 (5029)
-
What is the ideal image format extraction for YUV color space and lossless compression from mxf video format using ffmpeg
15 février 2016, par DragonDance27I would like to be able to work on frames from an .mxf video file. The image format of the video is JPEG 2000, using a YUV color space with 4:2:2 subsampling and lossless compression.
My intentions are to extract frames from this video using ffmpeg. Extracted frames would then be processed in Matlab (at the moment I’m interested in performing colorization).
I want to extract the frames with as minimal data loss as possible and I would like to work in the YUV color space. I understand PNG involves a lossless process, but only involves the RGB color space - so not an option.
I think I can extract jpeg2000 frames in the YUV color space, but I’m not sure if I’m losing data from the compression process. I attempted the following code in ffmpeg :
ffmpeg -i video.mxf -r 1/5 out%03d.jp2
... however, the extracted jp2 files are unreadable in various software, including HiView which is a specialised JPEG 2000 software.
Quesiton 1 : Is this jpeg 2000 extraction method lossless ? What am I doing wrong ?
I also considered extracting the images in the tiff format where I can achieve the YUV and lossless requirements. I attempted the following code in ffmpeg :
ffmpeg -i video.mxf -vcodec tiff f%10d.tif
... however, the extracted tiff files are unreadable in software such as paint, paint.net and windows photo viewer.
Question 2 : Is this tiff extraction method correct ? What am I doing wrong ?
Question 3 : What is an ideal image format that covers my YUV and lossless requirements ?
-
iOS Radio App : Need to extract and stream audio-only from HLS streams with video content
20 décembre 2024, par Bader AlghamdiI'm developing an iOS radio app that plays various HLS streams. The challenge is that some stations broadcast HLS streams containing both audio and video (example : https://svs.itworkscdn.net/smcwatarlive/smcwatar/chunks.m3u8), but I want to :


Extract and play only the audio track
Support AirPlay for audio-only streaming
Minimize data usage by not downloading video content
Technical Details :


iOS 17+
Swift 6
Using AVFoundation for playback
Current implementation uses AVPlayer with AVPlayerItem
Current Code Structure :


class StreamPlayer: ObservableObject { @Published var isPlaying = false private var player: AVPlayer? private var playerItem: AVPlayerItem?

func playStream(url: URL) {
 let asset = AVURLAsset(url: url)
 playerItem = AVPlayerItem(asset: asset)
 player = AVPlayer(playerItem: playerItem)
 player?.play()
}




Stream Analysis : When analyzing the video stream using FFmpeg :


CopyInput #0, hls, from 'https://svs.itworkscdn.net/smcwatarlive/smcwatar/chunks.m3u8':
 Stream #0:0: Video: h264, yuv420p(tv, bt709), 1920x1080 [SAR 1:1 DAR 16:9], 25 fps
 Stream #0:1: Audio: aac, 44100 Hz, stereo, fltp




Attempted Solutions :


Using MobileFFmpeg :


let command = [
 "-i", streamUrl,
 "-vn",
 "-acodec", "aac",
 "-ac", "2",
 "-ar", "44100",
 "-b:a", "128k",
 "-f", "mpegts",
 "udp://127.0.0.1:12345"
].joined(separator: " ")

ffmpegProcess = MobileFFmpeg.execute(command)

I



ssue : While FFmpeg successfully extracts audio, playback through AVPlayer doesn't work reliably.


Tried using HLS output :


let command = [
 "-i", streamUrl,
 "-vn",
 "-acodec", "aac",
 "-ac", "2",
 "-ar", "44100",
 "-b:a", "128k",
 "-f", "hls",
 "-hls_time", "2",
 "-hls_list_size", "3",
 outputUrl.path
]




Issue : Creates temporary files but faces synchronization issues with live streams.



Testing URLs :


Audio+Video : https://svs.itworkscdn.net/smcwatarlive/smcwatar/chunks.m3u8
Audio Only : https://mbcfm-radio.mbc.net/mbcfm-radio.m3u8



Requirements :


- 

- Real-time audio extraction from HLS stream
- Maintain live streaming capabilities
- Full AirPlay support
- Minimal data usage (avoid downloading video content)
- Handle network interruptions gracefully












Questions :


- 

- What's the most efficient way to extract only audio from an HLS stream in real-time ?
- Is there a way to tell AVPlayer to ignore video tracks completely ?
- Are there better alternatives to FFmpeg for this specific use case ?
- What's the recommended approach for handling AirPlay with modified streams ?










Any guidance or alternative approaches would be greatly appreciated. Thank you !


What I Tried :


- 

- Direct AVPlayer Implementation :




- 

- Used standard AVPlayer to play HLS stream
- Expected it to allow selecting audio-only tracks
- Result : Always downloads both video and audio, consuming unnecessary bandwidth









- 

- FFmpeg Audio Extraction :




let command = [
 "-i", "https://svs.itworkscdn.net/smcwatarlive/smcwatar/chunks.m3u8",
 "-vn", // Remove video
 "-acodec", "aac", // Audio codec
 "-ac", "2", // 2 channels
 "-ar", "44100", // Sample rate
 "-b:a", "128k", // Bitrate
 "-f", "mpegts", // Output format
 "udp://127.0.0.1:12345" // Local stream
]
ffmpegProcess = MobileFFmpeg.execute(command)




Expected : Clean audio stream that AVPlayer could play
Result : FFmpeg extracts audio but AVPlayer can't play the UDP stream



- 

- HLS Segmented Approach :




swiftCopylet command = [
 "-i", streamUrl,
 "-vn",
 "-acodec", "aac",
 "-f", "hls",
 "-hls_time", "2",
 "-hls_list_size", "3",
 outputUrl.path
]




Expected : Create local HLS playlist with audio-only segments
Result : Creates files but faces sync issues with live stream



Expected Behavior :


- 

- Stream plays audio only
- Minimal data usage (no video download)
- Working AirPlay support
- Real-time playback without delays










Actual Results :


- 

- Either downloads full video stream (wasteful)
- Or fails to play extracted audio
- AirPlay issues with modified streams
- Sync problems with live content










-
Playing RTP stream on Android 4.1.2 (Jelly Bean) [closed]
27 décembre 2024, par Homie_TomieI'll try to keep it quick. Using FFMPEG I started a stream on my PC. Here is the code :


import subprocess

def start_stream():
 command = [
 'ffmpeg',
 '-f', 'gdigrab', # Desktop capture (Windows)
 '-framerate', '15', # Low framerate for higher performance
 '-i', 'desktop', # Capture desktop
 '-c:v', 'libx264', # Video codec (H.264)
 '-preset', 'ultrafast', # Ultra-fast encoding preset for minimal latency
 '-tune', 'zerolatency', # Zero latency for real-time streaming
 '-x264opts', 'keyint=15:min-keyint=15:no-scenecut', # Frequent keyframes
 '-b:v', '500k', # Low bitrate to minimize data usage and reduce latency
 '-s', '800x480', # Resolution fits phone screen and helps performance
 '-max_delay', '0', # No buffering, instant frame output
 '-flush_packets', '1', # Flush packets immediately after encoding
 '-f', 'rtp', # Use mpegts as the container for RTP stream
 'rtp://192.168.72.26:1234', # Stream over UDP to localhost on port 1234
 '-sdp_file', 'stream.sdp' # Create SDP file
 ]
 
 try:
 print("Starting stream...")
 subprocess.run(command, check=True)
 except subprocess.CalledProcessError as e:
 print(f"Error occurred: {e}")
 except KeyboardInterrupt:
 print("\nStream interrupted")

if __name__ == "__main__":
 print("Starting screen capture...")
 start_stream()



Now, when I start the stream I can connect to it in VLC when I open up the stream.sdp file. Using the same method I can open up the stream on my iPhone, but when I try to open it on my old Android phone the stream connects but the screen is black. However, when I turn the screen I can see the first frame that was sent to the phone. Why does the stream not work ?


I will be thankful for any and all advice :)