
Recherche avancée
Médias (2)
-
SPIP - plugins - embed code - Exemple
2 septembre 2013, par
Mis à jour : Septembre 2013
Langue : français
Type : Image
-
Publier une image simplement
13 avril 2011, par ,
Mis à jour : Février 2012
Langue : français
Type : Video
Autres articles (50)
-
MediaSPIP : Modification des droits de création d’objets et de publication définitive
11 novembre 2010, parPar défaut, MediaSPIP permet de créer 5 types d’objets.
Toujours par défaut les droits de création et de publication définitive de ces objets sont réservés aux administrateurs, mais ils sont bien entendu configurables par les webmestres.
Ces droits sont ainsi bloqués pour plusieurs raisons : parce que le fait d’autoriser à publier doit être la volonté du webmestre pas de l’ensemble de la plateforme et donc ne pas être un choix par défaut ; parce qu’avoir un compte peut servir à autre choses également, (...) -
Publier sur MédiaSpip
13 juin 2013Puis-je poster des contenus à partir d’une tablette Ipad ?
Oui, si votre Médiaspip installé est à la version 0.2 ou supérieure. Contacter au besoin l’administrateur de votre MédiaSpip pour le savoir -
Les statuts des instances de mutualisation
13 mars 2010, parPour des raisons de compatibilité générale du plugin de gestion de mutualisations avec les fonctions originales de SPIP, les statuts des instances sont les mêmes que pour tout autre objets (articles...), seuls leurs noms dans l’interface change quelque peu.
Les différents statuts possibles sont : prepa (demandé) qui correspond à une instance demandée par un utilisateur. Si le site a déjà été créé par le passé, il est passé en mode désactivé. publie (validé) qui correspond à une instance validée par un (...)
Sur d’autres sites (9910)
-
Read ID3 tags generated using Apple's id3taggenerator
9 octobre 2024, par Damiaan DufauxHi I am creating an HLS stream with ID3 tags using Apple's HTTP Live Streaming (HLS) Tools, FFmpeg and NodeJS. When I try to read out the stream using an
AVPlayer
andAVPlayerItemMetadataOutput
on macOS I'm not able to read out the ID3 tags. When I use the same code to read out a sample stream containing ID3 tags I do see them popping up. What am I doing wrong ?

Reproduction :


Streaming


I generate an infinite HLS stream from a 5 minute long mpeg ts file using this command :


ffmpeg -stream_loop -1 -re -i 5m.ts -c:v copy -c:a copy -f mpegts -strict -2 - | mediastreamsegmenter -b http://DamiaanTheoPro14.local:8081/ -f /tmp/hlsId3/video -D -m -M 50000 -log /tmp/hlsId3/log.txt



I serve that HLS stream using nodejs builtin
http-server


ID3 tag generation


Then I emit some ID3 tags using the following commands :


id3taggenerator -title foo -artist bar -a localhost:50000
id3taggenerator -text "foo bar" -d "sample text" -r -a localhost:50000



Reading


Now to read out the tags I use this little SwiftUI app :


import SwiftUI
import AVKit

let bipbopUrl = URL(string: "https://devstreaming-cdn.apple.com/videos/streaming/examples/bipbop_16x9/bipbop_16x9_variant.m3u8")!
let localUrl = URL(string: "http://damiaantheopro14.local:8081/prog_index.m3u8")!
let local = AVPlayerItem(url: localUrl)
let bipbop = AVPlayerItem(url: bipbopUrl)

struct ContentView: View {
 let player = AVPlayer()
 let observer = Id3Observer()
 var lastTag: AVMetadataGroup?
 
 var body: some View {
 VStack {
 HStack {
 Button("BipBop") {
 player.replaceCurrentItem(with: bipbop)
 bipbop.add(observer.metadataOutput)
 }
 Button("Local") {
 player.replaceCurrentItem(with: local)
 local.add(observer.metadataOutput)
 }
 Button("🅧") {
 player.replaceCurrentItem(with: nil)
 }
 }
 VideoPlayer(player: player)
 }
 .padding()
 }
}

class Id3Observer: NSObject, AVPlayerItemMetadataOutputPushDelegate {
 let metadataOutput = AVPlayerItemMetadataOutput()
 
 override init() {
 super.init()
 metadataOutput.setDelegate(self, queue: .global())
 }
 
 func metadataOutput(_ output: AVPlayerItemMetadataOutput, didOutputTimedMetadataGroups groups: [AVTimedMetadataGroup], from: AVPlayerItemTrack?) {
 print("metadataOutput", groups.count)
 print("\t", groups.map { group in
 group.items.map { item in
 "\(item.dataType) \(item.keySpace!) \(item.key!) \(item.time.seconds) \(item.duration.seconds.rounded())"
 }.joined(separator: "/n/t")
 }.joined(separator: "\n\t"))
 }
}



-
ffmpeg how to set max_num_reorder_frames H264
13 juin, par Vasil YordanovAnyone know how can I set max_num_reorder_frames to 0 when I am encoding H264 video ?
You can find in the docs as
uint8_t H264RawVUI::bitstream_restriction_flag


