
Recherche avancée
Médias (91)
-
DJ Z-trip - Victory Lap : The Obama Mix Pt. 2
15 septembre 2011
Mis à jour : Avril 2013
Langue : English
Type : Audio
-
Matmos - Action at a Distance
15 septembre 2011, par
Mis à jour : Septembre 2011
Langue : English
Type : Audio
-
DJ Dolores - Oslodum 2004 (includes (cc) sample of “Oslodum” by Gilberto Gil)
15 septembre 2011, par
Mis à jour : Septembre 2011
Langue : English
Type : Audio
-
Danger Mouse & Jemini - What U Sittin’ On ? (starring Cee Lo and Tha Alkaholiks)
15 septembre 2011, par
Mis à jour : Septembre 2011
Langue : English
Type : Audio
-
Cornelius - Wataridori 2
15 septembre 2011, par
Mis à jour : Septembre 2011
Langue : English
Type : Audio
-
The Rapture - Sister Saviour (Blackstrobe Remix)
15 septembre 2011, par
Mis à jour : Septembre 2011
Langue : English
Type : Audio
Autres articles (71)
-
Des sites réalisés avec MediaSPIP
2 mai 2011, parCette page présente quelques-uns des sites fonctionnant sous MediaSPIP.
Vous pouvez bien entendu ajouter le votre grâce au formulaire en bas de page. -
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. -
Contribute to a better visual interface
13 avril 2011MediaSPIP is based on a system of themes and templates. Templates define the placement of information on the page, and can be adapted to a wide range of uses. Themes define the overall graphic appearance of the site.
Anyone can submit a new graphic theme or template and make it available to the MediaSPIP community.
Sur d’autres sites (6889)
-
Read RTSP stream in Python
15 avril 2020, par pooormanI want to read RTSP stream with low latency. I use this code read frames in 100ms 200ms.
But this command will failed sometimes when restart program. There are four subprocess that read stream, 3 are success and 1 is failed. Is my command wrong ?



ffmpeg_cmd = ["ffmpeg", "-v", "debug", "-y",
 "-skip_initial_bytes", "2000000",
 "-c:v", "h264",
 "-vsync", "1",
 "-flags", "low_delay",
 "-fflags", "nobuffer",
 "-analyzeduration", "100000",
 "-max_delay", "100000",
 "-reorder_queue_size", "10000",
 "-rtsp_transport", "tcp",
 "-i", "rtsp://xx:xx@ip/streaming/channels/101",
 "-s", "1280x720",
 "-preset", "ultrafast",
 "-tune", "zerolatency",
 "-f", "image2pipe",
 "-pix_fmt", "rgb24",
 "-vcodec", "rawvideo",
 "-r", "25",
 "-"]
ffmpeg = sp.Popen(ffmpeg_cmd, stdout=sp.PIPE, bufsize=1024)
x = ffmpeg.stdout.read(int(w*h*3))




Error message :



Codec AVOption preset (Configuration preset) specified for output file #0 (pipe:) has not been used for any stream. The most likely reason is either wrong type (e.g. a video option with no video streams) or that it is a private option of some encoder which was not actually used for any stream.
Codec AVOption tune (Tune the encoding to a specific scenario) specified for output file #0 (pipe:) has not been used for any stream. The most likely reason is either wrong type (e.g. a video option with no video streams) or that it is a private option of some encoder which was not actually used for any stream.
detected 48 logical cores
Past duration 0.914436 too large
[h264 @ 0x55a59a5b8500] nal_unit_type: 7(SPS), nal_ref_idc: 3
[h264 @ 0x55a59a5b8500] nal_unit_type: 8(PPS), nal_ref_idc: 3
Clipping frame in rate conversion by 0.339165
[h264 @ 0x55a59a5b8500] nal_unit_type: 1(Coded slice of a non-IDR picture), nal_ref_idc: 3
[h264 @ 0x55a59a5b8500] Format yuvj420p chosen by get_format().
[h264 @ 0x55a59a5b8500] Reinit context to 1920x1088, pix_fmt: yuvj420p
[h264 @ 0x55a59a5b8500] Frame num gap 6 4
[h264 @ 0x55e256eef5c0] nal_unit_type: 7(SPS), nal_ref_idc: 3
[h264 @ 0x55e256eef5c0] nal_unit_type: 8(PPS), nal_ref_idc: 3
[h264 @ 0x55e256eef5c0] nal_unit_type: 5(IDR), nal_ref_idc: 3
[h264 @ 0x5649ea893700] nal_unit_type: 1(Coded slice of a non-IDR picture), nal_ref_idc: 3
 Last message repeated 3 times
