Broken transcoding in Win10 Fall Creators Update

Open
#187 7 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

Assessment

Difficulty
4/5
Estimated time
3-5 days
Newbie friendliness
25/100
Issue type
Bug
Clarity
Needs clarification
Activity status
Stale
Tech stack
csharp

Research direction

Start with the sample C# transcoding code in the issue and reproduce it on Windows 10 Fall Creators Update using the linked original.mov and Broken.mp4 files. Compare the MediaTranscoder output with the source to determine whether the failure is in FFmpegInterop or the UWP MediaTranscoding APIs; done means a reproducible diagnosis and a documented next step.

Written by the indexing model from the issue text.

Description

Hi
We've been using FFMpegInterop with UWP MediaTranscoding APIs to transcode videos. However, after Win 10 Fall Creators update, MediaTranscoder produces broken videos.

For example,
Original Video : https://www.dropbox.com/s/obcyxim7h7np47j/original.mov?dl=0
Transcoded broken video : https://www.dropbox.com/s/lz6yqo740l2z475/Broken.mp4?dl=0

You can find sample transcoding code to reproduce this issue

FFmpegMSS = FFmpegInteropMSS.CreateFFmpegInteropMSSFromStream(readStream, true, true);
MediaStreamSource mss = FFmpegMSS.GetMediaStreamSource();
var profile = MediaEncodingProfile.CreateMp4(VideoEncodingQuality.HD1080p);

var start = TimeSpan.Parse("00:00:00");
var trimDuration = FFmpegMSS.Duration;
var transcoder =new MediaTranscoder()
                    {
                        AlwaysReencode = true,
                        HardwareAccelerationEnabled = true
                    };
transcoder.TrimStartTime = start;
transcoder.TrimStopTime = trimDuration;

var destinationPath = Path.GetTempFileName();
var destination = await StorageFile.GetFileFromPathAsync(destinationPath);
await destination.RenameAsync(Path.GetFileNameWithoutExtension(destinationPath) + ".mp4");
using (var destinationStream = await destination.OpenAsync(FileAccessMode.ReadWrite))
{
    PrepareTranscodeResult prepareOp = await transcoder.PrepareMediaStreamSourceTranscodeAsync(mss, destinationStream, profile);

    if (prepareOp.CanTranscode)
    {
        await prepareOp.TranscodeAsync();
    }
}

Is anyone else experiencing this issue ?
Is this problem related to FFMpeg ?

Dominant language
C++
Stars
1.4k
Forks
319
PR merge metrics
No merged PRs in 30d

Contributor guide

No contributing guide indexed for this repository

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

More from microsoft/FFmpegInterop

All issues in microsoft/FFmpegInterop

Similar issues

More C++ issues

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.