
Recherche avancée
Médias (1)
-
Bug de détection d’ogg
22 mars 2013, par
Mis à jour : Avril 2013
Langue : français
Type : Video
Autres articles (102)
-
Emballe médias : à quoi cela sert ?
4 février 2011, parCe plugin vise à gérer des sites de mise en ligne de documents de tous types.
Il crée des "médias", à savoir : un "média" est un article au sens SPIP créé automatiquement lors du téléversement d’un document qu’il soit audio, vidéo, image ou textuel ; un seul document ne peut être lié à un article dit "média" ; -
Menus personnalisés
14 novembre 2010, parMediaSPIP utilise le plugin Menus pour gérer plusieurs menus configurables pour la navigation.
Cela permet de laisser aux administrateurs de canaux la possibilité de configurer finement ces menus.
Menus créés à l’initialisation du site
Par défaut trois menus sont créés automatiquement à l’initialisation du site : Le menu principal ; Identifiant : barrenav ; Ce menu s’insère en général en haut de la page après le bloc d’entête, son identifiant le rend compatible avec les squelettes basés sur Zpip ; (...) -
Gestion de la ferme
2 mars 2010, parLa ferme est gérée dans son ensemble par des "super admins".
Certains réglages peuvent être fais afin de réguler les besoins des différents canaux.
Dans un premier temps il utilise le plugin "Gestion de mutualisation"
Sur d’autres sites (5909)
-
Streaming Anki Vector's camera
25 novembre 2023, par Brendan GoodeI am trying to stream my robot to Remo.tv with my Vector robot. The website recognizes I am going live but does not stream what the robots camera is seeing. I have confirmed the camera works by a local application that runs the SDK. The very end of the code is what is giving issues, it appears somebody ripped code from Cozmo and attempted to paste it into a Vector file. The problem is it seems like the camera is taking pictures and we reach the point where it attempts to send photo but fails ?


# This is a dummy file to allow the automatic loading of modules without error on none.
import anki_vector
import atexit
import time
import _thread as thread
import logging
import networking

log = logging.getLogger('RemoTV.vector')
vector = None
reserve_control = None
robotKey = None
volume = 100 #this is stupid, but who cares
annotated = False

def connect():
 global vector
 global reserve_control

 log.debug("Connecting to Vector")
 vector = anki_vector.AsyncRobot()
 vector.connect()
 #reserve_control = anki_vector.behavior.ReserveBehaviorControl()
 
 atexit.register(exit)

 return(vector)

def exit():
 log.debug("Vector exiting")
 vector.disconnect()
 
def setup(robot_config):
 global forward_speed
 global turn_speed
 global volume
 global vector
 global charge_high
 global charge_low
 global stay_on_dock

 global robotKey
 global server
 global no_mic
 global no_camera
 global ffmpeg_location
 global v4l2_ctl_location
 global x_res
 global y_res
 
 robotKey = robot_config.get('robot', 'robot_key')

 if robot_config.has_option('misc', 'video_server'):
 server = robot_config.get('misc', 'video_server')
 else:
 server = robot_config.get('misc', 'server')
 
 no_mic = robot_config.getboolean('camera', 'no_mic')
 no_camera = robot_config.getboolean('camera', 'no_camera')

 ffmpeg_location = robot_config.get('ffmpeg', 'ffmpeg_location')
 v4l2_ctl_location = robot_config.get('ffmpeg', 'v4l2-ctl_location')

 x_res = robot_config.getint('camera', 'x_res')
 y_res = robot_config.getint('camera', 'y_res')


 if vector == None:
 vector = connect()

 #x mod_utils.repeat_task(30, check_battery, coz)

 if robot_config.has_section('cozmo'):
 forward_speed = robot_config.getint('cozmo', 'forward_speed')
 turn_speed = robot_config.getint('cozmo', 'turn_speed')
 volume = robot_config.getint('cozmo', 'volume')
 charge_high = robot_config.getfloat('cozmo', 'charge_high')
 charge_low = robot_config.getfloat('cozmo', 'charge_low')
 stay_on_dock = robot_config.getboolean('cozmo', 'stay_on_dock')

# if robot_config.getboolean('tts', 'ext_chat'): #ext_chat enabled, add motor commands
# extended_command.add_command('.anim', play_anim)
# extended_command.add_command('.forward_speed', set_forward_speed)
# extended_command.add_command('.turn_speed', set_turn_speed)
# extended_command.add_command('.vol', set_volume)
# extended_command.add_command('.charge', set_charging)
# extended_command.add_command('.stay', set_stay_on_dock)

 vector.audio.set_master_volume(volume) # set volume

 return
 