[rtsp @ 0x5626b5bd85c0] max_analyze_duration 100000 reached at 120000 microseconds st:0
[rtsp @ 0x5626b5bd85c0] decoding for stream 0 failed



-
Convert webm to mp3 using python ?
28 avril 2020, par Andy_yeYes I know that this has been asked many many times, but the libraries on every single answer just ends up needing ffmepg.



The problem with that is that the file size increases dramatically when I include ffmpeg to my project, and I just don't want that.



I want to keep my project as lightweight as possible without needing to add 200 meabytes of data just for video to audio conversion which is just a very small part of the project.



So is there any way to



- 

-
- 

- not use ffmpeg


-
- 

- use another lightweight converter with a python wrapper


-
- 

- just use the parts in ffmpeg where the webm to mp3 conversion is actually taking place










-
-
Python and ffmpeg audio sync and screen recording issues
9 août 2020, par odddollarI'm using ffmpeg and python to record my desktop screen. When the program is run, it starts recording, then when I press a key-combo it cuts off the last x amount of seconds and saves it then starts recording again ; similar to the "record that" functionality of windows game bar.


I have it working so it records video just fine, but then I change the ffmpeg command to record audio from my desktop and I get an error saying
ValueError: could not convert string to float: 'N/A'
occurring when I try to calculate the length of the recorded video. It appears as though the recording isn't being stopped until after I try to calculate the video length, even though this exact same code works fine when not recording audio.

Additionally, I also have an issue when recording audio in that the audio is a couple hundred milliseconds in front of the video. It's not a lot but it's enough to be noticeable.


What I'm overall asking, is there a way I can modify the ffmpeg command to prevent the audio desync issues, and what might be causing the problems I'm getting when attempting to find the length of the video with audio ?


import keyboard, signal
from os import remove
from os.path import isfile
from subprocess import Popen, getoutput
from datetime import datetime
import configparser

class Main:
 def __init__(self, save_location, framerate, duration):
 self.save_location = save_location
 self.framerate = int(framerate)
 self.duration = int(duration)
 self.working = self.save_location + '\\' + 'working.avi'
 self.start_recording()

 def start_recording(self):
 if isfile(self.working):
 remove(self.working)

 # start recording to working file at set framerate
 self.process = Popen(f'ffmpeg -thread_queue_size 578 -f gdigrab -video_size 1920x1080 -i desktop -f dshow -i audio="Stereo Mix (Realtek High Definition Audio)" -b:v 7M -minrate 4M -framerate {self.framerate} {self.working}')
 #self.process = Popen(f'ffmpeg -f gdigrab -framerate {self.framerate} -video_size 1920x1080 -i desktop -b:v 7M -minrate 2M {self.working}')

 def trim_video(self):
 # stop recording working file
 self.process.send_signal(signal.CTRL_C_EVENT)

 # call 'cause I have to
 getoutput(f"ffprobe -i {self.working}")

 # get length of working video
 length = getoutput(f'ffprobe -i {self.working} -show_entries format=duration -v quiet -of csv="p=0"')

 # get time before desired recording time
 start = float(length) - self.duration

 # get save location and title
 title = self.save_location+'\\'+self.get_time()+'.avi'

 # cut to last amount of desired time
 Popen(f"ffmpeg -ss {start} -i {self.working} -c copy -t {self.duration} {title}")
 getoutput(f"ffprobe -i {self.working}")

 self.start_recording()

 def get_time(self):
 now = datetime.now()
 return now.strftime("%Y_%m_%d#%H-%M-%S")


if __name__ == "__main__":
 config = configparser.ConfigParser()
 config.read("settings.ini")
 config = config["DEFAULT"]

 run = Main(config["savelocation"].replace("\\", "\\\\"), config["framerate"], config["recordlast"])
 keyboard.add_hotkey("ctrl+shift+alt+g", lambda:run.trim_video())

 while True:
 try:
 keyboard.wait()
 except KeyboardInterrupt:
 pass



The contents of the settings.ini file are listed below


[DEFAULT]
savelocation = C:\
framerate = 30
recordlast = 10



In the code block, the first line with
self.process = Popen
is the one that records audio and has the issues, the second line (the commented out one below) is the one that works fine.