Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Switch between audio/video/subtitle tracks in preview #256

Open
Ac3NiNjA opened this issue Feb 24, 2020 · 14 comments
Open

Switch between audio/video/subtitle tracks in preview #256

Ac3NiNjA opened this issue Feb 24, 2020 · 14 comments

Comments

@Ac3NiNjA
Copy link

Hi,
I often have to cut videos with subtitles enabled so I can make my cut start/stop positions as accurate as possible. Therefore I have to resort to using an external player which slows down my workflow a lot.

It'll be nice if we can also select any track embedded in the file (audio/video/subtitle) so it's shown in the preview window.

Even just the ability to see the subtitles would be great; I feel like people who work with subtitles will find it very useful.

Thanks for reading!

@mifi
Copy link
Owner

mifi commented Apr 18, 2020

HTML5 audioTracks/videoTracks API

Switching between video/audio tracks is not trivial because chrome does not yet support the audio and video tracks api.

Update: Actually it works in electron with the webPreferences.experimentalFeatures: true flag!

Update2: Also works with:

// https://chromestatus.com/feature/5748496434987008
// https://peter.sh/experiments/chromium-command-line-switches/
// https://chromium.googlesource.com/chromium/src/+/main/third_party/blink/renderer/platform/runtime_enabled_features.json5
app.commandLine.appendSwitch('enable-blink-features', 'AudioVideoTracks');

To change audio track:

video.audioTracks[0].enabled = false;
video.audioTracks[1].enabled = true;

To change video track:

temp1.videoTracks[0].selected = false;
temp1.videoTracks[1].selected = true;

Drawbacks

  • Will only support files with natively supported codecs
  • I don't think it allows playing multiple audio at once
  • Need to correlate videoTrack/audioTrack object id with ffmpeg's stream index. HTML5 API seems to exclude any tracks with unsupported codecs (so indexes will be shifted)

Other alternatives

Generate tmp file

An alternative not so elegant solution: allow generating a preview file from a user-specified audio and video track (ala convert to supported format)

@OrbanjoGaming
Copy link

This would be amazing. I record 3 different audio tracks as an MKV file then remux them into an MP4 with OBS, but I can't seem to find an editor that allows me to listen to all 3 of them, trim the footage without deleting the 2nd & 3rd audio track, & not have to export with a quality loss. LosslessCut is the first one that I've seen that will trim the footage & keep the audio tracks. Now, I just need all 3 audio tracks to be able to be previewed.

@mifi mifi changed the title [Feature Request] Switch between audio/video/subtitle tracks in preview. Switch between audio/video/subtitle tracks in preview Jun 7, 2022
@Fiech
Copy link

Fiech commented Jul 30, 2022

I concur, this feature would eliminate a second video player from my workflow. I think it would be great for a start to simply be able to select the track in the preview (without any fancy remuxing)

@SakuraKoi
Copy link

SakuraKoi commented Jan 6, 2023

Need to correlate videoTrack/audioTrack object id with ffmpeg's stream index. HTML5 API seems to exclude any tracks with unsupported codecs (so indexes will be shifted)

is it really necessary to correlate object id with stream index? just list every track that can be accessed and let user choose which to play should be ok
(choose object id and play track by object id, why we needs stream index?
we are just previewing, just do our best to show as much tracks as we support, even with unsupported track and object id shifted, nothing will be lost in the output file

@pgassmann
Copy link

Switching audio tracks for playback would be very useful to cut segments for multiple translations.
in our case, sometimes the original language is not the first track, which makes it difficult to edit.

@Linnshet
Copy link

Linnshet commented Mar 2, 2023

Still crossing my fingers intensively that it will soon be possible to playback multiple audio tracks at once, like you can in most editors and VLC. It will make rough cutting several hours of footage so many times easier, since I won't have to wait on proxy file generation. LLC runs video files like butter, even at several times speed.

Much appreciated for this fantastic piece of software, mifi!

@mifi
Copy link
Owner

mifi commented Mar 4, 2023

I think it's not too hard to implement, and it's definitely one of the most requested features, so I think it will be one of the next features!

@HelioApsis
Copy link

Found this app recently, and it is EXACTLY what I was looking for...with the only drawback being the lack of playing multiple audio files, as mentioned above. Similar to @OrbanjoGaming, I record three tracks in OBS.

If there is anyone else recording using OBS and looking for this, there is one workaround for new files until this gets implemented:
In my case, I have three tracks (PC Audio, Discord/Other, and Microphone). However, I set up OBS to make four audio streams. The first (default) stream has all audio channels written to it; then, the next three streams are all the tracks separately. This does mean you'll have to delete the first audio stream later in your editor of choice to avoid duplicate sound, but it does allow you to play the file and hear all the audio tracks in VLC, Lossless Cut, etc., without multi-track audio support.

Amazing work on this software; looking forward to this getting implemented!

@FMR5487
Copy link

FMR5487 commented Jan 16, 2024

我昨天发现了这个工具,他真的让我的流程缩短了几百倍,也解放了我的硬盘.
但是在我工作流里最大的痛点还是不能同时收听多条audio track,我翻看了issues,然后就发现了这个三年前的反馈.
我知道过去这么久还没做出来并不是您的问题,而是HTML5的关系,但是这个工具还是对我的帮助非常巨大,如果能稍微解决一下这个问题那就太好了(哪怕是用不那么"优雅"的方式解决,然后发个pre-releases?maybe),just this problem PLZ
最后感谢您对这个工具的付出,mifi
I discovered this tool yesterday, it really shortened my process by hundreds of times and freed up my hard drive
But the biggest pain point in my work experience is that I can't listen to multiple audio tracks at the same time. I checked the issues and found this feedback from three years ago
I know it's not your problem that hasn't been done for so long, but rather the HTML5 relationship. However, this tool has been of great help to me. It would be great if I could solve this problem a bit (even if it's a less elegant way to solve it, and then send a pre-releases? Maybe), just this problem PLZ
Finally, thank you for your dedication to this tool, mifi
[from baidu translate]

mifi added a commit that referenced this issue Feb 12, 2024
also with MediaSource for unsupported codecs
@mifi
Copy link
Owner

mifi commented Feb 12, 2024

switcing between audio/video tracks implemented!

@taozi1996
Copy link
Contributor

In v3.61.0, if the video only has one audio track, I cannot select subtitle preview.

@mifi
Copy link
Owner

mifi commented May 15, 2024

In v3.61.0, if the video only has one audio track, I cannot select subtitle preview.

thanks for reporting. that's a bug

mifi added a commit that referenced this issue May 15, 2024
@taozi1996
Copy link
Contributor

In v3.61.0, if the video only has one audio track, I cannot select subtitle preview.

thanks for reporting. that's a bug
Video with multipleaudio tracks also failed to load subtitles, but previous versions were able to load subtitles.

屏幕截图 2024-05-16 211046

@mifi
Copy link
Owner

mifi commented May 16, 2024

yes i fixed that bug too. will be out in the next version

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

10 participants