
Recherche avancée
Autres articles (40)
-
La file d’attente de SPIPmotion
28 novembre 2010, parUne file d’attente stockée dans la base de donnée
Lors de son installation, SPIPmotion crée une nouvelle table dans la base de donnée intitulée spip_spipmotion_attentes.
Cette nouvelle table est constituée des champs suivants : id_spipmotion_attente, l’identifiant numérique unique de la tâche à traiter ; id_document, l’identifiant numérique du document original à encoder ; id_objet l’identifiant unique de l’objet auquel le document encodé devra être attaché automatiquement ; objet, le type d’objet auquel (...) -
List of compatible distributions
26 avril 2011, parThe table below is the list of Linux distributions compatible with the automated installation script of MediaSPIP. Distribution nameVersion nameVersion number Debian Squeeze 6.x.x Debian Weezy 7.x.x Debian Jessie 8.x.x Ubuntu The Precise Pangolin 12.04 LTS Ubuntu The Trusty Tahr 14.04
If you want to help us improve this list, you can provide us access to a machine whose distribution is not mentioned above or send the necessary fixes to add (...) -
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
Sur d’autres sites (7590)
-
Modify H.264 Level in MP4 stream
25 mars 2013, par d33pikaI have 1000+ videos with wrong Level information, and hence do not play on some devices. They are H.264 baseline with aac audio in mp4 container. I want to correct them but avoid re-encoding. Am I right in assuming that this is possible and will be faster ? How do I identify the level_idc bits in the streams ? Will all streams have them in the same location ? I expect this to be in just one place in the stream, is this assumption correct ?
Update : I came across a windows executable link that claims to do this. I want to be able to do this commandline on unix, so I can script it.More Updates : As per Roman's answer below. I dug up MP4 syntax and found that Profile and Level information are part of
avcC
atom understsd
. I could see that level was set to1E
, I corrected it to1F
. Before :61 76 63 43 01 42 C0 1E FF E1 00 19 67 42 C0 1E
D9After :
61 76 63 43 01 42 C0 1F FF E1 00 19 67 42 C0 1E
D9with that the MediaInfo changed to :
Video
ID : 1
Format : AVC
Format/Info : Advanced Video Codec
Format profile : Baseline@L3.0
Format settings, CABAC : No
Format settings, ReFrames : 3 frames
Muxing mode : Container profile=Baseline@3.1
Codec ID : avc1
Codec ID/Info : Advanced Video Coding
Duration : 1mn 4s
Bit rate : 3 000 Kbps
Width : 1 280 pixels
Height : 720 pixels
Display aspect ratio : 16:9
Frame rate mode : Constant
Frame rate : 30.000 fps
Color space : YUV
Chroma subsampling : 4:2:0
Bit depth : 8 bits
Scan type : Progressive
Bits/(Pixel*Frame) : 0.109
Stream size : 22.7 MiB (92%)
Writing library : x264 core 120 r2151 a3f4407
Encoding settings : cabac=0 / ref=3 / deblock=1:0:0 / analyse=0x1:0x111 / me=hex / subme=7 / psy=1 / psy_rd=1.00:0.00 / mixed_ref=1 / me_range=16 / chroma_me=1 / trellis=1 / 8x8dct=0 / cqm=0 / deadzone=21,11 / fast_pskip=1 / chroma_qp_offset=-2 / threads=12 / sliced_threads=0 / nr=0 / decimate=1 / interlaced=0 / bluray_compat=0 / constrained_intra=0 / bframes=0 / weightp=0 / keyint=250 / keyint_min=25 / scenecut=40 / intra_refresh=0 / rc_lookahead=40 / rc=abr / mbtree=1 / bitrate=3000 / ratetol=1.0 / qcomp=0.60 / qpmin=0 / qpmax=69 / qpstep=4 / ip_ratio=1.40 / aq=1:1.00It introduced a Muxing mode parameter with level
3.1
but alas this stream did not play on the device either. How do I correct the level indicated inFormat Profile
Is this possible without re-encoding ? -
FFmpeg h264_v4l2m2m encoder changing aspect ratio from 16:9 to 1:1 with black bars
8 janvier, par LycoReco2007When switching from libx264 to h264_v4l2m2m encoder in FFmpeg for YouTube streaming, the output video's aspect ratio changes from 16:9 to 1:1 with black bars on the sides, despite keeping the same resolution settings.


