Recherche avancée

Médias (16)

Mot : - Tags -/mp3

Autres articles (81)

  • Le profil des utilisateurs

    12 avril 2011, par

    Chaque utilisateur dispose d’une page de profil lui permettant de modifier ses informations personnelle. Dans le menu de haut de page par défaut, un élément de menu est automatiquement créé à l’initialisation de MediaSPIP, visible uniquement si le visiteur est identifié sur le site.
    L’utilisateur a accès à la modification de profil depuis sa page auteur, un lien dans la navigation "Modifier votre profil" est (...)

  • Configurer la prise en compte des langues

    15 novembre 2010, par

    Accéder à la configuration et ajouter des langues prises en compte
    Afin de configurer la prise en compte de nouvelles langues, il est nécessaire de se rendre dans la partie "Administrer" du site.
    De là, dans le menu de navigation, vous pouvez accéder à une partie "Gestion des langues" permettant d’activer la prise en compte de nouvelles langues.
    Chaque nouvelle langue ajoutée reste désactivable tant qu’aucun objet n’est créé dans cette langue. Dans ce cas, elle devient grisée dans la configuration et (...)

  • XMP PHP

    13 mai 2011, par

    Dixit Wikipedia, XMP signifie :
    Extensible Metadata Platform ou XMP est un format de métadonnées basé sur XML utilisé dans les applications PDF, de photographie et de graphisme. Il a été lancé par Adobe Systems en avril 2001 en étant intégré à la version 5.0 d’Adobe Acrobat.
    Étant basé sur XML, il gère un ensemble de tags dynamiques pour l’utilisation dans le cadre du Web sémantique.
    XMP permet d’enregistrer sous forme d’un document XML des informations relatives à un fichier : titre, auteur, historique (...)

Sur d’autres sites (9007)

  • iOS Radio App : Need to extract and stream audio-only from HLS streams with video content

    20 décembre 2024, par Bader Alghamdi

    I'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 :

    


      

    1. Direct AVPlayer Implementation :
    2. 


    


      

    • 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
    • 


    



    

      

    1. FFmpeg Audio Extraction :
    2. 


    


    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

    



    

      

    1. HLS Segmented Approach :
    2. 


    


    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
    • 


    


  • 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 DragonDance27

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

  • How to raw TS packets off a file/url — Without decoding

    15 août 2019, par Znura

    New to ffmpeg and playing around that to understand better. I’m trying to use ffmpeg code base to get TS packets from a HLS Streaming server. I don’t need any decoding as I just have to store the TS packets to be processed later.

    First I built a minimal FFMPEG as outlined in https://zeranoe.com/forum/viewtopic.php?f=5&t=7426. No decoders and only hls and mpegts demuxers. Then using the following code to receive the frames. While inspecting it doesn’t seem to be MPEG-TS packets while looking into buffers thru GDB. Attaching the code here..

    Two Questions :

    1. Shouldn’t the av_recv_frame get me the TS packets ? However When I trace all the way to playlists (off HLSContext), the read_buffer there contains TS packets. IS there any example I could look into to get TS packets in this scenario without decoders ?

    2. If I get answer for (1), How to get the best stream off the HLS server ? when looking into ffplay, av_find_best_stream() sounds like the one to look into.. But again without needing to decode, is there a way to get best one according to the network condition ?

    Thanks..

    I dumped whatever I got off av_recv_frame() and stored in file. This file is not playable with VLC but Windows Movies & TV player could play the sound with missing frames..

    int main(int argc, char *argv[]) {
       AVFormatContext * ifmt_ctx = NULL;
       char *in_filename = NULL;
       int ret = 0;
       AVPacket pkt;
       if (argc != 2) { return 1; }
       in_filename = argv[1];
       av_register_all();

       if (!(ifmt_ctx = avformat_alloc_context())) { goto end; }
       if ((ret = avformat_open_input(&ifmt_ctx, in_filename, 0, 0)) < 0) {
           fprintf(stderr, "Could not open input file '%s'", in_filename);
           goto end;
       }
       if ((ret = avformat_find_stream_info(ifmt_ctx, 0)) < 0) {
           fprintf(stderr, "Failed to retrieve input stream information");
           goto end;
       }

       av_dump_format(ifmt_ctx, 0, in_filename, 0);
       while (1) {
           ret = av_read_frame(ifmt_ctx, &pkt);
           if (ret < 0) break;
           av_free_packet(&pkt);
       }
       end: avformat_close_input(&ifmt_ctx); return 0;
    }