def move(args):
 global charging
 global low_battery
 command = args['button']['command']

 try:
 if vector.status.is_on_charger and not charging:
 if low_battery:
 print("Started Charging")
 charging = 1
 else:
 if not stay_on_dock:
 vector.drive_off_charger_contacts().wait_for_completed()

 if command == 'f':
 vector.behavior.say_text("Moving {}".format(command))

 #causes delays #coz.drive_straight(distance_mm(10), speed_mmps(50), False, True).wait_for_completed()
 vector.motors.set_wheel_motors(forward_speed, forward_speed, forward_speed*4, forward_speed*4 )
 time.sleep(0.7)
 vector.motors.set_wheel_motors(0, 0)
 elif command == 'b':
 #causes delays #coz.drive_straight(distance_mm(-10), speed_mmps(50), False, True).wait_for_completed()
 vector.motors.set_wheel_motors(-forward_speed, -forward_speed, -forward_speed*4, -forward_speed*4 )
 time.sleep(0.7)
 vector.motors.set_wheel_motors(0, 0)
 elif command == 'l':
 #causes delays #coz.turn_in_place(degrees(15), False).wait_for_completed()
 vector.motors.set_wheel_motors(-turn_speed, turn_speed, -turn_speed*4, turn_speed*4 )
 time.sleep(0.5)
 vector.motors.set_wheel_motors(0, 0)
 elif command == 'r':
 #causes delays #coz.turn_in_place(degrees(-15), False).wait_for_completed()
 vector.motors.set_wheel_motors(turn_speed, -turn_speed, turn_speed*4, -turn_speed*4 )
 time.sleep(0.5)
 vector.motors.set_wheel_motors(0, 0)

 #move lift
 elif command == 'w':
 vector.behavior.say_text("w")
 vector.set_lift_height(height=1).wait_for_completed()
 elif command == 's':
 vector.behavior.say_text("s")
 vector.set_lift_height(height=0).wait_for_completed()

 #look up down
 #-25 (down) to 44.5 degrees (up)
 elif command == 'q':
 #head_angle_action = coz.set_head_angle(degrees(0))
 #clamped_head_angle = head_angle_action.angle.degrees
 #head_angle_action.wait_for_completed()
 vector.behaviour.set_head_angle(45)
 time.sleep(0.35)
 vector.behaviour.set_head_angle(0)
 elif command == 'a':
 #head_angle_action = coz.set_head_angle(degrees(44.5))
 #clamped_head_angle = head_angle_action.angle.degrees
 #head_angle_action.wait_for_completed()
 vector.behaviour.set_head_angle(-22.0)
 time.sleep(0.35)
 vector.behaviour.set_head_angle(0)
 
 #things to say with TTS disabled
 elif command == 'sayhi':
 tts.say( "hi! I'm cozmo!" )
 elif command == 'saywatch':
 tts.say( "watch this" )
 elif command == 'saylove':
 tts.say( "i love you" )
 elif command == 'saybye':
 tts.say( "bye" )
 elif command == 'sayhappy':
 tts.say( "I'm happy" )
 elif command == 'saysad':
 tts.say( "I'm sad" )
 elif command == 'sayhowru':
 tts.say( "how are you?" )
 except:
 return(False)
 return

def start():
 log.debug("Starting Vector Video Process")
 try:
 thread.start_new_thread(video, ())
 except KeyboardInterrupt as e:
 pass 
 return
 
def video():
 global vector
 # Turn on image receiving by the camera
 vector.camera.init_camera_feed()

 vector.behavior.say_text("hey everyone, lets robot!")

 while True:
 time.sleep(0.25)

 from subprocess import Popen, PIPE
 from sys import platform

 log.debug("ffmpeg location : {}".format(ffmpeg_location))

