media

How to get notified of each new image being visible to the gallery app?

不问归期 提交于 2019-12-03 11:55:47
问题 Background When the user downloads a new image or captures one using the camera, the gallery app will get updated to show the new images. I need to be notified of each new image as soon as it was created, no matter how it was created (camera, browser,...) , just as the gallery app shows. The problem As it turns out there is a mediaScanner Android component that is responsible for scanning all types of media files, and when it finishes, it's supposed to send an intent "MEDIA_SCANNER_FINISHED"

How to use ByteBuffer in the MediaCodec context in android

独自空忆成欢 提交于 2019-12-03 10:12:20
问题 So far I am able to setup a MediaCodec to encode a video stream. The aim is to save my user generated artwork into a video file. I use android Bitmap objects of the user artwork to push frames into the stream. See the code snippet I use at the bottom of this post (it is the full code nothing is trimmed): MediaCodec uses ByteBuffer to deal with video/audio streams. Bitmaps are based on int[] which if converted to byte[] will require x4 the size of the int[] I did some research to figure out

Play mp3 using Python, PyQt, and Phonon

ε祈祈猫儿з 提交于 2019-12-03 09:57:47
问题 I been trying all day to figure out the Qt's Phonon library with Python. My long term goal is to see if I could get it to play a mms:// stream, but since I can't find an implementation of this done anywhere, I will figure that part out myself. (figured I'd put it out there if anyone knew more about this specifically, if not no big deal.) Anyway, I figured I'd work backwards from a working example I found online. This launches a file browser and will play the mp3 file specified. I wanted to

WordPress 3.5 Media Uploader Multiple File Select

泄露秘密 提交于 2019-12-03 06:11:33
I'm building a WordPress theme with a custom settings page. Some of the settings require the user to upload/add a set of images (more than 1). The default behavior of the media uploader is to upload and/or select a single image and insert it into a post. I've followed this excellent guide on utilizing the media uploader, and it suggests that I should be able to set multiple to true, but it still only allows for a single file to be uploaded or selected. Here's my code: Load in the needed scripts since this is a custom settings page: if(function_exists( 'wp_enqueue_media' )){ wp_enqueue_media();

Wordpress: Remove attachment fields

╄→尐↘猪︶ㄣ 提交于 2019-12-03 06:02:49
问题 How do I remove attachment fields, like description and alt in media library of Wordpress attachments? The following code use to work on old Wordpress versions (pre 3.5): function remove_attachment_field ( $fields ) { unset( $fields['image_alt'] ); // Removes ALT field return $fields; } add_filter( 'attachment_fields_to_edit', 'remove_attachment_field', 15, 1 ); But since then, I have not found a working solution. Do anyone know a solution? Clarification on which fields I would like to remove

Stream music with byte range requests with Django + nginx

旧时模样 提交于 2019-12-03 03:52:08
I am building a music player application with Django + nginx for which I need a backend which supports byte range requests. Django is authenticating the media file correctly but django dev server does not support range requests (206 partial response). Nginx directly serves byte range requests after using this configuration , I verified that the response header has content range. However I am unable to forward the request from django to nginx, to serve the content. I tried using X-Accel-Redirect in a django view but still the response header doesn't have content range the way it would have been

Recommended Java library for creating a video programmatically [closed]

≯℡__Kan透↙ 提交于 2019-12-03 02:44:04
问题 Closed. This question is off-topic. It is not currently accepting answers. Want to improve this question? Update the question so it's on-topic for Stack Overflow. Closed 5 years ago . Can anyone recommend a Java library that would allow me to create a video programmatically? Specifically, it would do the following: take a series of BufferedImages as the frames allow a background WAV/MP3 to be added allow 'incidental' WAV/MP3s to be added at arbitrarily, programmatically specified points

How to get notified of each new image being visible to the gallery app?

半城伤御伤魂 提交于 2019-12-03 02:18:43
Background When the user downloads a new image or captures one using the camera, the gallery app will get updated to show the new images. I need to be notified of each new image as soon as it was created, no matter how it was created (camera, browser,...) , just as the gallery app shows. The problem As it turns out there is a mediaScanner Android component that is responsible for scanning all types of media files, and when it finishes, it's supposed to send an intent " MEDIA_SCANNER_FINISHED " (as shown on this example ) . So I've added the next code , hoping it will show a toast each time the

Play mp3 using Python, PyQt, and Phonon

匆匆过客 提交于 2019-12-03 00:29:57
I been trying all day to figure out the Qt's Phonon library with Python. My long term goal is to see if I could get it to play a mms:// stream, but since I can't find an implementation of this done anywhere, I will figure that part out myself. (figured I'd put it out there if anyone knew more about this specifically, if not no big deal.) Anyway, I figured I'd work backwards from a working example I found online. This launches a file browser and will play the mp3 file specified. I wanted to strip out the file browser stuff and get it down to the essentials of executing the script and having it

Wordpress: Remove attachment fields

纵饮孤独 提交于 2019-12-02 20:39:40
How do I remove attachment fields, like description and alt in media library of Wordpress attachments? The following code use to work on old Wordpress versions (pre 3.5): function remove_attachment_field ( $fields ) { unset( $fields['image_alt'] ); // Removes ALT field return $fields; } add_filter( 'attachment_fields_to_edit', 'remove_attachment_field', 15, 1 ); But since then, I have not found a working solution. Do anyone know a solution? Clarification on which fields I would like to remove: birgire The above solution by @brasofilo should work well, but we can also use this great answer by