News:

--

Main Menu

[FLAC]No supported Audio after copy

Started by stormlamp, January 13, 2016, 01:44:41 PM

Previous topic - Next topic

stormlamp

Hello,

I have a *.mkv video with flac-Audio.

Video: 1280*720 at 25 FPS, AVC (high@L4.1) /CABAC / 7 Ref Frames)
Audio: 48 kHz, 16 bits, 2 channels, FLAC

The Audio track is about 0.4 seconds earlier than the video.

I opened the file with Avidemux 2.6.10.
The main window shows:
Video Decoder: Lavcodec
Video Output: Copy
Audio Output: Copy
Shift: -40 ms
Output Format: AVI Muxer

If I then save the file, I cannot play it on my Samsung TV. There is no problem with the origin *.mkv file but with the new saved *.avi file.
I get the message: The audio format is not supported.

What shall I do?

Greatings
stormlamp






Jan Gruuthuse

try Audio Output: MP3 lame (or any other supported audio codec in any supported Output Format by Samsung)
even in the combination Samsung could be very picky.

stormlamp

It doesn't work:

Video Decoder: Lavcodec
Video Output: Copy
Audio Output: Copy
Shift: -60 ms
Output Format: AVI Muxer
------------------------------------------> audio format not supported
Video Decoder: Lavcodec
Video Output: Copy
Audio Output: MP3 lame
Shift: -60 ms
Output Format: AVI Muxer
------------------------------------------> no sound
Video Decoder: Lavcodec
Video Output: Copy
Audio Output: MP3 lame
Shift: -60 ms
Output Format: MKV Muxer
------------------------------------------> converting not supported
Video Decoder: Lavcodec
Video Output: Copy
Audio Output: Mp3 lame
Shift: -60 ms
Output Format: MP4 Muxer
------------------------------------------> no sound
Video Decoder: Lavcodec
Video Output: Copy
Audio Output: AC3 lav
Shift: -60 ms
Output Format: MP4 Muxer
------------------------------------------> no sound

Does anyone has an idea, how to delay an audio track without loosing the quality and in a way that a Samsung TV can play it?

Greatings
stormlamp

Jan Gruuthuse

You can find a 34.8 MB mp4 video with mp3 audio track, here to test on Samsung: http://avidemux.org/smif/index.php/topic,12094.msg73304.html#msg73304

