News:

--

Main Menu

Problem with 1080i ts files

Started by gavo, November 05, 2013, 09:09:29 PM

Previous topic - Next topic

AQUAR

#15
With the sample provided, avidemux is silent on the audio.
It copies or transcodes the audio into another container alright but then the audio becomes silent on all players.

When using ffdshow this audio is seen as 6 channel rather than 2.
Everything that interprets this audio as stereo fails to make a noise.
Also noticed that the audio track is seen by some splitters as 2 channel 16Khz mp2 (also silent!).

Interesting problem, but it really needs someone that can disect the media sample to determine what is going on here.


 

pchristy

I've been trying to download the sample, but keep getting an error message when I try (502 Bad Gateway)! However, I have found an interesting thread here:

http://forum.videohelp.com/threads/346182-Processing-UK-Freeview-HD-%28H-264-lev-4-with-AAC-in-LATM-audio%29-for-iPad-PS3

which seems to address the issue. No permanent solution yet, but it looks as if people are at least working on it. And there are a couple of workarounds suggested involving VLC and MP4Box. Well worth a look.....

--
Pete

pchristy

Follow-up: I've downloaded the sample from the above mentioned thread (a clip of BBC 1 HD), and despite having aac_ltm audio, Avidemux re-muxed it into an mp4 container without problems. I used video copy, audio copy and mp4v2 muxer. The only thing I did which might make a difference is to specifically select the main audio track in the audio drop down menu, and deselect the audio description track.
--
Pete

AQUAR

@ pchristy,

I've uploaded the sample provided by gavo, so you can see for yourself this weird Mygica dvb recording.
http://www1.datafilehost.com/d/9c8e103c

The whole issue is probably just another case of a poorly captured dvb that is made worse by adding MBAFF and LATM complexities.

Let me know if you find an easy way to transcode the audio from this media sample.


mean

For reference, LATM/LOAS is normally supported by avidemux

pchristy

Aquar: Thanks for providing the clip. Yes, Avidemux does get confused by the video. Interestingly, MPlayer plays it just fine! That *ought* to mean that it should be possible to handle it with mencoder! I've had a quick try, but mencoder borks on the audio file. Its a long time since I've used mencoder, so I need to refresh my memory of how to handle odd audio formats with it - but the fact that it plays it is a good start!

Worst case scenario: Use mencoder to sort the video and avidemux to strip out the audio then re-mux them?

I'm going to go away and swat up on mencoder......

--
Pete

pchristy

Got a little bit further! This will save the video in a manner which can be successfully imported into Avidemux:

ffmpeg -i gavo.ts -f matroska -c copy -map 0:0 test.mkv

(-map 0:0 tells it to save the video only and discard the audio)

However, ffmpeg can't extract the audio in a meaningful way, and when I try and extract it with avidemux, I can't re-import the resulting file to attach to the mkv video! The nearest I got was:

ffmpeg -i gavo.ts -f s16le -acodec pcm_s16le audio.pcm

The resulting audio track played (very slowly!) in Audacity, but I couldn't re-import it into Avidemux.

If I try and save the audio without transcoding:

ffmpeg -i gavo.ts -c copy -map 0:1 test.aac

then again, avidemux objects when I try and import it.

I should add that I'm not used to trying to attach audio files with avidemux, so it could be a syntax error on my part (wrong suffix?) as I can play the test.aac file just fine in mplayer!

So to summarise: I can sort the video, but not the audio! Anyone any ideas?



--
Pete

AQUAR

@ mean
Could you be so kind as to look at this clip and see if it is just a case of bad time stamps.
I am just curious, as the frame based version isn't bothered with the video component at all.


@ pchristy

That's how far I got as well. 

Except to note that:
Avidemux 2.5.6 has no problem with the video component.
Avidemux 2.6.6 borks at decoding the second field.

Using the LAV splitter will get at the audio so we can extract the audio alright.
Hence using avisynth plus avidemux we can deal with this strange clip.

People were talking about creating a LATM-AACC to LATM-HE (stereo) transcoder but nothing has happened since a year or so.

Since gavo hasn't returned to this thread gavo has maybe given up or still waiting for some response from mygica.

gavo

I am still here looking around on other forums but waiting for Mygica reply.

pchristy

OK, I've managed to extract the audio using mplayer, but it has to be transcoded:

mplayer gavo.ts -vc null -vo null -ao pcm:fast:file=test.wav

Not the fastest, but it does produce a file that can be imported into avidemux. So to summarise:

1) Extract video with ffmpeg: <ffmpeg -i gavo.ts -f matroska -c copy -map 0:0 test.mkv>
2) Extract audio with mplayer: <mplayer gavo.ts -vc null -vo null -ao pcm:fast:file=test.wav>
3) Multiplex the two back together using Avidemux.

Its a bit long winded, but it works here! And I can't easily check the sync on the clip provided, but it seems OK as far as I can tell. Of course the fact that the audio works with mplayer implies that it ought to be possible to do it in one hit with mencoder. I'll give it a try later.....

--
Pete

AQUAR

