
Recherche avancée
Autres articles (42)
-
Configurer la prise en compte des langues
15 novembre 2010, parAccé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 (...) -
Supporting all media types
13 avril 2011, parUnlike most software and media-sharing platforms, MediaSPIP aims to manage as many different media types as possible. The following are just a few examples from an ever-expanding list of supported formats : images : png, gif, jpg, bmp and more audio : MP3, Ogg, Wav and more video : AVI, MP4, OGV, mpg, mov, wmv and more text, code and other data : OpenOffice, Microsoft Office (Word, PowerPoint, Excel), web (html, CSS), LaTeX, Google Earth and (...)
-
Creating farms of unique websites
13 avril 2011, parMediaSPIP platforms can be installed as a farm, with a single "core" hosted on a dedicated server and used by multiple websites.
This allows (among other things) : implementation costs to be shared between several different projects / individuals rapid deployment of multiple unique sites creation of groups of like-minded sites, making it possible to browse media in a more controlled and selective environment than the major "open" (...)
Sur d’autres sites (4628)
-
Python and FFMPEG video streaming not displaying via HTML5
18 mars 2016, par arussellI’m trying to write a python script to serve a video over HTTP and display it via HTML5 video tag, I’m using FFMPEG to serve the video over HTTP and receiving the the video via sockets in Python. FFMPEG seems to be sending the video and my Python script is receiving it but for some reason I’m not able to display it in my web browser nor getting any visible error in my script.
Any help will be highly appreciated.
This is the FFMPEG line I’m using to send the video to HTTP
FFMPEG -re -i video_file.webm -c:v libx264 -c:a copy -f h264 http://127.0.0.1:8081
Here is my Python code
import socket #for sockets handling
import time #for time functions
import sys
hostIP = '127.0.0.1'
SourcePort = 8081 #FFMPEG
PlayerPort = 8082 #Internet Browser
def gen_headers():
# determine response code
h = ''
h = 'HTTP/1.1 200 OK\n'
# write further headers
current_date = time.strftime("%a, %d %b %Y %H:%M:%S", time.localtime())
h += 'Date: ' + current_date +'\n'
h += 'Content-Type: video/mp4\n\n'
return h
def start_server():
socketFFMPEG = socket.socket(socket.AF_INET, socket.SOCK_STREAM)
# this is for easy starting/killing the app
socketFFMPEG.setsockopt(socket.SOL_SOCKET, socket.SO_REUSEADDR, 1)
print('Socket created')
try:
socketFFMPEG.bind((hostIP, SourcePort))
print('Socket bind complete')
except socket.error as msg:
print('Bind failed. Error : ' + str(sys.exc_info()))
sys.exit()
#Start listening on socketFFMPEG
socketFFMPEG.listen(10)
print('Socket now listening. Waiting for video source from FFMPEG on port', SourcePort)
conn, addr = socketFFMPEG.accept()
ip, port = str(addr[0]), str(addr[1])
print('Accepting connection from ' + ip + ':' + port)
socketPlayer = socket.socket(socket.AF_INET, socket.SOCK_STREAM)
socketPlayer.bind((hostIP, PlayerPort))
socketPlayer.listen(1) #listen just 1 petition
print('Waiting for Internet Browser')
conn2, addr2 = socketPlayer.accept()
conn2.sendall(gen_headers().encode())
while True:
try :
#receive data from client FFMPEG
input_from_FFMPEG = conn.recv(1024)
#send data to internet browser
conn2.sendall(input_from_FFMPEG)
except socket.error:
print('Error data :' + str(input_from_FFMPEG))
print('send Error : ' + str(sys.exc_info()))
conn2.close()
sys.exit()
socketFFMPEG.close()
start_server()I’m getting the error 10053 "An established connection was aborted by the software in your host machine" when loading the following "byte" type data
\x00\x00\x00\x01A\x9b\x1dI\xe1\x0f&S\x02\xbf\xb1\x82j3{qz\x85\xca\\\xb2\xb7\xc5\xdfi\x92y\x0c{\xb0\xde\xd1\x96j\xccE\xa3G\x87\x84Z\x0191\xba\x8a3\x8e\xe2lfX\x82\xd4*N\x8a\x9f\xa9\xc9\xfb\x13\xfc_]D\x0f\x9e\x1c"\x0fN\xceu\t\x17n\xbe\x95\xd1\x10Wj\xf5t\x90\xa8\x1am\xf7!d\x82py\n\x10\xf5\x9b{\xd9\xf8\x8e^\xc7\xb3o+\x0eQX\xb3\x17B?\xb8\x1c\xecP\xa0\xf10\xc7\xc8\x8d\xf1P\xd3\xdf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9\xc4\x11g\xd9C\xf7K.\x8c\xab3~n%\x7f\xc0p\xc8\xb1\xd6\x8d\xe5E\xb1\xc1\xe3(~\x9e\x9c\x91.\xdc\x08\xfb\xa0\xbe\x98y$U\xdeH\x08\xb2z,yX\xfaqx\xfe\xb0\xa9\xb4Q\xf2P\x95d\xc8\x88\r\xc3\x1dr\x88\xba\xc8\x990`(\x08m\x19\xebi\xf8\x11\xc6g\xd6\xc4\x12C\xad~\xe1$2\x01Hmg\xdb\x920\x18\xcc\xc0K\x04~\x1e\xeb\xd9>\x81F*I\x99\xe4\x00\xa3\xc4,U\x89\xdf\x843\xa3\xfb\xea\xc9d\x05\xeb]
-
How to limit FFMpeg CPU usage ? Threads ? [closed]
6 mai 2013, par forg4tI read lot of forum comment how to limit ffmpeg cpu... many people wrote to use this formula : nice -n 10 or 20 it's ok. But I don't know what number should be use in ffmpeg threads ? 0 or 1, 2, 3 I don't know. I would really appreciate your help !
I checked the system data :
server : # lscpu
Architecture : x86_64
CPU op-mode(s) : 32-bit, 64-bit
Byte Order : Little Endian
CPU(s) : 2
On-line CPU(s) list : 0,1
Thread(s) per core : 1
Core(s) per socket : 2
Socket(s) : 1
NUMA node(s) : 1
Vendor ID : GenuineIntel
CPU family : 6
Model : 37
Stepping : 1
CPU MHz : 3066.775
BogoMIPS : 6133.55
Hypervisor vendor : VMware
Virtualization type : full
L1d cache : 32K
L1i cache : 32K
L2 cache : 256K
L3 cache : 12288K
NUMA node0 CPU(s) : 0,1server : # less /proc/cpuinfo
processor : 0
vendor_id : GenuineIntel
cpu family : 6
model : 37
model name : Intel(R) Xeon(R) CPU X5675 @ 3.07GHz
stepping : 1
microcode : 0x15
cpu MHz : 3066.775
cache size : 12288 KB
physical id : 0
siblings : 2
core id : 0
cpu cores : 2
apicid : 0
initial apicid : 0
fpu : yes
fpu_exception : yes
cpuid level : 11
wp : yes -
iOS - converting to fmp4 (from mp4/m4a) and streaming it
13 février 2019, par ironRoeiSo I didn’t managed to find any code about this issue.
I have recorded an mp4 file(audioFile.mp4) and now i want to stream it through socket , yet i have problem in converting.
I know that there is the ffmpeg(https://www.ffmpeg.org/) platform yet i didn’t see any code of that.
Would appreciate any idea.class ViewController: UIViewController {
var requestManager = RequestManager()
var socket: WebSocket?
var audioRecorder: AVAudioRecorder!
@IBOutlet weak var recordBtn: UIButton!
@IBOutlet weak var playBtn: UIButton!
var fileName: String = "audioFile.mp4"
var soundRecorder: AVAudioRecorder?
var soundPlayer: AVAudioPlayer?
var audioSession = AVAudioSession.sharedInstance()
override func viewDidLoad() {
super.viewDidLoad()
self.socket?.delegate = self
setUpRecorder()
playBtn.isEnabled = false
}
override func viewDidAppear(_ animated: Bool) {
super.viewDidAppear(animated)
self.audioSession = AVAudioSession.sharedInstance()
do {
try audioSession.setCategory(AVAudioSession.Category.playAndRecord, mode: .measurement, options: .defaultToSpeaker)
try audioSession.setActive(true, options: .notifyOthersOnDeactivation)
} catch {
print(error)
}
}
func getDocDirector() -> URL {
let path = FileManager.default.urls(for: .documentDirectory, in: .userDomainMask)
return path[0]
}
func setUpRecorder() {
let audioFileName = getDocDirector().appendingPathComponent(fileName)
let recordSettings: [String: Any] = [AVFormatIDKey: Int(kAudioFormatMPEG4AAC),
AVEncoderAudioQualityKey: AVAudioQuality.max.rawValue,
AVNumberOfChannelsKey: 1,
AVEncoderBitRateKey: 16000,
AVSampleRateKey: 16000]
do {
soundRecorder = try AVAudioRecorder(url: audioFileName, settings: recordSettings)
soundRecorder?.delegate = self
soundRecorder?.prepareToRecord()
} catch {
print(error)
}
}
func setUpPlayer() {
let audioFileName = getDocDirector().appendingPathComponent(fileName)
do {
soundPlayer = try AVAudioPlayer(contentsOf: audioFileName)
soundPlayer?.delegate = self
soundPlayer?.prepareToPlay()
soundPlayer?.volume = 1.0
} catch {
print(error)
}
}
@IBAction func recordAction(_ sender: Any) {
if recordBtn.titleLabel?.text == "Record" {
soundRecorder?.record()
recordBtn.setTitle("Stop", for: .normal)
playBtn.isEnabled = false
} else {
soundRecorder?.stop()
recordBtn.setTitle("Record", for: .normal)
playBtn.isEnabled = false
}
}
@IBAction func playAction(_ sender: Any) {
if playBtn.titleLabel?.text == "Play" {
playBtn.setTitle("Stop", for: .normal)
recordBtn.isEnabled = false
setUpPlayer()
soundPlayer?.play()
} else {
playBtn.setTitle("Play", for: .normal)
recordBtn.isEnabled = false
}
}
func openSocket() {
getUrl(success: { [weak self] (url) in
self?.socket = WebSocket(url: URL(string: url)!)
self?.socket?.connect()
}) { (e) in
//
}
}
}