
Recherche avancée
Autres articles (105)
-
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 -
Use, discuss, criticize
13 avril 2011, parTalk to people directly involved in MediaSPIP’s development, or to people around you who could use MediaSPIP to share, enhance or develop their creative projects.
The bigger the community, the more MediaSPIP’s potential will be explored and the faster the software will evolve.
A discussion list is available for all exchanges between users. -
Encoding and processing into web-friendly formats
13 avril 2011, parMediaSPIP automatically converts uploaded files to internet-compatible formats.
Video files are encoded in MP4, Ogv and WebM (supported by HTML5) and MP4 (supported by Flash).
Audio files are encoded in MP3 and Ogg (supported by HTML5) and MP3 (supported by Flash).
Where possible, text is analyzed in order to retrieve the data needed for search engine detection, and then exported as a series of image files.
All uploaded files are stored online in their original format, so you can (...)
Sur d’autres sites (8595)
-
how to add header info to a wav file to get a same result as ffmpeg ?
30 avril 2023, par Q.TongI'm trying to generate a .wav file with Fastspeech. When I save the data as .pcm file, and transfer it to .wav by ffmpeg, it works well.But when I just add a wav header info and save it into .wav, it sounds very noisy, What's wrong with my code ?


code for pcm :


wav = wav.astype(np.float32)
 wav = wav.tostring()
 with open('test.pcm', 'wb') as f:
 f.write(wav)



ffmpeg command :


ffmpeg -f f32le -ar 16000 -i test.pcm file.wav # works well



write wav straightly :


import struct

def pcm2wav(sample_rate, pcm_voice):
 if pcm_voice.startswith("RIFF".encode()):
 return pcm_voice
 else:
 sampleNum = len(pcm_voice)
 rHeaderInfo = "RIFF".encode()
 rHeaderInfo += struct.pack('i', sampleNum + 44)
 rHeaderInfo += 'WAVEfmt '.encode()
 rHeaderInfo += struct.pack('i', 16)
 rHeaderInfo += struct.pack('h', 1)
 rHeaderInfo += struct.pack('h', 1)
 rHeaderInfo += struct.pack('i', sample_rate)
 rHeaderInfo += struct.pack('i', sample_rate * int(32 / 8))
 rHeaderInfo += struct.pack("h", int(32 / 8))
 rHeaderInfo += struct.pack("h", 32)
 rHeaderInfo += "data".encode()
 rHeaderInfo += struct.pack('i', sampleNum)
 rHeaderInfo += pcm_voice
 return rHeaderInfo

# .......
# get data with FastSpeech model
wav = wav.astype(np.float32)
wav = wav.tostring()
wav = pcm2wav(16000, wav)
with open('test.wav', 'wb') as f:
 f.write(wav) # many noisy sounds



-
Convert a native Insta360 video to another format
5 mai 2021, par ChelouteI'd like to figure out how to convert a Insta360 native video (360º) to a specific one (360º).


mediainfo gives these metadata for the original file :




General
Complete name : VID_20210503_142435_00_003(2).insv
Format : MPEG-4
Format profile : Base Media
Codec ID : isom (isom/iso2/avc1/mp41)
File size : 329 MiB
Duration : 52 s 319 ms
Overall bit rate mode : Variable
Overall bit rate : 52.7 Mb/s
Writing application : Lavf58.13.101
IsTruncated : Yes
FileExtension_Invalid : braw mov mp4 m4v m4a m4b m4p m4r 3ga 3gpa 3gpp 3gp 3gpp2 3g2 k3g jpm jpx mqv ismv isma ismt f4a f4b f4v

Video
ID : 1
Format : AVC
Format/Info : Advanced Video Codec
Format profile : Main@L5.1
Format settings : CABAC / 1 Ref Frames
Format settings, CABAC : Yes
Format settings, Reference frames : 1 frame
Format settings, GOP : M=1, N=32
Codec ID : avc1
Codec ID/Info : Advanced Video Coding
Duration : 52 s 319 ms
Bit rate mode : Variable
Bit rate : 50.0 Mb/s
Width : 3 840 pixels
Height : 1 920 pixels
Display aspect ratio : 2.000
Frame rate mode : Constant
Frame rate : 29.970 (30000/1001) FPS
Color space : YUV
Chroma subsampling : 4:2:0
Bit depth : 8 bits
Scan type : Progressive
Bits/(Pixel*Frame) : 0.226
Stream size : 312 MiB (95%)
Color range : Full
Color primaries : BT.601 NTSC
Transfer characteristics : BT.601
Matrix coefficients : BT.601
Codec configuration box : avcC





My goal is to convert this video to that specifications :




General
Complete name : VID_20210503_142435_00_003(2).mp4
Format : MPEG-4
Format profile : Base Media
Codec ID : isom (isom/iso2/avc1/mp41)
File size : 83.5 MiB
Duration : 52 s 429 ms
Overall bit rate : 13.4 Mb/s
Writing application : Lavf58.13.101
Comment : 2021-05-03 12:24:35 +0000
Make : Insta360
Model : ONEX.Panorama


Video
ID : 1
Format : AVC
Format/Info : Advanced Video Codec
Format profile : High@L5
Format settings : CABAC / 1 Ref Frames
Format settings, CABAC : Yes
Format settings, Reference frames : 1 frame
Format settings, GOP : M=1, N=4
Codec ID : avc1
Codec ID/Info : Advanced Video Coding
Duration : 52 s 429 ms
Source duration : 52 s 429 ms
Bit rate : 13.2 Mb/s
Width : 3 840 pixels
Height : 1 920 pixels
Display aspect ratio : 2.000
Frame rate mode : Constant
Frame rate : 7.000 FPS
Color space : YUV
Chroma subsampling : 4:2:0
Bit depth : 8 bits
Scan type : Progressive
Bits/(Pixel*Frame) : 0.256
Stream size : 82.7 MiB (99%)
Source stream size : 82.7 MiB (99%)
Codec configuration box : avcC





Would it be possible to do this with FFMPEG ? How ?


Thanks


-
Best approach to set up live video streaming between HoloLens2 and Desktop PC
19 mai 2021, par SilverLifeFirst of all, I am sorry for this question. I know its more asking for an advice than asking about any coding problems. Unfortunately I don´t know where else I should ask such a question, so please be patient. (I am open for any recommendations)


Since a while I am searching for a promising approach to stream live videos from a desktop PC via network to my HoloLens 2 unity application. The video transfer should be within a encapsulated network without internet access. Therefore a direct connection between both devices without any signaling- or web-servers would be desirable, if possible. For now we are thinking about sending the stream via ffmpeg and receiving it somehow in the unity application.
So far I came across MixedReality-WebRTC and ffmpegInterop. Unfortunately as I read, WebRTC needs at least some kind of signaling server which manages the connection between the clients. ffmpegInterop seems to be really difficult to integrate into unity.


I am completely new to the topic of low latency video streaming and a bit lost in this complex environment. Can anybody give me an advice about a promising and extendable way to receive a low latency video stream ?