# import os
# if not os.path.isfile(ffmpeg_location):
# print("Error: cannot find " + str(ffmpeg_location) + " check ffmpeg is installed. Terminating controller")
# thread.interrupt_main()
# thread.exit()

 while not networking.authenticated:
 time.sleep(1)

 p = Popen([ffmpeg_location, '-y', '-f', 'image2pipe', '-vcodec', 'png', '-r', '25', '-i', '-', '-vcodec', 'mpeg1video', '-r', '25', "-f", "mpegts", "-headers", "\"Authorization: Bearer {}\"".format(robotKey), "http://{}:1567/transmit?name={}-video".format(server, networking.channel_id)], stdin=PIPE)
 #p = Popen([ffmpeg_location, '-nostats', '-y', '-f', 'image2pipe', '-vcodec', 'png', '-r', '25', '-i', '-', '-vcodec', 'mpeg1video', '-r', '25','-b:v', '400k', "-f","mpegts", "-headers", "\"Authorization: Bearer {}\"".format(robotKey), "http://{}/transmit?name=rbot-390ddbe0-f1cc-4710-b3f1-9f477f4875f9-video".format(server)], stdin=PIPE)
 #p = Popen([ffmpeg_location, '-y', '-f', 'image2pipe', '-vcodec', 'png', '-r', '25', '-i', '-', '-vcodec', 'mpeg1video', '-r', '25', "-f", "mpegts", "-headers", "\"Authorization: Bearer {}\"".format(robotKey), "http://{}/transmit?name=rbot-390ddbe0-f1cc-4710-b3f1-9f477f4875f9-video".format(server, networking.channel_id)], stdin=PIPE)
 print(vector)
 image = vector.camera.latest_image
 image.raw_image.save("test.png", 'PNG')
 try:
 while True:
 if vector:
 image = vector.camera.latest_image
 if image:
 if annotated:
 image = image.annotate_image()
 else:
 image = image.raw_image
 print("attempting to write image")
 image.save(p.stdin, 'PNG')

 else:
 time.sleep(.1)
 log.debug("Lost Vector object, terminating video stream")
 p.stdin.close()
 p.wait()
 except Exception as e:
 log.debug("Vector Video Exception! {}".format(e))
 p.stdin.close()
 p.wait()
 pass 
 



Here is the error we get


