I am trying to play back the audio which was captured using waspi capture. The audio is saved in the form of wasapicapture.in file. Now the challenge is to play back the audio captured using wasapi renderer. I am able to play back, but the audio which I listen is always in stereo like, so its faster. I would like to reproduce that in original format. Could any help me please.
Thanks,
Read the file as Rawstream , pass in the WaveFormat the audio so that you can get the original recordered clarity aswell.
You could either save it into a .WAV file in the first place with WaveFileWriter, which will simplify playing it back. Or you can just read the file and pass it into a RawSourceWaveStream also passing in the WaveFormat the audio was originally recorded in.
Related
I am using javascript to capture audio data from MediaRecorder, and base64 encode it so I can send it back to the web server where it can be saved for later playback.
data:audio/webm;codecs=opus;base64,GkXfo59ChoEBQveBA...(too much data to post, but you get the idea)
I can put that data into an HTML5 audio element's .src field, and play it back on a Chrome browser just fine. But Safari can't handle the data in that format, I guess it doesn't support the opus codec.
One solution for me would be to figure out how to write the audio data into a properly formatted .webm container file, and then use ffmpeg.exe to convert it to some other Safari friendly format.
But I don't know the file format for .webm file - I'm looking for tips or guidance how to write such a .webm file.
Anybody have any suggestions, libraries, or tips to write data like above to a .webm file? I prefer a C# .net answer, but javascript will also do, or any examples are appreciated.
Well, I got a tip from smart developer (earnabler) that if I stripped off the header portion of the content:
"data:audio/webm;codecs=opus;base64,"
and decoded just the base64 portion:
"GkXfo59ChoEBQveBA...(too much data to post, but you get the idea)"
...back to binary (example in C#):
byte[] decodedBinaryData;
decodedBinaryData = Convert.FromBase64String(encodedBase64String);
...and wrote that binary to a file with a matching file extension (.webm in this example), that the file would be a properly formatted file of that type understandable by other media software.
Lo and behold, it was! I could play the file in MediaPlayer, or QuickTime, or whatever, and could use FFMPEG to convert it to other types.
So that gives me a pathway to save/use/convert the media in many ways. Problem solved.
I know about Roku doesn't support multiple videos at a time. But, Some Developers are mix up two things multiple playbacks and multiple audio tracks. Roku Does Support Multiple Audio Track?
I tried to Play MultipleAudioTrack in Roku. I used the below code to find a multiple audio track Here ?"m.video.availableAudioTracks :"m.video.availableAudioTracks but here not available any track. my stream check-in VLC MediaPlayer. Here two-track available. But, I not found in Roku. My Audio Format is AAC. I also Set Here m.video.audioFormat = "aac". Any other Configuration required to Playing a multiple Audio.
My m3u8 file is below.
#EXTM3U
#EXT-X-TARGETDURATION:9
#EXT-X-MEDIA-SEQUENCE:1
#EXT-X-VERSION:3
#EXTINF:8,
RokuMedia00000001.ts
#EXTINF:8,
RokuMedia00000002.ts
#EXTINF:8,
RokuMedia00000003.ts
Is there any configuration required for the m3u8 file.
I read the HLS Documentation which is provided by Roku. But, I have still some doubts regarding HLS Stream. I used the Roku Premiere plus device.
For CC, I enable Closed Captions options using coding it's below.
m.videoContent.streamformat = "hls"
m.videoContent.subtitleTracks = [{ language: "EN", description: "EN", trackName: "eia608/1" }]
m.videoContent.subtitleConfig = { trackName: "eia608/1" }
It's not available in M3u8 file content. It's available on my ts File. I mention my M3u8 Content in the above.
Same way, I tried to enable Multiple Audio Track using Coding.
I used Following Field For fetching a multiple Audio Track.
?"m.video.availableAudioTracks :"m.video.availableAudioTracks
m.video.audioFormat = "aac"
I refer to this example of playing a Multiple Audio Track.
I used the aac audio format for playing audio in the Roku video player.
I check the same M3u8 File in other Video Player(VLC, IOS inbuilt player, EXO Player) It takes automatically shows two audio track.
I'm not sure. But, I think Roku Video player Compalsary required multiple Audio tracks in M3u8 File. Like below. Is it Correct?
#EXT-X-MEDIA:TYPE=AUDIO,GROUP-ID="aac",NAME="English",LANGUAGE="en",AUTOSELECT=YES,\
DEFAULT=YES,URI="RokuMedia00000001.ts"
#EXT-X-MEDIA:TYPE=AUDIO,GROUP-ID="aac",NAME="Spanish",LANGUAGE="es-ES",AUTOSELECT=NO,\
DEFAULT=NO,URI="RokuMedia00000001.ts"
But, Here It possible to Put the EXT-X-MEDIA tag in Two Times?
or I don't know which specific field will add I required.
I found one article in the Roku Knowledge Center article Does Roku support multiple audio tracks?
But, I'm not required to enable multiple audio tracks at the same time. or also not required to playing simultaneously. I required to at a time only a single audio track. Because, I know any media player not support multiple audio track and video track the same time.
I required to change the audio track at run time. If my default track in English and using this option, I change to It Spanish or any else.
My Actual question is a how-to enable audio track option which provide by Roku and which fields are required in m3u8 files. To enable these options. or Roku has stopped supporting audiotrack options?
I'm not certain about Audio files, but I know that Rokus don't allow you to buffer more than one Video at a time. This effectively means that a Roku cannot play more than one Video at a time.
The same could be true for audio files but I am not certain.
Roku does not support 2 or more parallel audios.
You have to stop one audio to play some another audio.
you can do it like
m.firstAudio.contorl = "stop"
m.secondAudio.contorl = "play"
note that you have to stop it not mute.
.
I am trying to understand how mpd file plays and i am referring to the following data set:
http://www-itec.uni-klu.ac.at/ftp/datasets/mmsys12/Valkaama/MPDs/Valkaama_1s_act_isoffmain_DIS_23009_1_v_2_1c2_2011_08_30.mpd
In mpd file format there is segment base consists of mp4 chunk and within it has chunk list with extension .m4s.I downloaded mpd file using :
http://www-itec.uni-klu.ac.at/ftp/datasets/mmsys12/Valkaama/valkaama_1s/valkaama_1s_50kbit/valkaama_50kbit_dash.mp4
and m4s chunk by following link:
http://www-itec.uni-klu.ac.at/ftp/datasets/mmsys12/Valkaama/valkaama_1s/valkaama_1s_50kbit/valkaama_1s1.m4s
I tried to play both mp4 and m4s in vlc player but not able to play any of these two so i want to ask which of the chunk links in the mpd file forma i can be able to play standalone in vlc player.
Please correct me if any of my observations is wrong:
Regards
Mayank
MPD file is just a index of streams with various formats in order to adapt to your bandwidth, to get more information follow the links of the other answers here.
It's possible to download all streams and merge them into a single file, you could achieve this by using youtube-dl:
youtube-dl http://URL/TO/manifest.mpd
You can get more information in https://stackoverflow.com/a/39931712/1522342.
Also, VLC 3.0.0+ can play that kind of file from a url, just open VLC, use the shortcut CTRL+N, paste the url and enjoy.
A DASH player plays an MPD by selecting a Period, and in the Period one or more AdaptationSet, and then one Representation per AdaptationSet. For the chosen Representation, it downloads and passes the intialization segment and some media segments to the media engine. As indicated by others you can simulate that by concatenating (simply using caton Linux).
The MPEG-DASH standard requires that initialization segments (in your case the mp4 file) contain no data. This is because when switching the player might use several times the initialization segment. You can open it in a player but it does not contain any media.
For m4s files, they contain media data but they cannot be interpreted without the associated initialization segment.
you can download init segment (SegmentBase/Initialization#sourceURL) and all media segments (SegmentList/SegmentURL#media) and concatenate everything (e.g. with the copy command on windows). The result should be playable on VLC. This has to be done for audio and video separately. In the next step you can then use MP4Box or similar tools to mux audio and video.
Alternatively you can use www.dash-downloader.com to download everything in one step. The page will display some log explaining what it's doing. That might be helpfull.
(full disclosure: that's my website).
I dont think it is possible to play any of the files in a standalone player. The mp4 is the init segment which is required to decode the .m4s media segments. I dont think there is an option in the vlc player to map an init segment to multiple media segments. Nevertheless you can try a Dash player to play the manifest file. For instance dash.js
Initialization segment: A sequence of bytes that contain all of the initialization information required to decode a sequence of media segments. This includes codec initialization data, Track ID mappings for multiplexed segments, and timestamp offsets (e.g. edit lists).
Media segment: A sequence of bytes that contain packetized & timestamped media data for a portion of the media timeline. Media segments are always associated with the most recently appended initialization segment.
Source: http://www.w3.org/TR/media-source/#init-segment
I want to read just the sound block in MP4 file.
Does somebody knows how the MP4 file built? How can I find the headers in the file?
How does the header built?
Thanks
These two will give you a head start:
http://www.jiscdigitalmedia.ac.uk/guide/aac-audio-and-the-mp4-media-format
http://www.adobe.com/devnet/video/articles/mp4_movie_atom.html
I am trying to do the same thing and right now I am stuck at not being able to open the individual chunks.
hai..
Am writing application for capture video from camera in vc++ using directshow and write that
file in WMV format.and how to write MPEG4 file format.can i install any sdk for mpeg4.can you provide details about mpeg file writing in vc++
kindly help me
thanks
I'm not entirely clear if you want to change the video format or just the container format. If you just want to write the existing camera output into a different container file, then you need a multiplexor filter. There's an MP4 multiplexor filter available in source form at www.gdcl.co.uk/mpeg4. If you connect your camera's output to this filter and then the file writer, you should be ok.
If, on the other hand, you need to encode the camera output to mpeg-4 video as well, then I think you will need to licence a third-party encoder filter.
G