Strange does work here:
load video, select only one track
Avidemux Menu -> Audio - Select Track ->
Track 1 [v] enabled [Track 0 ....] [Unknown] [MP3 (lame)
[OK]
Video Output:
[Copy]

Output Format
[Mkv Muxer]

If that did not work, can you upload 10 second video, similar to that what you want to convert?
ps: Use a free dropbox account, mega or similar webservice (free public access, without registration to download your uploaded video) thank you.


stormlamp

Hello Jan,

the demo file works after the conversion as you described.

But I cannot convert my original file. I have cut a small part of it.

This cut works on my Samsung TV, but after using Avidemux there is no Sound.

Here I stored the short file:
https://www.dropbox.com/s/u4q0evjdisgps5l/Test%20720p%20BluRay%20FLAC%202.0%20x264%2800h11m05s-00h11m23s%29-002.mkv?dl=0

Greetings

AQUAR

#5
I don't think FLAC is supported by ADM (at least not in the near past).

If you need to recode anything:
Suggest you demux the source media and recode the FLAC audio track into an ADM compatible audio format (eg MP3).
      If you have VLC it can extract and convert the audio track (tried it on your sample).
      There must be other free programs around that can do this as well.
Simply add this recoded audio version back into ADM and deselect the original FLAC audio track of the source media.
Now the audio will play in ADM and you can re-sync / recode / edit the media file as required.
I am sure there must be more elegant ways to do this with ADM (use avisynth).

If you don't want to recode anything (just time shift the audio!):
Just use the free MKVtoolnix package to remux the streams into the MKV container.
      You can set the audio time shift in MKVtoolnix for the audio track no problem.
      This way you keep the FLAC audio track but it will be time shifted.


Jan Gruuthuse

#6
Confirmed: Flac is not supported in avidemux.
You could extract audio from video with audacity and then export to mp3 or other wanted format.
When you have mp3 track:
- Avidemux Menu: Audio -> Select Track
- In Audio Tracks configuration:
- Track 1 [v] Enabled click on: [Track 0 from video (unknown codec, Stereo, 128kbps) and select in drop down list:
- .... Add audio track, and browse to the exported mp3 track and select it.


extracted flac audio track exported to mp3: FlacToMp3
inserted mp3 track: Test 720p BluRay FLAC 2.0 x264(00h11m05s-00h11m23s)-002.mp3
downloads available for one week (educational purpose only)

gino2812

Quote from: Jan Gruuthuse on January 15, 2016, 08:29:43 AM
Confirmed: Flac is not supported in avidemux.
You could extract audio from video with audacity and then export to mp3 or other wanted format.
When you have mp3 track:
- Avidemux Menu: Audio -> Select Track
- In Audio Tracks configuration:
- Track 1 [v] Enabled click on: [Track 0 from video (unknown codec, Stereo, 128kbps) and select in drop down list:
- .... Add audio track, and browse to the exported mp3 track and select it.


extracted flac audio track exported to mp3: FlacToMp3
inserted mp3 track: Test 720p BluRay FLAC 2.0 x264(00h11m05s-00h11m23s)-002.mp3
downloads available for one week (educational purpose only)

Hi, sorry to revive this post, but I want to know if the Flac codec is still  unsupported.
Also, if possible, I wanna know if there are any plans to solve this issue.

eumagga0x2a

Unfortunately, FLAC is still unsupported. To edit a MKV with FLAC audio, reencode it with ffmpeg first

ffmpeg -i your-video-with-flac-audio.mkv -c:v copy -c:a pcm_s16le your-video-with-pcm-audio.mkv

then cut it in copy mode keeping MKV as container with Avidemux and convert it back into a MKV with FLAC audio with ffmpeg:

ffmpeg -i your-cut-video-with-pcm-audio.mkv -c:v copy -c:a flac your-cut-video-with-flac-audio.mkv

Please note that the problem is aggravated by the fact that Avidemux seems not to accept s32le format. If your FLAC audio was previously in that format, you will have quality loss. This doesn't matter if the original audio was 16 bit anyway, of course.

gino2812

Quote from: eumagga0x2a on September 11, 2016, 01:24:09 PM
Unfortunately, FLAC is still unsupported. To edit a MKV with FLAC audio, reencode it with ffmpeg first

ffmpeg -i your-video-with-flac-audio.mkv -c:v copy -c:a pcm_s16le your-video-with-pcm-audio.mkv

then cut it in copy mode keeping MKV as container with Avidemux and convert it back into a MKV with FLAC audio with ffmpeg:

ffmpeg -i your-cut-video-with-pcm-audio.mkv -c:v copy -c:a flac your-cut-video-with-flac-audio.mkv

Please note that the problem is aggravated by the fact that Avidemux seems not to accept s32le format. If your FLAC audio was previously in that format, you will have quality loss. This doesn't matter if the original audio was 16 bit anyway, of course.

Ok, thank you.
I was trying to have a video able to be played on my tv. For this to happen, I need AAC, mp3 or ac3, audio. Best if its CBR, 'cause VBR, jumps some problems now and then.

It seems I'm gonna need something special to work with all FLAC. Fortunately I test audacity and it can do the trick.

eumagga0x2a

Quote from: gino2812 on September 11, 2016, 08:14:32 PM
I was trying to have a video able to be played on my tv. For this to happen, I need AAC, mp3 or ac3, audio.

If preservation of the original audio quality is not the top priority, the task gets even simpler:

ffmpeg -i your-video-with-flac-audio.mkv -c:v copy -c:a aac -b:a 192k your-video-with-aac-audio.mkv

192k should be more than enough for stereo. Use 384k for surround sound.

Avidemux is handy if you need to cut video. ffmpeg is best for dull converting tasks.

QuoteIt seems I'm gonna need something special to work with all FLAC. Fortunately I test audacity and it can do the trick.

Why using Audacity for such a primitive task?

Jan Gruuthuse

Quote from: eumagga0x2a on September 11, 2016, 10:01:01 PM
Why using Audacity for such a primitive task?
- Always nice to have visual oversight, at a glance you see if there is something wrong (graphical wave representation of audio track).
- Asked what track if multiple track.
- ...

Jan Gruuthuse

good news, following commits:
Quote655408f    [audio/Decoder] Add flac support for mkv
08473bf    [audio] Use correct fourcc for flac
should become available shortly in nightly

eumagga0x2a

#13
Unfortunately, the newly added FLAC support in Avidemux is of little or no use for now. Avidemux consistently crashes playing (or saving) my ffmpeg generated test MKVs with FLAC audio longer than just a couple of minutes in duration:

Segfault
at line 0, file ??ADM_backTrack

ADM_EditorSegment::getSegment(int)
ADM_edAudioTrackFromVideo::getCurrentTrack()
ADM_edAudioTrackFromVideo::getPCMPacket(float*, unsigned int, unsigned int*, unsigned long*)
AUDMAudioFilter_Bridge::fillIncomingBuffer(AUD_Status*)
AUDMAudioFilter_Bridge::fill(unsigned int, float*, AUD_Status*)
AUDMAudioFilter::fillIncomingBuffer(AUD_Status*)
AUDMAudioFilterMixer::fill(unsigned int, float*, AUD_Status*)
GUIPlayback::audioPump(bool)
GUIPlayback::run()
GUI_PlayAvi()
HandleAction(Action)
/usr/local/bin/avidemux3_qt5() [0x4a1383]
QMetaObject::activate(QObject*, int, int, void**)
MainWindow::actionSignal(Action)
MainWindow::searchMenu(QAction*, MenuEntry*, int)
/usr/local/bin/avidemux3_qt5() [0x4a121c]
QMetaObject::activate(QObject*, int, int, void**)
QMenu::triggered(QAction*)


QMetaObject::activate(QObject*, int, int, void**)
QAction::triggered(bool)
QAction::activate(QAction::ActionEvent)
QAction::event(QEvent*)
QApplicationPrivate::notify_helper(QObject*, QEvent*)
QApplication::notify(QObject*, QEvent*)
QCoreApplication::notifyInternal2(QObject*, QEvent*)
QShortcutMap::dispatchEvent(QKeyEvent*)


and there is no FLAC support in muxer yet.

I'm a bit unsure if adding new core features and making a release a few days later fit well together...

Jan Gruuthuse