
Recherche avancée
Médias (1)
-
Revolution of Open-source and film making towards open film making
6 octobre 2011, par
Mis à jour : Juillet 2013
Langue : English
Type : Texte
Autres articles (40)
-
Les statuts des instances de mutualisation
13 mars 2010, parPour des raisons de compatibilité générale du plugin de gestion de mutualisations avec les fonctions originales de SPIP, les statuts des instances sont les mêmes que pour tout autre objets (articles...), seuls leurs noms dans l’interface change quelque peu.
Les différents statuts possibles sont : prepa (demandé) qui correspond à une instance demandée par un utilisateur. Si le site a déjà été créé par le passé, il est passé en mode désactivé. publie (validé) qui correspond à une instance validée par un (...) -
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 (...) -
Supporting all media types
13 avril 2011, parUnlike most software and media-sharing platforms, MediaSPIP aims to manage as many different media types as possible. The following are just a few examples from an ever-expanding list of supported formats : images : png, gif, jpg, bmp and more audio : MP3, Ogg, Wav and more video : AVI, MP4, OGV, mpg, mov, wmv and more text, code and other data : OpenOffice, Microsoft Office (Word, PowerPoint, Excel), web (html, CSS), LaTeX, Google Earth and (...)
Sur d’autres sites (4001)
-
Buid Exoplayer with ffmpeg extension
22 février 2021, par Bhoomi KalavadiyaI'm making IP streaming android application. In which I'm using exoplayer 2.12.0. Input video is having mpeg-L2 audio layer codec which is not supported by exoplayer https://github.com/google/ExoPlayer/issues/6525. So i'm using ffmpeg extension to render audio.

I have followed https://github.com/google/ExoPlayer/tree/release-v2/extensions/ffmpeg steps to build ffmpeg extension with android-ndk-r21d-linux-x86_64 and FFmpeg-release-4.3.

Added code in the application

TrackSelector trackSelectors = new DefaultTrackSelector(new AdaptiveTrackSelection.Factory()); RenderersFactory renderersFactory=new DefaultRenderersFactory(this,EXTENSION_RENDERER_MODE_ON,DEFAULT_ALLOWED_VIDEO_JOINING_TIME_MS); player = ExoPlayerFactory.newSimpleInstance(this, renderersFactory,trackSelectors);



Still audio is not coming and the log is as below

2020-12-01 05:05:10.803 9161-9161/demo.demoapps.com.exoplayer2udpdemo D/EventLogger : videoEnabled [eventTime=1.39, mediaPos=0.00, window=0, period=0]

2020-12-01 05:05:10.808 9161-9161/demo.demoapps.com.exoplayer2udpdemo D/EventLogger : tracks [eventTime=1.39, mediaPos=0.00, window=0, period=0, []]

2020-12-01 05:05:10.808 9161-9161/demo.demoapps.com.exoplayer2udpdemo I/MainActivity : onTracksChanged

2020-12-01 05:05:10.809 9161-9161/demo.demoapps.com.exoplayer2udpdemo I/MainActivity : 2

2020-12-01 05:05:10.809 9161-9161/demo.demoapps.com.exoplayer2udpdemo I/MainActivity : Format(2204/5204, null, null, video/mpeg2, null, -1, null, [720, 576, -1.0], [-1, -1])

2020-12-01 05:05:10.809 9161-9161/demo.demoapps.com.exoplayer2udpdemo I/MainActivity : Format(2204/6204, null, null, audio/mpeg-L2, null, -1, null, [-1, -1, -1.0], [2, 48000])

2020-12-01 05:05:10.813 9161-9161/demo.demoapps.com.exoplayer2udpdemo D/EventLogger : downstreamFormat [eventTime=1.40, mediaPos=0.00, window=0, period=0, id=2204/5204, mimeType=video/mpeg2, res=720x576]

2020-12-01 05:05:10.827 9161-9219/demo.demoapps.com.exoplayer2udpdemo I/OMXClient : IOmx service obtained

2020-12-01 05:05:10.926 9161-9218/demo.demoapps.com.exoplayer2udpdemo D/SurfaceUtils : connecting to surface 0x6f5abb1010, reason connectToSurface

2020-12-01 05:05:10.928 9161-9218/demo.demoapps.com.exoplayer2udpdemo I/MediaCodec : [OMX.qcom.video.decoder.mpeg2] setting surface generation to 9380865

2020-12-01 05:05:10.928 9161-9218/demo.demoapps.com.exoplayer2udpdemo D/SurfaceUtils : disconnecting from surface 0x6f5abb1010, reason connectToSurface(reconnect)

2020-12-01 05:05:10.929 9161-9218/demo.demoapps.com.exoplayer2udpdemo D/SurfaceUtils : connecting to surface 0x6f5abb1010, reason connectToSurface(reconnect)

2020-12-01 05:05:10.941 9161-9219/demo.demoapps.com.exoplayer2udpdemo I/ExtendedACodec : setupVideoDecoder()

2020-12-01 05:05:10.950 9161-9219/demo.demoapps.com.exoplayer2udpdemo I/ExtendedACodec : Decoder will be in frame by frame mode

2020-12-01 05:05:10.995 9161-9219/demo.demoapps.com.exoplayer2udpdemo D/SurfaceUtils : set up nativeWindow 0x6f5abb1010 for 720x576, color 0x7fa30c06, rotation 0, usage 0x20002900

2020-12-01 05:05:11.014 9161-9161/demo.demoapps.com.exoplayer2udpdemo D/EventLogger : videoDecoderInitialized [eventTime=1.60, mediaPos=0.00, window=0, period=0, OMX.qcom.video.decoder.mpeg2]

2020-12-01 05:05:11.015 9161-9161/demo.demoapps.com.exoplayer2udpdemo D/EventLogger : videoInputFormat [eventTime=1.60, mediaPos=0.00, window=0, period=0, id=2204/5204, mimeType=video/mpeg2, res=720x576]

2020-12-01 05:05:11.060 9161-9219/demo.demoapps.com.exoplayer2udpdemo D/SurfaceUtils : set up nativeWindow 0x6f5abb1010 for 720x576, color 0x7fa30c06, rotation 0, usage 0x20002900

2020-12-01 05:05:11.101 9161-9161/demo.demoapps.com.exoplayer2udpdemo D/EventLogger : videoSize [eventTime=1.69, mediaPos=0.00, window=0, period=0, 720, 576]

2020-12-01 05:05:11.153 9161-9161/demo.demoapps.com.exoplayer2udpdemo D/EventLogger : surfaceSize [eventTime=1.74, mediaPos=0.00, window=0, period=0, 786, 590]

2020-12-01 05:05:11.180 9161-9161/demo.demoapps.com.exoplayer2udpdemo D/EventLogger : renderedFirstFrame [eventTime=1.76, mediaPos=0.00, window=0, period=0, Surface(name=null)/@0x1c4f9a6]

2020-12-01 05:05:12.517 9161-9161/demo.demoapps.com.exoplayer2udpdemo I/MainActivity : onPlayerStateChanged : playWhenReady = true playbackState = 3

2020-12-01 05:05:12.517 9161-9161/demo.demoapps.com.exoplayer2udpdemo I/MainActivity : ExoPlayer ready ! pos :

2020-12-01 05:05:12.518 9161-9161/demo.demoapps.com.exoplayer2udpdemo D/EventLogger : state [eventTime=3.10, mediaPos=0.00, window=0, period=0, READY]

2020-12-01 05:05:12.523 9161-9161/demo.demoapps.com.exoplayer2udpdemo D/EventLogger : isPlaying [eventTime=3.11, mediaPos=0.00, window=0, period=0, true]


Here, With or without ffmpeg extension, I'm not getting audioEnabled log in Eventlogger.
Also after using ffmpeg audio render, I'm not getting it is being used or not.
Or am I missing some configuration of ffmpeg extension to Exoplayer ?
 -
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 ?


-
Editing Video in Channel Changes Aspect Ratio to Square
11 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 ?