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

Failed to use AC3 file as audio #2634

Closed
dmak opened this issue Nov 14, 2017 · 11 comments
Closed

Failed to use AC3 file as audio #2634

dmak opened this issue Nov 14, 2017 · 11 comments

Comments

@dmak
Copy link

dmak commented Nov 14, 2017

I have AC3 track which I would like to use as audio track while editing subtitles.
When I select AC3, the dialog is displayed:

There seems to be missing a codec (or file is not a valid video/audio file)!
You need to install/update LAV Filters - DirectShow Media Splitter and Decoders: ...
NOTE: Subtitle Edit can also use mpv, VLC or MPC-HC as built-in video player. See Options -> Settings -> Video Player

Message: Specified cast is not valid.
Source: SubtitleEdit

Stack Trace: 
   at QuartzTypeLib.<bcdc290e-1840-41e4-a1c7-9032aa4924d2>IVideoWindow.set_Owner(Int32 Owner)
   at Nikse.SubtitleEdit.Logic.VideoPlayers.QuartsPlayer.Initialize(Control ownerControl, String videoFileName, EventHandler onVideoLoaded, EventHandler onVideoEnded)
   at Nikse.SubtitleEdit.Logic.UiUtil.InitializeVideoPlayerAndContainer(String fileName, VideoInfo videoInfo, VideoPlayerContainer videoPlayerContainer, EventHandler onVideoLoaded, EventHandler onVideoEnded)

however I have LAV Filters installed. When I close the dialog with OK and click on waveform window, it starts to transform it to wave:

Generate waveform data
This may take a few minutes - please wait

and renders the waveform, however when I press play button, nothing happens.

I tested using GraphStudioNext64 that comes with K-Lite Codec Pack and it plays given AC3 just fine:

image

Subtitle Edit v3.5.4
LAV Splitter v0.67.0.60

The issue is similar to issue #1982.

@niksedk
Copy link
Member

niksedk commented Nov 19, 2017

I don't really understand what happens - SE uses VLC to extract audio ( or FFMpeg if chosen in settings, code is here: https://github.com/SubtitleEdit/subtitleedit/blob/master/src/Forms/AddWaveForm.cs ) and VLC uses it's own codecs.

You could simulate it by running a cmd line with something like this:

vlc "myvideo.mkv" -I dummy -vvv --no-random --no-repeat --no-loop --no-sout-video --audio-track=0 --sout="#transcode{acodec=s16l,channels=1,ab=128}:std{access=file,mux=wav,dst=out.wav}" vlc://quit

@dmak
Copy link
Author

dmak commented Nov 20, 2017

Actually I need to mention that I have VLC v2.2.4 also installed, but SE does not show it as installed in "Settings → Video Player" ("VLC media player" is disabled). Maybe I should uninstall it?
I also don't have anything special in "Settings → Waveform/spectogram, in particular, "Use FFmpeg for wave extraction" is unchecked. What was used to produce wave is a mystery :) Maybe it is possible to generate/check logs?

I don't know how to apply your command, because I don't have video + audio in e.g. MKV as you suppose. I only have one SRT and one AC3.

@niksedk
Copy link
Member

niksedk commented Nov 20, 2017

VLC is still used for waveform generation (the 32-bit version), but SE needs the 64-bit version in order to show video.

About the cmd line, instead of "myvideo.mkv" just use your audio file, e.g. "myaudio.ac3"...

Could you possible email me an ac3 file that causes this error?

@dmak
Copy link
Author

dmak commented Nov 20, 2017

When I start the command you've provided, the output file out.wav is created and a lot of debug information is dumped to console:

[004bc74c] core input debug: Creating an input for 'audio.ac3'
[00514c84] core playlist debug: requesting art for audio.ac3
[0051142c] core stream output debug: core art finder debug: using sout chain=`transcode{acodec=s16l,channels=1,ab=128}:std{access=file,mux=wav,dst=out.wav}'looking for meta fetcher module matching "any": 1 candidates
[005281dc] core mux debug: looking for sout mux module matching "wav": 10 candidates
[005281dc] core mux debug: using sout mux module "mux_wav"
[00511394] stream_out_standard stream out debug: using `file/wav://out.wav'
[00511394] core stream out debug: using sout stream module "stream_out_standard"
[0051142c] core stream output debug: stream=`transcode'
[0051155c] stream_out_transcode stream out debug: codec audio=s16l 0Hz 1 channels 128Kb/s
[004bc74c] core input debug: creating demux: access='file' demux='any' location='/D:audio.ac3' file='D:\audio.ac3'
[00502eac] a52 demux packetizer debug: A/52 channels:6 samplerate:48000 bitrate:448000
[0275c7ec] araw encoder debug: samplerate:48000Hz channels:1 bits/sample:16
[0051155c] core stream out debug: input 'a52 ' 48000 Hz 3F2R/LFE frame=1536 samples/0 bytes
[0051155c] core stream out debug: conversion: 'a52 '->'s16l' 48000 Hz->48000 Hz3F2R/LFE->Mono

I have shared AC3 file here (300MB).

@niksedk
Copy link
Member

niksedk commented Nov 23, 2017

Thx for the file - however it's working fine here for me.
@ivandrofly: Does this file work for you?

@dmak
Copy link
Author

dmak commented Nov 25, 2017

I have posted a video that shows what is happening at my PC. Perhaps this is a result of unfortunate combination of the installed software :)

@niksedk
Copy link
Member

niksedk commented Nov 26, 2017

The video explains it nicely :)
Yes, I guess it must be a result of unfortunate combination of installed software.
I can play the file - in all four video players available in SE.
You could try to re-install lav filters and reset settings while doing so: https://github.com/Nevcairiel/LAVFilters/releases/download/0.70.2/LAVFilters-0.70.2-Installer.exe

As an alternative you could change the video player to "mpv".

Also, I've included ".ac3" as audio extension in latest beta.

@dmak
Copy link
Author

dmak commented Nov 26, 2017

I have uninstalled VLC and now waveform cannot be generated :( I get this message:

Subtitle Edit needs VLC player 1.1.x or newer for extracting audio data.

Actually the message is not complete, as alternative is to install ffmpeg, right?

It looks like there is some side effect caused by K-Lite Mega Codec Pack. At the moment I cannot uninstall it as I use it heavily, however LAV Splitter is a part of it. On some reason Subtitle Edit does not pick it up.

@niksedk
Copy link
Member

niksedk commented Nov 26, 2017

Just switch player to mpv - it also rocks :)

SE can download the dll file via Options -> Settings -> Video player

@dmak
Copy link
Author

dmak commented Nov 27, 2017

When I select MPC, SubtitleEdit starts very slowly and after I select audio.ac3, it crashes with the following message:

image

@niksedk
Copy link
Member

niksedk commented Nov 28, 2017

Did you try mpv ?

@niksedk niksedk closed this as completed Nov 28, 2017
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants