How to Merge Subtitle Data with Video Data By MediaTranscoder? #4983
Unanswered
BigHeadDev
asked this question in
Q&A
Replies: 0 comments
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
-
I have subtitle track data in the data layer using TimedMetadataTrack, which is input by the user through interaction, including time, subtitle content, etc.
Additionally, there is a video file selected by the user from StorageFile.
I want to use some APIs from the Windows Apps SDK to merge the video file and subtitle track data, re-encode a new video, and save it to a new file.
Through some research, I found some APIs(MediaTranscoder,MediaEncodingProfile,TimedMetadataEncodingProperties,etc) and attempted to code based on my understanding.
However, it seems that the final output doesn't work, as the new video file does not display any subtitles.
Below is my sample code:
I used MediaTranscoder for the conversion and TimedMetadataStreamDescriptor to specify the subtitle information. Note that I converted the .srt subtitle content to byte[] using:
It seems not to work. Can the Windows Apps SDK achieve this requirement?
By the way, ffmpeg can accomplish the above task, but I prefer to use the Windows Apps SDK.
Beta Was this translation helpful? Give feedback.
All reactions