[vost#0:0/mpeg1video @ 000001c7153c1cc0] Error submitting a packet to the muxer: Error number -10053 occurred
[out#0/mpegts @ 000001c713448480] Error muxing a packet
[out#0/mpegts @ 000001c713448480] Error writing trailer: Error number -10053 occurred
[http @ 000001c7134cab00] URL read error: Error number -10053 occurred
[out#0/mpegts @ 000001c713448480] Error closing file: Error number -10053 occurred
[out#0/mpegts @ 000001c713448480] video:56kB audio:0kB subtitle:0kB other streams:0kB global headers:0kB muxing overhead: unknown
frame= 25 fps=0.0 q=2.0 Lsize= 53kB time=00:00:01.32 bitrate= 325.9kbits/s speed=7.05x
Conversion failed!

attempting to write image



You can see our attempts to fix by commented out code in the #p section at the bottom.


-
How to insert an image in between a video ?
10 février 2019, par robinson georgeI want to make an android app in which user can insert a images in a video. I tried drawing video over the photo(selected by user) with replacing green colour in video using ffmpeg library. But the results are not very satisfying and it’s take around 4-5 seconds to encode a video of around 15 seconds. There are already many apps present in play store but i was wondering how they achieved this effect in so much lesser time(like < 1 sec to encode 15 sec video).
For reference - https://play.google.com/store/apps/details?id=com.yy.biu
https://play.google.com/store/apps/details?id=com.newbiz.mvmasterYou can have a look at the result output file here- http://www.yourfilelink.com/get.php?fid=1881360
-
How can I concatenate these two video files that are in different formats with ffmpeg ?
11 juin 2018, par jaybersFile s.mp4 is created from a photo and a silent audio track was added in.
File r.mp4 was created using the built in video record on an android tablet.I would like to try to match s.mp4 to r.mp4 so that they can concatenate (s then r). Right now, the time base seems off and it plays audio from the r.mp4 but never shows the video. It it always shows the video from s.mp4. I was able to match the tbn of 90k by using
-video_track_timescale 90k
but I did not know how to match the tbc. It is 180k on one and 59.94 on the other.Probe for s.mp4
./ffprobe s.mp4
ffprobe version 4.0-tessus Copyright (c) 2007-2018 the FFmpeg developers
built with Apple LLVM version 9.1.0 (clang-902.0.39.1)
configuration: --cc=/usr/bin/clang --prefix=/opt/ffmpeg --extra-version=tessus --enable-avisynth --enable-fontconfig --enable-gpl --enable-libass --enable-libbluray --enable-libfreetype --enable-libgsm --enable-libmodplug --enable-libmp3lame --enable-libopencore-amrnb --enable-libopencore-amrwb --enable-libopus --enable-libsnappy --enable-libsoxr --enable-libspeex --enable-libtheora --enable-libvidstab --enable-libvo-amrwbenc --enable-libvorbis --enable-libvpx --enable-libwavpack --enable-libx264 --enable-libx265 --enable-libxavs --enable-libxvid --enable-libzimg --enable-libzmq --enable-libzvbi --enable-version3 --pkg-config-flags=--static --disable-ffplay
libavutil 56. 14.100 / 56. 14.100
libavcodec 58. 18.100 / 58. 18.100
libavformat 58. 12.100 / 58. 12.100
libavdevice 58. 3.100 / 58. 3.100
libavfilter 7. 16.100 / 7. 16.100
libswscale 5. 1.100 / 5. 1.100
libswresample 3. 1.100 / 3. 1.100
libpostproc 55. 1.100 / 55. 1.100
Input #0, mov,mp4,m4a,3gp,3g2,mj2, from 's.mp4':
Metadata:
major_brand : isom
minor_version : 512
compatible_brands: isomiso2avc1mp41
encoder : Lavf57.25.100
Duration: 00:00:05.04, start: 0.000000, bitrate: 296 kb/s
Stream #0:0(und): Video: h264 (Constrained Baseline) (avc1 / 0x31637661), yuv420p, 1920x1080 [SAR 1:1 DAR 16:9], 286 kb/s, 29.97 fps, 29.97 tbr, 90k tbn, 59.94 tbc (default)
Metadata:
handler_name : VideoHandler
Stream #0:1(und): Audio: aac (LC) (mp4a / 0x6134706D), 48000 Hz, stereo, fltp, 2 kb/s (default)
Metadata:
handler_name : SoundHandlerProbe for r.mp4
./ffprobe r.mp4
ffprobe version 4.0-tessus Copyright (c) 2007-2018 the FFmpeg developers
built with Apple LLVM version 9.1.0 (clang-902.0.39.1)
configuration: --cc=/usr/bin/clang --prefix=/opt/ffmpeg --extra-version=tessus --enable-avisynth --enable-fontconfig --enable-gpl --enable-libass --enable-libbluray --enable-libfreetype --enable-libgsm --enable-libmodplug --enable-libmp3lame --enable-libopencore-amrnb --enable-libopencore-amrwb --enable-libopus --enable-libsnappy --enable-libsoxr --enable-libspeex --enable-libtheora --enable-libvidstab --enable-libvo-amrwbenc --enable-libvorbis --enable-libvpx --enable-libwavpack --enable-libx264 --enable-libx265 --enable-libxavs --enable-libxvid --enable-libzimg --enable-libzmq --enable-libzvbi --enable-version3 --pkg-config-flags=--static --disable-ffplay
libavutil 56. 14.100 / 56. 14.100
libavcodec 58. 18.100 / 58. 18.100
libavformat 58. 12.100 / 58. 12.100
libavdevice 58. 3.100 / 58. 3.100
libavfilter 7. 16.100 / 7. 16.100
libswscale 5. 1.100 / 5. 1.100
libswresample 3. 1.100 / 3. 1.100
libpostproc 55. 1.100 / 55. 1.100
Input #0, mov,mp4,m4a,3gp,3g2,mj2, from 'r.mp4':
Metadata:
major_brand : mp42
minor_version : 0
compatible_brands: isommp42
creation_time : 2018-06-11T20:12:03.000000Z
com.android.version: 7.0
Duration: 00:00:10.89, start: 0.000000, bitrate: 17087 kb/s
Stream #0:0(eng): Video: h264 (High) (avc1 / 0x31637661), yuv420p(tv, bt709/bt709/smpte170m), 1920x1080, 16810 kb/s, SAR 1:1 DAR 16:9, 30 fps, 30 tbr, 90k tbn, 180k tbc (default)
Metadata:
creation_time : 2018-06-11T20:12:03.000000Z
handler_name : VideoHandle
Stream #0:1(eng): Audio: aac (LC) (mp4a / 0x6134706D), 48000 Hz, stereo, fltp, 256 kb/s (default)
Metadata:
creation_time : 2018-06-11T20:12:03.000000Z
handler_name : SoundHandle