multimedia

Java API for SRT subtitles [closed]

纵饮孤独 提交于 2019-11-30 08:57:16
Is there any Java API for SRT subtitles ? The actual SRT parsing is performed through regular expressions, which Java is able to manipulate. The actual regexp is: protected static final String nl = "\\\n"; protected static final String sp = "[ \\t]*"; Pattern.compile("(?s)(\\d+)" + sp + nl + "(\\d{1,2}):(\\d\\d):(\\d\\d),(\\d\\d\\d)" + sp + "-->"+ sp + "(\\d\\d):(\\d\\d):(\\d\\d),(\\d\\d\\d)" + sp + "(X1:\\d.*?)??" + nl + "(.*?)" + nl + nl); group 2, 3, 4, and 5 is start time group 6, 7, 8, and 9 is finish time group 11 is subtitle text I have produced a java logic with which to parse and read

How to find duration of a video file using mediainfo in seconds or other formats?

北战南征 提交于 2019-11-30 04:33:33
How can I find duration of a video file in miliseconds i.e. in integer in deterministic way. I have used ffprobe to get the duration but it doesn't give duration for all file formats. Harit Vishwakarma Use the following commands: i) To get the duration of video stream: $ mediainfo --Inform="Video;%Duration%" [inputfile] ii) To get the duration of the media file: $ mediainfo --Inform="General;%Duration%" [inputfile] iii) To get the duration of audio stream only: $ mediainfo --Inform="Audio;%Duration%" [inputfile] iv) To get values of more than one parameter: $ mediainfo --Inform="Video;%Width%,

android stream audio to server

老子叫甜甜 提交于 2019-11-30 04:03:55
I would like to understand how socket work, especially I need some code samples for server side to receive the stream sent by mediarecorder from the device. Thank you very much for any help. My real final intent is to talk in device and listen it on PC, just one direction. At moment I am able to send out the stream using the following code: String hostname = "192.168.1.10"; int port = 8000; Socket socket = null; try { socket = new Socket(InetAddress.getByName(hostname), port); } catch (UnknownHostException e) { e.printStackTrace(); } catch (IOException e) { e.printStackTrace(); }

Getting AVI file duration

只谈情不闲聊 提交于 2019-11-29 17:33:46
I am using VFW unit from JEDI wrapper on WinAPI. The code I am writing is intended to search user drives and detect warez (note: deciding if some file is legal or not is beyond scope of this question). We do MP3, WMA and some graphic file search. Now we want to detect illegal movies. I want to open AVI file, read some details from it and close it. I have the following code: uses WFV; //from JEDI api wrappers procedure TForm1.Button1Click(Sender: TObject); var lInfo : TAVIFILEINFOW; lFile : IAVIFILE; lFileType : string; lLenMinutes : integer; lFPS : integer; begin {init file} AVIFileInit; try

How to get the master volume in windows xp?

末鹿安然 提交于 2019-11-29 10:59:59
In Windows XP, with Delphi, how to get the master volume? I know I can set up and down sending key strokes with keybd_event(VK_VOLUME_UP, 1, 0, 0); and keybd_event(VK_VOLUME_DOWN, 1, 0, 0); , but I don't know how to get the actual value of the volume. The below is a little modification on the example code found here (credited there is Thomas Stutz). The example there sets the microphone volume. I just modified the component type - speaker destination instead of microphone source, and replaced mixerSetControlDetails with mixerGetControlDetails , and turned the setter into a getter of course. On

Java API for SRT subtitles [closed]

不羁的心 提交于 2019-11-29 08:05:34
问题 Is there any Java API for SRT subtitles ? 回答1: The actual SRT parsing is performed through regular expressions, which Java is able to manipulate. The actual regexp is: protected static final String nl = "\\\n"; protected static final String sp = "[ \\t]*"; Pattern.compile("(?s)(\\d+)" + sp + nl + "(\\d{1,2}):(\\d\\d):(\\d\\d),(\\d\\d\\d)" + sp + "-->"+ sp + "(\\d\\d):(\\d\\d):(\\d\\d),(\\d\\d\\d)" + sp + "(X1:\\d.*?)??" + nl + "(.*?)" + nl + nl); group 2, 3, 4, and 5 is start time group 6, 7,

Concept about Multimedia Codecs (Container,Format, Codec,Muxer,Demuxer) [closed]

孤街浪徒 提交于 2019-11-29 03:01:13
问题 I have gone thorugh lot of multimedia stuff last week and now messed up in few questions.These are related to my work on Developing a Media Player.My questions below are based on that only. I am also looking out for ebook/resource on Multimedia codecs? I am looking for the following info ? What is the difference between container, format,codec, packet, frame? I believe it is Container -> Audio(streams) + Video (streams) Streams are encoded/decoded using the codecs Streams -> Packets Packets -

How to find duration of a video file using mediainfo in seconds or other formats?

末鹿安然 提交于 2019-11-29 01:56:12
问题 How can I find duration of a video file in miliseconds i.e. in integer in deterministic way. I have used ffprobe to get the duration but it doesn't give duration for all file formats. 回答1: Use the following commands: i) To get the duration of video stream: $ mediainfo --Inform="Video;%Duration%" [inputfile] ii) To get the duration of the media file: $ mediainfo --Inform="General;%Duration%" [inputfile] iii) To get the duration of audio stream only: $ mediainfo --Inform="Audio;%Duration%"

Getting AVI file duration

浪尽此生 提交于 2019-11-28 12:51:58
问题 I am using VFW unit from JEDI wrapper on WinAPI. The code I am writing is intended to search user drives and detect warez (note: deciding if some file is legal or not is beyond scope of this question). We do MP3, WMA and some graphic file search. Now we want to detect illegal movies. I want to open AVI file, read some details from it and close it. I have the following code: uses WFV; //from JEDI api wrappers procedure TForm1.Button1Click(Sender: TObject); var lInfo : TAVIFILEINFOW; lFile :

Android API for detecting new media from inbuilt camera & mic

穿精又带淫゛_ 提交于 2019-11-28 09:04:17
Is there any elegant way in the Android API for detecting new media when it is written to the device? I’m mainly interested in photos taken by the camera, video taken by the camera and audio recorded from the mic. My current thinking is to periodically scan each media content provider and filter based on last scan time. I’m just wondering if there is some service I can get realtime notifications. There's a special broadcast Intent that should get called every time an application writes anything new to the Media Store: Intent.ACTION_MEDIA_SCANNER_SCAN_FILE The Broadcast Intent includes the path