PS. Based on the discussion in the comments. What I actually want to accomplish is to have all the frames written in the order in which they were encoded. My use-case is - I have 1000 images for example. I encode each one of them using the codec, but then when I investigate a little bit and check the actual packets in the H264 container, I see that I have cases when one frame is written twice (for example ... 1,2,3,3,4,5,6,7,7 ...) what I want is once I decode the the H264 container I want to get the same images which I encoded. Is that possible and how ?


P.P.S : I don't think the
g=1
works - giving some more code for reference. This is what I currently have :

import numpy as np
import ffmpeg, subprocess, av

width, height, encoding_profile, pixel_format = 1280, 800, 'main', 'yuv420p'

# here I create 256 frames where each one has unique pixels all zeros, ones, twos and etc.
np_images = []
for i in range(256):
 np_image = i + np.zeros((height, width, 3), dtype=np.uint8)
 np_images.append(np_image)

print(f'number of numpy images: {len(np_images)}')

encoder = (ffmpeg
 .input('pipe:', format='rawvideo', pix_fmt='rgb24', s='{}x{}'.format(width, height))
 .output('pipe:', format='H264', pix_fmt=pixel_format, vcodec='libx264', profile='main', g=1)
 .run_async(pipe_stdin=True, pipe_stdout=True)
)

for timestamp, frame in enumerate(np_images):
 encoder.stdin.write(
 frame
 .astype(np.uint8)
 .tobytes()
 )

encoder.stdin.close()
output = encoder.stdout.read()
encoder.stdout.close()

# here I decode the encoded frames using PyAV
frame_decoder = av.CodecContext.create("h264", "r")
frame_decoder.thread_count = 0
frame_decoder.thread_type = 'NONE'
packets = frame_decoder.parse(output)
decoded_frames = []

for packet in packets:
 frame = frame_decoder.decode(packet)
 decoded_frames.extend(frame)

decoded_frames.extend(frame_decoder.decode())
print(f'number of decoded frames: {len(decoded_frames)}')
print('keyframe boolean mask')
print([e.key_frame for e in decoded_frames])

decoded_np_images = []

for frame in decoded_frames:
 decoded_np_images.append(np.array(frame.to_image()))

print(f'number of decoded numpy images: {len(decoded_np_images)}')

# here I check what the decoded frames contain (all zeros, ones, twos and etc.)
print([e[0,0,0].item() for e in decoded_np_images])



the particular problem which I am facing is that in the output you can observe this :




number of decoded numpy images : 255


[0, 1, 2, 3, 3, 4, 5, 6, 8, 9, 10,
10, 11, 12, 13, 15, 16, 17, 17, 18, 19, 20, 22, 23, 24, 24, 25, 26,
27, 29, 30, 31, 31, 32, 33, 34, 36, 37, 38, 39, 39, 40, 41, 43, 44,
45, 46, 46, 47, 48, 50, 51, 52, 53, 53, 54, 55, 57, 58, 59, 60, 60,
61, 62, 64, 65, 66, 67, 67, 68, 69, 71, 72, 73, 74, 74, 75, 76, 78,
79, 80, 81, 81, 82, 83, 85, 86, 87, 88, 88, 89, 90, 91, 93, 94, 95,
95, 96, 97, 98, 100, 101, 102, 102, 103, 104, 105, 107, 108, 109, 109,
110, 111, 112, 114, 115, 116, 116, 117, 118, 119, 121, 122, 123, 123,
124, 125, 126, 128, 129, 130, 131, 131, 132, 133, 135, 136, 137, 138,
138, 139, 140, 142, 143, 144, 145, 145, 146, 147, 149, 150, 151, 152,
152, 153, 154, 156, 157, 158, 159, 159, 160, 161, 163, 164, 165, 166,
166, 167, 168, 170, 171, 172, 173, 173, 174, 175, 176, 178, 179, 180,
180, 181, 182, 183, 185, 186, 187, 187, 188, 189, 190, 192, 193, 194,
194, 195, 196, 197, 199, 200, 201, 201, 202, 203, 204, 206, 207, 208,
208, 209, 210, 211, 213, 214, 215, 216, 216, 217, 218, 220, 221, 222,
223, 223, 224, 225, 227, 228, 229, 230, 230, 231, 232, 234, 235, 236,
237, 237, 238, 239, 241, 242, 243, 244, 244, 245, 246, 248, 249, 250,
251, 251, 252, 253]




I still have frames which are appearing twice (and respectively some are missing)


-
ffmpeg [10 random images] + [1 random .mp3] = [1 video]
13 octobre 2015, par BrooksGiven :
1 Folder with .jpg files
1 Folder with .mp3 files
1 .txt with a list of file namesWhat I want (and hope someone can help me) to achieve is make a cmd command to tell ffmpeg to :
get 10 random .jpg files
get 1 random .mp3 file
create .mp4 video with the same length as the .mp3
give to the .mp4 file a name from the list in the .txt
Loop above actions for each item in the .txt listI started to test with
"FullPathToFFmpeg.exe" -r 1 -loop 1 -i "FullPathTo.jpg" -i "FullPathTo.mp3" -acodec copy -r 1 -shortest "FullPathTo.mp4"
and it works but if I change the .jpg input to
"FullPathTo\*.jpg"
Can someone please help me with a command or point me in the right direction ?