
Recherche avancée
Autres articles (56)
-
Encodage et transformation en formats lisibles sur Internet
10 avril 2011MediaSPIP transforme et ré-encode les documents mis en ligne afin de les rendre lisibles sur Internet et automatiquement utilisables sans intervention du créateur de contenu.
Les vidéos sont automatiquement encodées dans les formats supportés par HTML5 : MP4, Ogv et WebM. La version "MP4" est également utilisée pour le lecteur flash de secours nécessaire aux anciens navigateurs.
Les documents audios sont également ré-encodés dans les deux formats utilisables par HTML5 :MP3 et Ogg. La version "MP3" (...) -
Les autorisations surchargées par les plugins
27 avril 2010, parMediaspip core
autoriser_auteur_modifier() afin que les visiteurs soient capables de modifier leurs informations sur la page d’auteurs -
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 (11699)
-
Merge commit ’bddd8cbf68551f6405b2bf77cc3e212af9fbe834’
19 mai 2014, par Michael NiedermayerMerge commit ’bddd8cbf68551f6405b2bf77cc3e212af9fbe834’
* commit ’bddd8cbf68551f6405b2bf77cc3e212af9fbe834’ :
Add transformation matrix API.Conflicts :
libavcodec/avcodec.h
libavcodec/utils.c
libavutil/version.hMerged-by : Michael Niedermayer <michaelni@gmx.at>
-
Python stream H.264 data over socket
9 janvier 2017, par Ezra KnoblochI am creating a H.264 encoded stream on my Raspberry using the tool ’raspivid’ and sending that stream to stdout.
What i want is sending that stream to another computer and feed it to ffmpeg which in turn feeds it to MPlayer.When i do this using netcat and pipes it does work really good, i have a clean stream without any graphic bugs.
I try to get the raspivid stdout over the subprocess module, see code below. Im more or less sure the problem lies somewhere there cause i did something similar a while back and it worked without many problems, and the only thing i did different now is using subprocess.
My question is : does someone see what causes my problems ?
Some Notes :
-
Using streamObj.get_data(pcktSize) did never work until now (MPlayer and ffmpeg cant open the stream)
-
process.stdout.readline() seems to be a bit faster than just read()
-
this code seems to be slower than just piping and netcat, how would i make it faster ? (while still using python)
i need to write this sentence cause the code formatting below would be corrupted if i would not.
import subprocess, socket, sys, time
from thread import start_new_thread
class streamObject:
def __init__(self):
global data
data = ""
def start_stream(self, rot, t, w, h, fps):
global data
process = subprocess.Popen(['/usr/bin/raspivid', '-rot', str(rot), '-t', str(t), '-w', str(w), '-h', str(h), '-fps', str(fps), '-o', '-'], stdout=subprocess.PIPE, stderr=subprocess.STDOUT)
nodata_counter = 0
while 1:
if process.poll() is None:
data += process.stdout.readline()
#data += process.stdout.read(256)
sys.stdout.write("buffered %i bytes. \r" % len(data))
sys.stdout.flush()
elif nodata_counter < 200:
nodata_counter += 1
time.sleep(0.1)
else:
break
def get_alldata(self):
global data
return data
def get_data(self, data_len):
global data
if len(data) > data_len:
temp = data[0:data_len]
data = data[data_len:len(data)]
return temp
else:
return None
def clear_cache(self):
global data
data = ""
def poll(self):
global data
try:
if len(data) != 0:
return None
else:
return 0
except:
return 0
def socket_connect(ip, port):
s = socket.socket(socket.AF_INET, socket.SOCK_STREAM)
s.connect((ip, port))
return s
def socket_listen(ip, port):
s = socket.socket(socket.AF_INET, socket.SOCK_STREAM)
s.bind((ip, port))
s.listen(1)
conn, addr = s.accept()
return conn
def socket_close(sock):
sock.close()
def send_stream(sock, streamObj, pcktSize):
timeout = 0
while 1:
if streamObj.poll() is None:
#data = streamObj.get_data(pcktSize)
data = streamObj.get_alldata()
streamObj.clear_cache()
if data is not None:
sock.send(data)
elif timeout < 200:
timeout += 1
time.sleep(0.1)
else:
break
stream = streamObject()
start_new_thread(stream.start_stream, (180, 0, 1280, 720, 20))
sock = socket_connect("xxxx.xxxx.xxxx.xxxx", 7777)
send_stream(sock, stream, 256)Here is a short video of the graphic bugs i encounter.
I am doing this over a direct ethernet connection at this time.
-
-
FFmpeg concat video and audio out of sync
16 septembre 2016, par XeoncrossJoining multiple files using ffmpeg concat seems to result in a mismatch of the timestamps or offsets for the audio. I’ve tried with several videos and noticed the same problem for h.264 / MP4.
Using
concat
and encoding the video seems to work fine. The audio stays in sync as ffmpeg does the full conversion calculations and seems to get everything right.However, simply concatenating the videos without any transformation or encoding results in a slowly increasing sync issue. Obviously, encoding the videos rather than simply joining them will result in a loss of information/quality so I would rather find a way around this problem.
I’ve tried several flags to sort out this problem that appears to be based on the timestamps. None of these seem to correct the problem though.
ffmpeg -f concat -fflags +genpts -async 1 -i segments.txt test.mov
ffmpeg -auto_convert 1 -f concat -fflags +genpts -async 1 -i segments.txt -c copy test2.mov
ffmpeg -f concat -i segments.txt -c copy -fflags +genpts test3.mp4
ffmpeg -f concat -fflags +genpts -async 1 -i segments.txt -copyts test4.mov
ffmpeg -f concat -i segments.txt -copyts test5.mov
ffmpeg -f concat -i segments.txt -copyts -c copy test6.mov
ffmpeg -f concat -fflags +genpts -i segments.txt -copyts -c copy test7.movNote : all other questions that I could find on SO seem to "fix" the problem by simply encoding the videos over again. Not a good solution.
Update
I realized the concat wasn’t the problem. The original set of clips had mis-matched timestamps. Somehow concat + encoding fixed the issue, but I don’t want to re-encode the videos and loose quality each time.
ffmpeg -y -ss 00:00:02.750 -i input.MOV -c copy -t 00:00:05.880 output.MOV
Which resulted in the following data
ffprobe -v quiet -show_entries stream=start_time,duration output.MOV
start_time=-0.247500
duration=6.131125
start_time=-0.257333
duration=6.155333Since then I’ve tried to use
-to
m and-t
in different places along with-af apad -c:v copy
and I’ve still failed to get the duration to be the same.Here is the full ffprobe output
Here is the original (red) vs the segment (green)
Detailed Sample Files
I recorded a sample video, added the commands to chop it up, then concat it. http://davidpennington.me/share/audio_sync_test_video.zip