Original working command (with libx264) :


ffmpeg -f v4l2 \
 -input_format yuyv422 \
 -video_size 1280x720 \
 -framerate 30 \
 -i /dev/video0 \
 -f lavfi \
 -i anullsrc=r=44100:cl=stereo \
 -c:v libx264 \
 -preset ultrafast \
 -tune zerolatency \
 -b:v 2500k \
 -c:a aac \
 -b:a 128k \
 -ar 44100 \
 -f flv rtmp://a.rtmp.youtube.com/live2/[STREAM-KEY]



When I replaced
libx264
withh264_v4lm2m
, it always produce a square resolution, and it automatically adds black bars to the top and the bottom of the sides of the camera. I currently using a Rasberry Pi 4 model B, with a webcam that I believe supports the 16:9 ratio (I've verified usingv4l2-ctl --list-formats-ext -d /dev/video0
command)

I've tried the follows :


- 

- Adding
-aspect 16:9
parameter in the ffmpeg command - Adding video filters such as
-vf "scale=1280:720:force_original_aspect_ratio=decrease,pad=1280:720:(ow-iw)/2:(oh-ih)/2,setsar=1"

None of these give me the correct aspect ratio.






How can I make the h264_v4l2m2m encoder maintain the original 16:9 aspect ratio without adding black bars ? Is this a known limitation of the encoder, or am I missing some required parameters ?


- Adding
-
Editing Caption in Video Message Changes Aspect Ratio to Square
12 octobre 2024, par Shayki AbramczykI'm working on a Telegram bot that processes videos by adding a watermark and then edits the original message to replace the video in a channel post. The issue I'm encountering is that when I edit the message with the new video, the aspect ratio changes, and the video becomes a square, even though the original video is in vertical format.


Here’s a simplified version of the code I’m using to edit the message with the processed video :


video_file = await video.get_file()
print(video_file)
random = randint(0,9999)
input_path = f"input_{user_id}_{random}.mp4"
output_path = f"output_{user_id}_{random}.mp4"
await video_file.download_to_drive(input_path)

loop = asyncio.get_event_loop()
executor = ThreadPoolExecutor()
await loop.run_in_executor(executor, process_video_sync, input_path, output_path, watermark_path, settings)

try:
 if return_file:
 return open(output_path, 'rb')
 if channel:
 chat_id = post.chat_id
 message_id = post.message_id
 caption = post.caption if post.caption else ""
 if settings['has_signature']:
 signature = settings['signature']
 else:
 caption = post.caption_html if post.caption_html else (post.caption or "")
 video_clip = VideoFileClip(output_path)
 await context.bot.edit_message_media(
 chat_id=chat_id,
 message_id=message_id,
 media=InputMediaVideo(media=open(output_path, 'rb'), width=video_clip.w, height=video_clip.h, caption=caption, parse_mode="HTML")
 )
 elif update.message:
 caption = update.message.caption if update.message.caption else ""
 video_clip = VideoFileClip(output_path)
 
 with open(output_path, 'rb') as video_file:
 await update.message.reply_video(
 video=InputFile(video_file),
 caption=caption,
 width=video_clip.w,
 height=video_clip.h,
 supports_streaming=True
 )
except Exception as e:
 logger.error("Error in sending video. Exception Type:", e.args[0][0], "Message:", e.args[0][1])
finally:
 os.remove(input_path)
 os.remove(output_path)



When editing the message in a channel, the video’s aspect ratio changes from vertical to square (if the video is horizonal it's ok). However, if I send the video as a new message, the aspect ratio remains correct.


How can I ensure that when I edit the video in the channel, the aspect ratio stays the same as the original, and doesn’t get cropped or turned into a square ?


EDIT :


I found it's because I editing the video caption and added there some HTML elements which cause it.


If I just add a simple text it's ok.


Why ?