#25
A simpler way if gavo doen't want to mess with CLI.

VLC can demux and transcode this audio without any problem.
(and everyone has VLC - no!)

Transcode the audio to MP3 using VLC - convert/save.
Then in avidemux 2.5.6,  replace the internal audio with the MP3 (via audio external track).
After that just remux in copy mode into a container of your choice.

Made an .avi using this approach and it played fine.
Only caveat is that the sample is to small to check for audio sync.

Pity avidemux 2.6.6 has an issue with parsing the video track out of the media clip, else it would be even better.



pchristy

I've not had any luck with mencoder, which seems to bork on the video file. It can handle the audio just fine.

I've never had much luck with VLC. It can be a total pain to build on Linux, and the hardware acceleration (needed for HiDef video) simply doesn't work on either of my systems (NVidia or AMD/Ati). MPlayer, on the other hand, plays back HiDef perfectly, with minimum processor load, even on a humble, single-core netbook!

Anyway, that's a couple of potential workarounds for gavo, so I'm going to give my brain a rest!

;)

--
Pete

styrol

Maybe I missed something but the sample can be converted into a "valid" mp4 file by just reencoding the audio using ffmpeg:
ffmpeg -i Input.ts -c:a aac -cutoff 15000 -b:a 128k -strict experimental -async 1 -c:v copy -sn -threads 8 -y Ouput.mp4
The sample is to small to check for audio sync.

FFmpeg output:
ffmpeg version 2.1-tessus Copyright (c) 2000-2013 the FFmpeg developers
  built on Oct 28 2013 04:17:07 with llvm-gcc 4.2.1 (LLVM build 2336.1.00)
  configuration: --prefix=/Users/tessus/data/ext/ffmpeg/sw --as=yasm --extra-version=tessus --disable-shared --enable-static --disable-ffplay --enable-gpl --enable-pthreads --enable-postproc --enable-libmp3lame --enable-libtheora --enable-libvorbis --enable-libx264 --enable-libxvid --enable-libspeex --enable-bzlib --enable-zlib --enable-libopencore-amrnb --enable-libopencore-amrwb --enable-libxavs --enable-version3 --enable-libvo-aacenc --enable-libvo-amrwbenc --enable-libvpx --enable-libgsm --enable-libopus --enable-fontconfig --enable-libfreetype --enable-libass --enable-libbluray --enable-filters --enable-runtime-cpudetect
  libavutil      52. 48.100 / 52. 48.100
  libavcodec     55. 39.100 / 55. 39.100
  libavformat    55. 19.104 / 55. 19.104
  libavdevice    55.  5.100 / 55.  5.100
  libavfilter     3. 90.100 /  3. 90.100
  libswscale      2.  5.101 /  2.  5.101
  libswresample   0. 17.104 /  0. 17.104
  libpostproc    52.  3.100 / 52.  3.100
[..]
Stream #0:0 -> #0:0 (copy)
Stream #0:1 -> #0:1 (aac_latm -> aac)
video:4510kB audio:95kB subtitle:0 global headers:0kB muxing overhead 0.153012%



pchristy

Styrol: Interesting!  I just tried your command and whilst it threw up a load of error messages, it did appear to work!

My ffmpeg is :  ffmpeg version N-56829-gf5b27b6, built on Oct 3rd from a git download, so its reasonably up-to-date.

Loads of video errors:

[h264 @ 0x221cca0] sps_id out of range
[h264 @ 0x221cca0] non-existing PPS referenced
[h264 @ 0x221cca0] sps_id out of range
[h264 @ 0x221cca0] non-existing PPS 0 referenced
[h264 @ 0x221cca0] decode_slice_header error
[h264 @ 0x221cca0] non-existing PPS 0 referenced
[h264 @ 0x221cca0] decode_slice_header error
<snip>

presumably due to it not starting in the right place, and also this for the audio:

[mpegts @ 0x2218c80] PES packet size mismatch
Error while decoding stream #0:1: Invalid data found when processing input

but having said that, it does produce a file that plays, and can be loaded into Avidemux for further tweaking!

Well done, that man! Have a cigar!

;D


--
Pete

pchristy

Following on from Styrol's post, I notice that there has been a new ffmpeg release - 2.1.1 - released yesterday (20th Nov).

I've just built this and can confirm that this handles the video in one hit, with a minimal cli:

ffmpeg -i gavo.ts -f mp4 -strict -2 -vcodec copy -async 1 gavo.mp4

-i defines the input file, -f specifies mp4 format output, -strict -2 tells it to allow the (experimental) aac audio codec, -vocdec copy speaks for itself, and async 1 tells it to sync the start of the video with the audio. gavo.mp4 is the output file. If you don't specify an audio codec, ffmpeg will default to aac if mp4 is specified.

I still get a lot of error codes, but it does produce a working mp4 file!

I normally use -async 1200 when transcoding, as this will allow the audio/video sync to be corrected gradually. -async 1 simply lines it up at the start and assumes that both are running at the same speed.

So a recent build of ffmpeg will do the whole thing in one hit!

;D

--
Pete