You are not logged in.

#1 2010-12-17 16:19:42

Darksoul71
Member
Registered: 2010-04-12
Posts: 319

Question on editing h264 TS -> which tool chain ?

Hi there,

I've been editing / encoding some satellite HD streams which a colleague of mine gave me to experiment. Those streams have an .TS extension but I guess that they are M2TS in reality. At least that is what TSMuxer indicates. I spent some good time experimenting with a lot of tools under Windows in order to shrink and cut the M2TS streams. Nearly all tools (DGAIndex plus AVSProxy and AVIDemux / ffmpeg) had their issues such as simply crashing, slow searching.

After some more investigation it seems to me that the format of the stream is an issue. Is there a well working tool similar to ProjectX which supports satellite streams with h264 ?
Is someone of you editing h264 videos under arch ? If yes with what tool chain ?

I am really curious. Espically since I want to edit HD videos from my cam also.

Edit: I should add that I am both interested in lossless I-frame based editing as well as editing with re-encoding the resulting video.

TIA,
D$

Last edited by Darksoul71 (2010-12-17 16:39:26)


My archlinux x86_64 host:
AMD E350 (2x1.6GHz) / 8GB DDR3 RAM / GeForce 9500GT (passive) / Arch running from 16GB USB Stick

Offline

#2 2010-12-22 12:09:26

ronnylov
Member
Registered: 2010-12-21
Posts: 65

Re: Question on editing h264 TS -> which tool chain ?

I have some limited success by demuxing h.264 .ts video streams under windows with a tool called xport and then remux them again with tsmuxer. Maybe you can use it with wine or perhaps port it for Linux (the source code is available).

http://www.w6rz.net/xport.zip

Or maybe just a simple demux and remux using tsmuxer can make your file more compatible? In my experience it might even be better to remux it into mkv (mkvtoolnix) and use that file as source for the other programs. When playing TS and M2TS in mencoder I have problems searching but it usually works when playing MKV files. If you make sure it works in MPlayer then you could use mencoder to encode it to some suitable format.

If you just want to cut the original streams (and not edit and reencode) I think it is important to cut on I-frames only, otherwise you may get playback problems. I have not yet explored the possibilities how to do this on Linux. Maybe you can do it with AviDemux after remuxing it to MKV?

If you find working tools then I am very interested to know tour tool chain.

(By the way, this is my first post on this forum)

Offline

#3 2010-12-23 23:07:02

Darksoul71
Member
Registered: 2010-04-12
Posts: 319

Re: Question on editing h264 TS -> which tool chain ?

Hi there,

thanks a lot for posting your experiences. I didn´t know xport in the first place but tried some similar tools to this.
Most of them are only available under Windows. This includes (but is not limited to smile):
- eac3to
- h264tsto
- MKV muxing function of MeGUI

At least with h264to I was able to produce a MKV container with 720p h264 video and AC3 audio. Now the problem start when I want to edit the video (pure hard I-frame based cutting). Either my audio gets out of sync or the resulting AC3 audio is scrambled. I have no clue what is happening here.
Sometimes avidemux behaves very flakey with h264 video.

For HD streams I mainly see the issue that they often have errors which require a special way of processing the streams. ffmpeg (while encoding) seems to deal nicely with those stream errors. I have often seen a lot of frames being dropped during re-encode but the resulting file is in sync.

For Windows there are several tools (e.g. tsdoctor) mainly targeting this area but they all cost 30-40 bucks.

My cheap HD cam produces similar issues because unfortunately it stores VBR aac audio and h264 video inside an AVI container (I have no clue what those cam designer were smoking).
Merging recorded segments with avidemux results in artifacts at the merge points. VirtualDub is unable to handle aac inside AVI but I can merge the segments nicely. As a workaround I recompress the audio to PCM with mencoder and automatically merge the segments with VirtualDubMod.

But sorry, that´s way off my initial questions. If I find a truely nicely working solution under Linux to both free h264 transport streams from all errors as well as edit them easily, I´ll let you know.

I am wishing you all a merry x-mas,
D$

Last edited by Darksoul71 (2010-12-23 23:07:32)


My archlinux x86_64 host:
AMD E350 (2x1.6GHz) / 8GB DDR3 RAM / GeForce 9500GT (passive) / Arch running from 16GB USB Stick

Offline

#4 2010-12-28 00:25:47

ronnylov
Member
Registered: 2010-12-21
Posts: 65

Re: Question on editing h264 TS -> which tool chain ?

Hi again!

I have now found a method that works well for me in Windows and Iam going to try it on ArchLinux too.
First I use Tsmuxer to demux the ts file to elementary files (.h264 and .ac3).
Then I use mkvmerge gui to create a mkv of the elementary streams previously demuxed. The demuxing-muxing step to MKV is a way to "fix" the file for proper playback and seeking.

Load the MKV file in a player that can display timecodes and find the cut points in the full mkv file.
Load the full mkv file in mkvmerge GUI and on General tab enable splitting and split on "after time codes".
For instance I was splitting a long file on this list of time codes corresponding to the I-frames where I wanted to cut:

00:03:22.880,01:01:32.540,01:02:52.820,02:01:00.800

Which gave me five MKV files. One before start of first episode, second is the first episode, third is between fisrt and second episode, fourth is second episode and fifth file is after second episode. I wanted to keep first and second episodes so I just deleted first, third and fifth files.

The player that worked on windows was Media Player Home Cinema and by holding shift and stepping with right and left arrows I was stepping on I-frames. When finding correct I-frame to cut on press Ctrl-G to view exact time code.

This info was found here:
http://forum.doom9.org/showthread.php?t=118388
post #11 and #12.

However the tools tsmuxer and mkvtoolnix are available on Linux too so this should work also on Arch Linux.
Now I just need to find the player that can display exact timecodes on I-frames when seeking through a MKV file.
Maybe Mplayer can do this?

I also wonder if the mkvmerge GUI is also available on Linux?
Perhaps already included in the mkvtoolnix package?
On windows I used tsMuxerGUI. Is this available on Linux too?
I will check it and see what I can do.

EDIT: mkvmerge gui is indeed included in mkvtoolnix package and tsMuxeR-gui is available from AUR.
It works fine on Arch Linux too!
I use Gnome Mplayer to find the timecodes for cutting and it is quite accurate.

Last edited by ronnylov (2010-12-30 21:15:13)

Offline

#5 2011-01-04 11:29:45

Darksoul71
Member
Registered: 2010-04-12
Posts: 319

Re: Question on editing h264 TS -> which tool chain ?

Hi there,

thanks for following up and a happy new year to you all...
I just found the same hint (editing via mkvmerge GUI and split points) some days ago myself. I am currently evaluating a few other options for processing h264 m2ts stuff myself.

At the beginning of next week I will get some more HD recordings from my colleague to evaluate my processing methods. All in all HD stuff is interesting since I would be able to capture HD via digital cable (DVB-C) as well. In Germany the freely available HD channels are only 720p but better than the analogue SD stuff tongue

I keep you posted and will try the method with the I-frames found via MPlayer plus splitting via mmg.

-D$


My archlinux x86_64 host:
AMD E350 (2x1.6GHz) / 8GB DDR3 RAM / GeForce 9500GT (passive) / Arch running from 16GB USB Stick

Offline

#6 2011-01-04 11:56:25

Gusar
Member
Registered: 2009-08-25
Posts: 3,605

Re: Question on editing h264 TS -> which tool chain ?

Once thing you could try is Avidemux 2.6. It's still heavy in development, but not long ago the developer asked to test fro specifically your scenario - the cutting of ts files: http://forum.doom9.org/showthread.php?t=158580

Offline

#7 2011-01-04 12:08:04

Darksoul71
Member
Registered: 2010-04-12
Posts: 319

Re: Question on editing h264 TS -> which tool chain ?

Thanks for the info ! I'll give Avidemux 2.6 a try although I do not think that Avidemux 2.5.X is causing this issue.
It would be way cool if I could get rid of all those additional tools.

Edit: Also if this is not directly related to this...I found a "hybrid" GUI for h264 which works under Linux and Windows as well:
http://forum.doom9.org/showthread.php?t=153035

Might be worth a try....

Last edited by Darksoul71 (2011-01-04 14:02:06)


My archlinux x86_64 host:
AMD E350 (2x1.6GHz) / 8GB DDR3 RAM / GeForce 9500GT (passive) / Arch running from 16GB USB Stick

Offline

#8 2011-01-04 15:42:05

ronnylov
Member
Registered: 2010-12-21
Posts: 65

Re: Question on editing h264 TS -> which tool chain ?

I had some trouble finding the timecodes for the I-frames to cut on. Gnome Mplayer does not display time codes with fractions of seconds (it display only whole seconds) and it does not find key frames (I can step frame by frame though). Maybe it is because I am using VDPAU as decoder? I noticed that using mkvinfo I could find where each cluster start in the mkv file and it seems that the first video frame of each cluster is a key frame and I could get the time codes of these key frames by reading the output of mkvinfo -v. This way I could get clean cutting points. I verified by stepping throuch the merged cuts frame by frame with Gnome Mplayer and could not notice any decoding garbage.

First I tried avidemux which reports frame types (I, P or B) but I found it is not accurate when compared to mkvinfo. Avidemux lagged one frame behind (displaying I frame on a frame that really was the first B-frame after the I-frame). But using the key frame time codes from mkvinfo gave me nice cuts that worked well to merge in mkvmerge later. I also had big problems searching in the video using Avidemux (it takes forever if moving slider close to the end of the video).

I guess it should be possible to make a script for seraching the closest reference key frames to a given time code using the output from mkvinfo. Maybe combining this with an edl file for mplayer and pass it on to mkvmerge. In theory it could be possible to create a h.264 editor gui for cutting out commecials and things like that. But I am not a good programmer so I have to use the manual methods. The edl output option of mplayer is useful to mark frames to cut by pressing i when playing in mplayer.

Sometimes I still get audio synch problems. I think it can be caused by bad receiving of the TV-signal by my DVB-C card. As prevously mentioned such things were nicely fixed by projectX for MPEG-2 recordings but it does not work with h.264 streams. Tsmuxer seems to do some minor fixing such as correcting audio scew. Fortunately I have two audio tracks so if AC3 track fails I can use the MP2 audio track instead and may get one of them in sync with video.

I have not tried Avidemux 2.6. But maybe the Avideomux author could use mkvinfo as parser to make searching and cutting to work better in mkv files? Maybe it already use mkvinfo, I don't know, I have not looked at the source code.

After having made a full edit using mkvmerge you can use mkvextract to demux the tracks and then create a new m2ts file using tsmuxer if this is your intended final format. But I like the mkv container more than the TS container. The files get a little bit smaller with mkv and searching works better. But if you are going to burn it on bluray or AVCHD then you need m2ts container on the disc.

As for DVB-C HD-capture I use a dedicated WindowsXP machine with a FireDTV-C receiver (I might try to get it working in Linux some day). Here in Sweden only the public TV SVT is freely avialable in HD format 1280x720 50 fps and this is what I am working with. All other HD channels are paired with certain HD-boxes which makes it impossible to capture with a computer as far as I know. For SD capturing I also have a linux box with VDR. In theory this might also work with HD but my old Technotrend DVB-C Premium card seems not be able to receive HD (maybe it can work if I switch to software decoding instead of the builtin hardware MPEG2-decoder). Perhaps I could use FireDTV on Linux with VDR too?

Hybrid GUI looks interesting. Is it possible to create an AUR package for this?

Offline

#9 2011-01-04 18:46:15

Darksoul71
Member
Registered: 2010-04-12
Posts: 319

Re: Question on editing h264 TS -> which tool chain ?

Ok, downloading avidemux 2.6 right now...I will report back if it worked on my M2TS satellite stream.

In regard to I-frames I think that an I-frame is always in a constant position. So if any player or editing software is reporting the type of frames then I would expect that the I-frames for example shown in MPlayer have the same position in AVIDemux. At least in theory smile

I found that avidemux shows different positions for I-frames if you have h264 source video and use the "safe mode" versus the "non-safe" mode.

Your DVB-C Firewirebox looks cool. At least under MythTV I know that peoples in the US are using cable boxes with Firewire for capturing HD material. I would check out the corresponsing driver for this. May be the company which produces your FireDTV-C can tell you more ?

Edit: http://www.firedtv.bbackx.com/

Here in Germany we have the same format: 720p@50FPS. Quite nice also not as good as native 1080p big_smile

Hybrid GUI looks interesting. Is it possible to create an AUR package for this?

Yes, although I never build some AUR package for this I guess it would be at least nice to have an install script which packages all the corresponding dependencies.

Edit: YEESSSSS...by using avidemux 2.6 I was able to directly cut my M2TS satellite stream based on I-frames, stream copy to a MKV file and everything worked fine. Seems that avidemux 2.6 got some major rework. it also rights an index file for M2TS files which makes scrolling through the video as fast as you usually only can see when using dgaindex. I will try out with other material and report back.

Last edited by Darksoul71 (2011-01-04 20:56:55)


My archlinux x86_64 host:
AMD E350 (2x1.6GHz) / 8GB DDR3 RAM / GeForce 9500GT (passive) / Arch running from 16GB USB Stick

Offline

#10 2011-01-06 12:45:49

Darksoul71
Member
Registered: 2010-04-12
Posts: 319

Re: Question on editing h264 TS -> which tool chain ?

OK, short update...beside my enthusiasm I have noticed some "stuttering" with the AC3 audio of the edited stream. I get this effect both under WinXP as well as under arch64 with different players (mplayer, Mediaplayer, VLC). In general this avidemux 2.6 build seems to have big issues when you encode anything. If I choose a MP2 audio track inside the satellite stream for example I experience scrambled audio after 20-30 secs working audio in the beginning.

I will crosscheck this evening by using Matroska Mux GUI together with the I-frames I found out by using avidemux 2.6.

In the end I am still not shure wether the resulting h264 stream is free from errors and for example will play back nicely in a hardware Multimediaplayer.

I also found a hint to run h264_parse from mpeg4ip over the raw .264 for problematic h264 streams. I have got another oversized MKV file in 1080p which refuses to be re-encoded. Not matter if I use avidemux 2.5 natively or under WinXP via avsproxy plus dgaindex and AVISynth.

I still have the feeling that we are lacking some tool similar to ProjectX which scans the whole stream / file and corrects any errors (as far as possible).

My colleague will return from holiday next week and give me some more M2TS streams to play with. I will also crosscheck some commercial Windows tools as well (TSDoctor for example) and report the results here. I guess M2TS editing is interesting for everyone owning a DVB-S2 card or similar device.


My archlinux x86_64 host:
AMD E350 (2x1.6GHz) / 8GB DDR3 RAM / GeForce 9500GT (passive) / Arch running from 16GB USB Stick

Offline

#11 2011-01-08 23:33:21

ronnylov
Member
Registered: 2010-12-21
Posts: 65

Re: Question on editing h264 TS -> which tool chain ?

I do also have some problems if I try reencode a perfectly synced mkv from my DVB capture.
Studying mplayer stdout output gives some clues of problems in my original stream.
Used this command to get a log of my playback:

$mplayer -lavdopts threads=4 -nosound -benchmark -vc ffh264 -vo null file.mkv

Got something like this:

MPlayer git-30c5994-4.5.2 (C) 2000-2010 MPlayer Team
161 audio & 350 video codecs
mplayer: could not connect to socket
mplayer: No such file or directory
Failed to open LIRC support. You will not be able to use your remote control.

Playing Milleniumserien - Män som hatar kvinnor, Del 2 av 6.mkv.
[mkv] Track ID 1: video (V_MPEG4/ISO/AVC), -vid 0
[mkv] Track ID 2: audio (A_AC3), -aid 0, -alang swe
[mkv] Track ID 3: audio (A_MPEG/L2), -aid 1, -alang swe
[mkv] Will play video track 1.
Detected file format: Matroska
VIDEO:  [avc1]  1280x720  24bpp  50.000 fps    0.0 kbps ( 0.0 kbyte/s)
==========================================================================
Forced video codec: ffh264
Opening video decoder: [ffmpeg] FFmpeg's libavcodec codec family
Asking decoder to use 4 threads if supported.
Selected video codec: [ffh264] vfm: ffmpeg (FFmpeg H.264)
==========================================================================
Audio: no sound
Starting playback...
V:   0.0   0/  0 ??% ??% ??,?% 0 0 
Movie-Aspect is 1.78:1 - prescaling to correct movie aspect.
VO: [null] 1280x720 => 1280x720 Planar YV12 
V: 789.6   0/  0  9%  0%  0.0% 0 0 
[h264 @ 0xc571a0]concealing 3102 DC, 3102 AC, 3102 MV errors
[h264 @ 0xc571a0]concealing 1801 DC, 1801 AC, 1801 MV errors
V: 789.7   0/  0  9%  0%  0.0% 0 0 
[h264 @ 0xc571a0]concealing 3210 DC, 3210 AC, 3210 MV errors
[h264 @ 0xc571a0]left block unavailable for requested intra mode at 0 9
[h264 @ 0xc571a0]error while decoding MB 0 9, bytestream (45449)
[h264 @ 0xc571a0]concealing 2929 DC, 2929 AC, 2929 MV errors
V: 789.8   0/  0  9%  0%  0.0% 0 0 
[h264 @ 0xc571a0]concealing 3431 DC, 3431 AC, 3431 MV errors
[h264 @ 0xc571a0]concealing 3182 DC, 3182 AC, 3182 MV errors
[h264 @ 0xc571a0]concealing 2852 DC, 2852 AC, 2852 MV errors
[h264 @ 0xc571a0]concealing 2742 DC, 2742 AC, 2742 MV errors
V: 789.8   0/  0  9%  0%  0.0% 0 0 
[h264 @ 0xc571a0]concealing 2820 DC, 2820 AC, 2820 MV errors
V: 789.9   0/  0  9%  0%  0.0% 0 0 
[h264 @ 0xc571a0]concealing 3199 DC, 3199 AC, 3199 MV errors
V: 789.9   0/  0  9%  0%  0.0% 0 0 
[h264 @ 0xc571a0]concealing 2445 DC, 2445 AC, 2445 MV errors
[h264 @ 0xc571a0]concealing 2753 DC, 2753 AC, 2753 MV errors
[h264 @ 0xc571a0]concealing 2283 DC, 2283 AC, 2283 MV errors
V: 789.9   0/  0  9%  0%  0.0% 0 0 
[h264 @ 0xc571a0]concealing 2156 DC, 2156 AC, 2156 MV errors
V:1119.3   0/  0  9%  0%  0.0% 0 0 
[h264 @ 0xc571a0]concealing 1319 DC, 1319 AC, 1319 MV errors
V:1812.5   0/  0  9%  0%  0.0% 0 0 
[h264 @ 0xc571a0]concealing 350 DC, 350 AC, 350 MV errors
V:2379.7   0/  0  9%  0%  0.0% 0 0 
[h264 @ 0xc571a0]concealing 323 DC, 323 AC, 323 MV errors
V:3966.4   0/  0  9%  0%  0.0% 0 0 
[h264 @ 0xc571a0]left block unavailable for requested intra mode at 0 2
[h264 @ 0xc571a0]error while decoding MB 0 2, bytestream (97163)
[h264 @ 0xc571a0]concealing 3489 DC, 3489 AC, 3489 MV errors
V:5348.5   0/  0  9%  0%  0.0% 0 0 


BENCHMARKs: VC: 511.785s VO:   0.198s A:   0.000s Sys:  31.825s =  543.808s
BENCHMARK%: VC: 94.1114% VO:  0.0363% A:  0.0000% Sys:  5.8523% = 100.0000%

Exiting... (End of file)

So I can see there are problems but I don't know what to do, maybe cut out problem parts in original stream?

Offline

#12 2011-01-10 11:34:24

Darksoul71
Member
Registered: 2010-04-12
Posts: 319

Re: Question on editing h264 TS -> which tool chain ?

Hi there,

using your mplayer command on my old M2TS stream (Batman begins) and the three new M2TS streams my colleague gave me today (Bourne Triology) I get pretty much the same errors for all four files:

[h264 @ 0x7f97fa287120]number of reference frames exceeds max (probably corrupt input), discarding one
[h264 @ 0x7f97fa287120]number of reference frames exceeds max (probably corrupt input), discarding one
[h264 @ 0x7f97fa287120]number of reference frames exceeds max (probably corrupt input), discarding one
[h264 @ 0x7f97fa287120]Cannot parallelize deblocking type 1, decoding such frames in sequential order
[h264 @ 0x7f97fa287120]number of reference frames exceeds max (probably corrupt input), discarding one
[h264 @ 0x7f97fa287120]number of reference frames exceeds max (probably corrupt input), discarding one
[h264 @ 0x7f97fa287120]mmco: unref short failure
[h264 @ 0x7f97fa287120]number of reference frames exceeds max (probably corrupt input), discarding one
[h264 @ 0x7ff297ff5120]number of reference frames exceeds max (probably corrupt input), discarding one
[h264 @ 0x7ff297ff5120]number of reference frames exceeds max (probably corrupt input), discarding one
[h264 @ 0x7ff297ff5120]number of reference frames exceeds max (probably corrupt input), discarding one
[h264 @ 0x7ff297ff5120]Cannot parallelize deblocking type 1, decoding such frames in sequential order
[h264 @ 0x7ff297ff5120]number of reference frames exceeds max (probably corrupt input), discarding one
[h264 @ 0x7ff297ff5120]number of reference frames exceeds max (probably corrupt input), discarding one
[h264 @ 0x7ff297ff5120]mmco: unref short failure
[h264 @ 0x7ff297ff5120]number of reference frames exceeds max (probably corrupt input), discarding one
[h264 @ 0x7fc1b2b66120]number of reference frames exceeds max (probably corrupt input), discarding one
[h264 @ 0x7fc1b2b66120]number of reference frames exceeds max (probably corrupt input), discarding one
[h264 @ 0x7fc1b2b66120]number of reference frames exceeds max (probably corrupt input), discarding one
[h264 @ 0x7fc1b2b66120]number of reference frames exceeds max (probably corrupt input), discarding one
[h264 @ 0x7fc1b2b66120]number of reference frames exceeds max (probably corrupt input), discarding one
[h264 @ 0x7fc1b2b66120]number of reference frames exceeds max (probably corrupt input), discarding one
[h264 @ 0x7fc1b2b66120]number of reference frames exceeds max (probably corrupt input), discarding one
[h264 @ 0x7fc1b2b66120]number of reference frames exceeds max (probably corrupt input), discarding one
[h264 @ 0x7fc1b2b66120]number of reference frames exceeds max (probably corrupt input), discarding one
[h264 @ 0x7fc1b2b66120]Cannot parallelize deblocking type 1, decoding such frames in sequential order
[h264 @ 0x7fc1b2b66120]number of reference frames exceeds max (probably corrupt input), discarding one
[h264 @ 0x7fc1b2b66120]number of reference frames exceeds max (probably corrupt input), discarding one
[h264 @ 0x7fc1b2b66120]mmco: unref short failure
[h264 @ 0x7fc1b2b66120]number of reference frames exceeds max (probably corrupt input), discarding one
[h264 @ 0x7fefbf582120]Cannot parallelize deblocking type 1, decoding such frames in sequential order
[h264 @ 0x7fefbf582120]number of reference frames exceeds max (probably corrupt input), discarding one
[h264 @ 0x7fefbf582120]mmco: unref short failure
[h264 @ 0x7fefbf582120]number of reference frames exceeds max (probably corrupt input), discarding one

Using ffmpeg for converting the M2TS stream to MKV also reports stream errors. I was using this command:

ffmpeg -i Batman\ Begins_20101206_2210.ts -f matroska -vcodec copy -acodec copy -scodec copy ~/bb_stream.mkv 

...ffmpeg reports those errors:

[h264 @ 0x1734f10]non-existing SPS 5 referenced in buffering period
[h264 @ 0x1734f10]non-existing PPS referenced
[h264 @ 0x1734f10]non-existing SPS 5 referenced in buffering period
[h264 @ 0x1734f10]non-existing PPS 0 referenced
[h264 @ 0x1734f10]decode_slice_header error
[h264 @ 0x1734f10]no frame!
[h264 @ 0x1734f10]non-existing SPS 5 referenced in buffering period
[h264 @ 0x1734f10]non-existing PPS referenced
[h264 @ 0x1734f10]non-existing SPS 5 referenced in buffering period
[h264 @ 0x1734f10]non-existing PPS 0 referenced
[h264 @ 0x1734f10]decode_slice_header error
[h264 @ 0x1734f10]no frame!
[h264 @ 0x1734f10]non-existing SPS 5 referenced in buffering period
[h264 @ 0x1734f10]non-existing PPS referenced
[h264 @ 0x1734f10]non-existing SPS 5 referenced in buffering period
[h264 @ 0x1734f10]non-existing PPS 0 referenced
[h264 @ 0x1734f10]decode_slice_header error
[h264 @ 0x1734f10]no frame!
[h264 @ 0x1734f10]non-existing SPS 6 referenced in buffering period
[h264 @ 0x1734f10]non-existing PPS referenced
[h264 @ 0x1734f10]non-existing SPS 6 referenced in buffering period
[h264 @ 0x1734f10]non-existing PPS 0 referenced
[h264 @ 0x1734f10]decode_slice_header error
[h264 @ 0x1734f10]no frame!
[h264 @ 0x1734f10]non-existing SPS 6 referenced in buffering period
[h264 @ 0x1734f10]non-existing PPS referenced
[h264 @ 0x1734f10]non-existing SPS 6 referenced in buffering period
[h264 @ 0x1734f10]non-existing PPS 0 referenced
[h264 @ 0x1734f10]decode_slice_header error
[h264 @ 0x1734f10]no frame!
[h264 @ 0x1734f10]non-existing SPS 6 referenced in buffering period
[h264 @ 0x1734f10]non-existing PPS referenced
[h264 @ 0x1734f10]non-existing SPS 6 referenced in buffering period
[h264 @ 0x1734f10]non-existing PPS 0 referenced
[h264 @ 0x1734f10]decode_slice_header error
[h264 @ 0x1734f10]no frame!
[h264 @ 0x1734f10]non-existing SPS 6 referenced in buffering period
[h264 @ 0x1734f10]non-existing PPS referenced
[h264 @ 0x1734f10]non-existing SPS 6 referenced in buffering period
[h264 @ 0x1734f10]non-existing PPS 0 referenced
[h264 @ 0x1734f10]decode_slice_header error
[h264 @ 0x1734f10]no frame!
[h264 @ 0x1734f10]number of reference frames exceeds max (probably corrupt input), discarding one

The content of the M2TS does not look very special to me:

Input #0, mpegts, from 'Batman Begins_20101206_2210.ts':
  Duration: 08:05:19.58, start: 39800.643767, bitrate: 4188 kb/s
  Program 11100 
  Program 11110 
    Stream #0.0[0x17de]: Video: h264, yuv420p, 1280x720 [PAR 1:1 DAR 16:9], 52.10 fps, 50 tbr, 90k tbn, 100 tbc
    Stream #0.1[0x17e8](deu): Audio: mp2, 48000 Hz, 2 channels, s16, 256 kb/s
    Stream #0.2[0x17e9](mis): Audio: mp2, 48000 Hz, 2 channels, s16, 192 kb/s
    Stream #0.3[0x17eb](qaa): Audio: mp2, 48000 Hz, 2 channels, s16, 192 kb/s
    Stream #0.4[0x17ea](deu): Audio: ac3, 48000 Hz, stereo, s16, 448 kb/s
    Stream #0.5[0x17f2](deu): Subtitle: 0x0006
    Stream #0.6[0x181a]: Data: 0x0005
  Program 11120 

The only thing I found strange and which also causes an issue is the tbc = 100 fps flag
>>50 tbr, 90k tbn, 100 tbc

The beta version of AVIDemux I was testing reported the original M2TS to have 100 fps but the stream is 720p@50 FPS (as specified by the german public TV broadcasters). AVIDemux does not give me an option to "reflag" the output stream to 50 FPS. I guess I will reports this over at the doom9 thread. The 100 FPS issue might be cause by the DVB-S box used. It is a Humax ICord. Unfortunately I have no other h264 streams available to confirm this.

I will cross-test some commercial Windows-based tools such as TS Doctor or Haehnlein-Software's DVR Studio HD. I will report back the results.

Regards,
D$


My archlinux x86_64 host:
AMD E350 (2x1.6GHz) / 8GB DDR3 RAM / GeForce 9500GT (passive) / Arch running from 16GB USB Stick

Offline

#13 2011-01-10 13:53:51

ronnylov
Member
Registered: 2010-12-21
Posts: 65

Re: Question on editing h264 TS -> which tool chain ?

I agree we need a "projectX for h.264"... But maybe we can combine existing tools to get something similar?

I think mplayer has problems displaying timecodes when playing a transport stream. Try using mplayer on your remuxed mkv file (instead of your m2ts file) and you also get the timecodes as in my example above where I can see that most problems appears at the time 790 seconds in the video file. This way I might be able to cut out smaller problem parts from my original mkv file and may get it work better.

I have also switched to ffmpeg for remuxing directly from ts file to mkv file because sometimes tsmuxer does not see the audio tracks. I am using a similar command as you but I have to map audio tracks because I have both mp2 and ac3 audio and sometimes also a dvbsub track (which I don't know how to deal with). If I first demux elementary streams with ffmpeg and remux them with mkvmerge the audio goes out of sync, but if I copy video and audio directly into mkv container with ffmeg then audio became synced with video. I also tried -async 1 option and it did not make it worse. Perhaps ffmpeg adds proper audio delay to the mkv audio tracks? It seems to detect proper audio languages and correct frame rate. Have to check the details with mkvtoolnix...

Anyway I have starting to discover a new world of video tools by using Linux. FFMpeg was a little bit of mystery to me previously but now I start to understand how a nice tool it is. I also have used the video filters included in x264 like selectevery to change 50 fps to 25 fps (since it often is frame doubled original I can save quite much file size without loosing any quality by discarding the repeated frames). I could do this with avisynth and wine but I try to find alternative methods so I can use it also on my server where I do not have a GUI installed and I think wine depends on X11.

Offline

#14 2011-01-10 14:53:35

Darksoul71
Member
Registered: 2010-04-12
Posts: 319

Re: Question on editing h264 TS -> which tool chain ?

I guess a "projectXh264" will be unneccessary if...
a) avidemux 2.6 gets more stable
b) we find a way how to clean those streams either by demuxing or stream copying them.

I think that the "best" approach currently is to use either ffmpeg or mencoder for "cleaning". On my test machine at work (Mint Linux x64) I currently get a dying ffmpeg if I try to do a "stream copy" for a M2TS file. Hm...I'll have to crosscheck on my both Linux systems at home (Ubuntu 10.04 x64 / arch64). I could imagine to hack together a simple "Remux" shell script which displays the streams inside a m2ts file and lets you select the numbers of the streams to remux.

I am pretty confident that the main issue are the errors within the stream (similar to DVB-X streams). Some years ago I mainly captured TV from two DVB-T USB devices and the stream errors were a real PITA. ProjectX solved those though.

FFMpeg was a little bit of mystery to me previously but now I start to understand how a nice tool it is. I also have used the video filters included in x264 like selectevery to change 50 fps to 25 fps (since it often is frame doubled original I can save quite much file size without loosing any quality by discarding the repeated frames). I could do this with avisynth and wine but I try to find alternative methods so I can use it also on my server where I do not have a GUI installed and I think wine depends on X11.

The video tools under Linux compared to their Windows relatives have advantages. ffmpeg and mencoder can easily be used to convert pretty much any format into any format. GUIs such as SUPER, WinFF, Hybrid GUI and so on provide some guidance in using them. On the other hand figuring out a ffmpeg / mencoder commandline for a certain purpose can sometimes consume a lot of time and require a lot of trial'n'error.

Esp. ffmpeg doesn't seem to be so well documented to me. Often options are outdated or you have to spent a lot of time to find working examples.

I still prefer AVISynth filters over the one that ffmpeg / mencoder provide. Unfortunately AVISynth for Linux progresses somewhat slow. On the other hand it is interesting to see Linux tools such as AVIDemux being widely used on Windows (together with AVSProxy plus GUI).

I will report back this evening...

Edit:

I also have used the video filters included in x264 like selectevery to change 50 fps to 25 fps

Oh, this sounds indeed interesting to me. Could you elaborate which commandline you have used for this ? It seems quite logical to me that most 720p50 movie content is simply 720p50 with duplicated frames (I will verify this at home).

Last edited by Darksoul71 (2011-01-10 15:17:18)


My archlinux x86_64 host:
AMD E350 (2x1.6GHz) / 8GB DDR3 RAM / GeForce 9500GT (passive) / Arch running from 16GB USB Stick

Offline

#15 2011-01-11 07:27:09

ronnylov
Member
Registered: 2010-12-21
Posts: 65

Re: Question on editing h264 TS -> which tool chain ?

I got the information of x264 included video filters when reading the output of 'x264 --fullhelp'.
Also see here: http://mewiki.project357.com/wiki/X264_ … deo-filter

I will check my x264 command line back at home but it included select_every:2,0

Offline

#16 2011-01-11 11:56:01

Darksoul71
Member
Registered: 2010-04-12
Posts: 319

Re: Question on editing h264 TS -> which tool chain ?

Hi there,

it would be helpful if you post your x264 commandline...thanks in advance.

A solution similar to the Cut Assistant (http://sourceforge.net/projects/cutassistant/) combined with mkvmerge for splitting the MKV might be the workaround for now. I found AVIDemux V2.6 (the beta version referenced here) a good solution to both being able to scroll fast through the h264 streams and finding out the required timestamps for each I-frame.

mkvmerge would provide the advantage that one can use it both on Linux as well as on Windows.

Just as a short note: My experiments with several Windows-based tools were not very successful and took until 0:30h in the night :-(

It is still somewhat "amazing" that HD material is available so widely (HD cams, DVB-S2, Youtube) but still there are not so many well working solutions (may be beside some professional mucho $$$-editing suites).

Regards,
D$


My archlinux x86_64 host:
AMD E350 (2x1.6GHz) / 8GB DDR3 RAM / GeForce 9500GT (passive) / Arch running from 16GB USB Stick

Offline

#17 2011-01-12 21:40:52

Darksoul71
Member
Registered: 2010-04-12
Posts: 319

Re: Question on editing h264 TS -> which tool chain ?

OK, I found a working combination of tools for my M2TS streams.

Step 1: Open all M2TS streams with AVIDemux 2.6 (fast scrolling) and find out the corresponding cut marks based on I-frames.
Step 2: Demux the tracks required with TSMuxer
Step 3: Use MVKMerge GUI to (re)mux and cut the movie at the same time based on the I-frames of Step 1)

MKVMerge supports the same stuff from CLI but I like the GUI over the shell here.

All five movies I edited yesterday play back fine without hickups.

One thing that is strange though is the size reduction of one movie: Batman begins

The raw files are about 15 GB and after cutting plus remux I end up with a 3.4 GB file. Such a reduction is really strange. Especially since I only cut off something like 10 minutes at start and may be 20 minutes in the end.

ffmpeg -i reports for the raw uncut M2TS the following output:

Seems stream 0 codec frame rate differs from container frame rate: 100.00 (100/1) -> 50.00 (50/1)
Input #0, mpegts, from 'Batman Begins_20101206_2210.ts':
Duration: 08:05:19.58, start: 39800.643767, bitrate: 4188 kb/s
Program 11100 
Program 11110 
Stream #0.0[0x17de]: Video: h264, yuv420p, 1280x720 [PAR 1:1 DAR 16:9], 50 tbr, 90k tbn, 100 tbc
Stream #0.1[0x17e8](deu): Audio: mp2, 48000 Hz, stereo, s16, 256 kb/s
Stream #0.2[0x17e9](mis): Audio: mp2, 48000 Hz, stereo, s16, 192 kb/s
Stream #0.3[0x17eb](qaa): Audio: mp2, 48000 Hz, stereo, s16, 192 kb/s
Stream #0.4[0x17ea](deu): Audio: ac3, 48000 Hz, stereo, s16, 448 kb/s

Beside the strange long duration I see nothing special here. For my edited stream I want to keep 0.0 and 0.4.

After demuxing with tsMuxeR I have a raw h264 stream and an AC3 stream. ffmpeg -i reports this for the raw h264:

Seems stream 0 codec frame rate differs from container frame rate: 100.00 (100/1) -> 50.00 (100/2)
Input #0, h264, from 'Batman Begins_20101206_2210.track_6110.264':
Duration: N/A, bitrate: N/A
Stream #0.0: Video: h264, yuv420p, 1280x720 [PAR 1:1 DAR 16:9], 50 tbr, 1200k tbn, 100 tbc

Well, beside the fact that ffmpeg is unable to determine the right duration for this video everything looks fine to me.

ffmpeg -i for the AC3 stream also does not reveal anything strange here:

Input #0, ac3, from 'Batman Begins_20101206_2210.track_6122.ac3':
Duration: 02:24:48.24, bitrate: 447 kb/s
Stream #0.0: Audio: ac3, 48000 Hz, stereo, s16, 448 kb/s

The stream length looks fine here as well as everything else.

So here are the sizes for all uncut files:
Size Raw M2TS:                 15244732800 Bytes
Size demuxed h264 stream (uncut):    13034338440 Bytes
Size demuxed AC3 stream (uncut):      486541818 Bytes

After "cutting" the stream with mkvmerge GUI the resulting file looks also fine to me and plays back fine as well:

Input #0, matroska, from 'Batman begins-002.mkv':
Duration: 02:05:33.20, start: 0.000000, bitrate: N/A
Stream #0.0: Video: h264, yuv420p, 1280x720, PAR 1:1 DAR 16:9, 50 tbr, 1k tbn, 100 tbc
Stream #0.1(ger): Audio: ac3, 48000 Hz, stereo, s16

The only really strange thing is the size of the final MKV: 3305223122 Bytes

So WTF is happening here: A 13 GB h264 file plus 4 GB AC3 file (minus a few GB for cutting) result in a 3.3GB MKV with full movie length ?

I am completely unshure what has happened here...any ideas ?


My archlinux x86_64 host:
AMD E350 (2x1.6GHz) / 8GB DDR3 RAM / GeForce 9500GT (passive) / Arch running from 16GB USB Stick

Offline

#18 2011-01-12 22:34:01

ronnylov
Member
Registered: 2010-12-21
Posts: 65

Re: Question on editing h264 TS -> which tool chain ?

Here was my x264 commandline to generate AVCHD/Bluray compatible 720P25 from 720P50 input:

x264 --demuxer ffms --seek 0 --frames 2500 --crf 20 --preset slow --tune film --profile high --weightp 1 --bframes 3 --nal-hrd vbr --vbv-maxrate 15000 --vbv-bufsize 15000 --level 4.0 --keyint 50 --b-pyramid strict --open-gop bluray --ref 6 --pulldown double --aud --colorprim "bt709" --transfer "bt709" --colormatrix "bt709" --sar 1:1 --vf select_every:2,0 -o test3.mkv /home/ronny/Demux/Milleniumserien\ -\ Män\ som\ hatar\ kvinnor\,\ Del\ 2\ av\ 6.mkv

By the way I was able to compile x264 with both lavf and ffms support on arch Linux by first installing ffmpeg (without x264 support) and ffmpegsource and then x264 and as a last step recompile ffmpeg with x264 support (I wonder if this is the right way to compile two programs that depends on each other).

Instructions to get ffmpegsource was found here (I got it from svn and compiled manyally):
http://forums.linuxmint.com/viewtopic.p … 74&start=0


Regarding your big m2ts file I am wondering if you may have recorded more than one TV channel simultaneously? I know it is possible to record several channels into one single transport stream. I wonder if you can find any data inside of PROGRAM 11100? But should not ffmpeg detect all included streams? Or perhaps there is some hidden encrypted stuff. Anyway I guess you should be able to save a lot of disc space by remuxing your streams and only keep what you need. But your video bitrate seems rather low for 720P broadcast. I think I have something like 8 - 12 Mbit/s on my source.

I am soing some experiments with automatic commercial removal. I am trying comskip.exe with wine and it seems to work reasonable well for MPEG-2 files at least. There is a version that can read h.264 TS files but you need to donate to get it. But I am thinking it should be possible to reencode to MPEG-2 ata low resolution just to get timecodes for commersial removal from comskip and reapply the edl-file to the original h.264 video file. It is not a big problem yet for me because the only HD-channel I can record is completely free from commercials anyway but I am thinking I might be able to use it for trimming start and end of each show automatically.

Offline

#19 2011-01-13 14:48:29

Darksoul71
Member
Registered: 2010-04-12
Posts: 319

Re: Question on editing h264 TS -> which tool chain ?

Thanks for your h264 commandline !

Regarding your big m2ts file I am wondering if you may have recorded more than one TV channel simultaneously? I know it is possible to record several channels into one single transport stream.

Hm, in theory yes, but after demuxing the streams (AC3 plus h264) there shouldn't be anything left inside the raw h264 stream. I guess one would see multiple video streams inside a M2TS container if you record multiple channels from one transponder. Since I am a "cable-only" guy and got all my M2TS streams from a colleague I am not DVB-S expert by any means.

I wonder if you can find any data inside of PROGRAM 11100? But should not ffmpeg detect all included streams? Or perhaps there is some hidden encrypted stuff. Anyway I guess you should be able to save a lot of disc space by remuxing your streams and only keep what you need.

Hm, TS muxer mentioned some streams which were omitted during opening the original M2TS stream. I can hardly imagine that any hidden encrypted information is still stored in the demuxed h264. Are there any good open-source tools for analysing M2TS and/or h264 streams which produce an output that is understandable for the mortal human ?

May be I am stupid but I didn't understand a thing of the output generated by h264_parse.

But your video bitrate seems rather low for 720P broadcast. I think I have something like 8 - 12 Mbit/s on my source.

Agreed, I calculated the bitrate for Batman begins for my edited video and it is ~ 3.3 MBit/s. On the other hand all three parts of the Bourne Triology which I edited where around 4 to 4.3 GB. This should mean bitrates around 4-5 MBit/s. May be the HD channel of our german public TV sends with lower bitrates ?
Honestly the image is very clear to me. At least Armageddon looks a lot better than from the PAL D1 DVD.

I am soing some experiments with automatic commercial removal. I am trying comskip.exe with wine and it seems to work reasonable well for MPEG-2 files at least. There is a version that can read h.264 TS files but you need to donate to get it. But I am thinking it should be possible to reencode to MPEG-2 ata low resolution just to get timecodes for commersial removal from comskip and reapply the edl-file to the original h.264 video file. It is not a big problem yet for me because the only HD-channel I can record is completely free from commercials anyway but I am thinking I might be able to use it for trimming start and end of each show automatically.

For me editing out any commercials is not an issue because the two channels I could record via cable do not have any commercials in the middle of movies. So I will most likely only cut at start and end of the movie.
=====================================================================================
Edit:
Yes, I found the reason for the shrinking of the stream. Unfortunately this thread is in german but I guess the bitrate viewer picture should be understandable:
http://forum.digitalfernsehen.de/forum/ … trate.html

Here the bitrate of the original TS file of castaway:
castawayorig.png

Here the bitrate of the remuxed MKV file of castaway:
castawaymkv.png

TSDoctor seems to be targeting the same issues:
http://www.cypheros.de/tsdoctor_e.html

...
Up to 70% size reduction without lost in quality and time consuming reencoding for HDTV recordings by simple removing of ballast data (Nalu Filler Data, commercials and unneeded streams).
...

TS Doctor is also able to show the NALU type 12 "Filler Data" ratio for H264 streams.

To my limited understanding (as I am no DVB-S expert): The TV channel network uses Nalu Filler Data (= empty packages) to fill the "rest of available bandwidth" up to 12 MBit if the movie has lower bitrate. In other words: The DVB-S2 stream always has constant 12 MBit/s no matter what bitrate the source has. May be this is required as there is no possibility to dynamically adjust the satellite bandwidth assigned to a channel ?

=====================================================================================
Edith 2: There is even a nalu dump tools:
http://www.udo-richter.de/vdr/naludump.en.html

I will crosscheck this evening. It is obvious that AVIDemux 2.6 doesn't deal with filler nalus since the resulting edited MKV is much bigger (11.2 GB) compared to the one produced with MKVMerge (3.4 GB).

Last edited by Darksoul71 (2011-01-13 15:44:45)


My archlinux x86_64 host:
AMD E350 (2x1.6GHz) / 8GB DDR3 RAM / GeForce 9500GT (passive) / Arch running from 16GB USB Stick

Offline

#20 2011-01-13 16:24:49

ronnylov
Member
Registered: 2010-12-21
Posts: 65

Re: Question on editing h264 TS -> which tool chain ?

Many channels can share the same MUX sent on one frequency. This is valid also for DVB-C. But I did not know the padding was made inside the h.264 stream. Thankyou for your link. I can understand german language because I studied for 2 years. But I am not very good at speaking and write in German. But maybe I am better understanding German than you are understanding Swedish... So it seems to be extra padding of dummy data is used toto fill upp unused space to deliver a constant bitrate stream (probably some technical transmission requirement).

Anyway I have not seen this on my recordings. The mkv file is a little bit smaller because but not more than maybe 10%. On the other hand I think SVT or Comhem send with almost constant bitrate h.264 (it does not change much over time).

So how do you find start and end of movies? I guess you have to scroll through them manually. I want to shave off some bits by cutting this automatically if possible. My dream is that my HTPC record, trim start and end, remove commercials and repacks the recording to nice mkv files automatically. If I want to keep it I could send them to the file server and let it transcode them to a final format like DVD or x264. I takes too much time doing it manually. Or at least reduce the number of steps to do it. Maybe open up the recoded movie in an editor which have detected what it think may be start and end of movie and commercials and only have to quickly verify it before pressing the GO button...

Offline

#21 2011-01-13 16:51:48

Darksoul71
Member
Registered: 2010-04-12
Posts: 319

Re: Question on editing h264 TS -> which tool chain ?

But maybe I am better understanding German than you are understanding Swedish...

You can bet on since my Swedish is simply non-existing smile

So how do you find start and end of movies?

I use AVIDemux 2.6 (the Windows version with WINE) to determine the start and end I-frame. By using the hotkeys cursor up and down you can jump back and forth based on I-frames. For faster scrolling I use the video slider. The major time is consumed by AVIDemux building up an index file but I guess this is the only way for fast scrolling through the video (similar to dgaindex).

BTW: I have compile naludump (depends on libjpeg) and will do some tests.

Edit:
OK, short update....naludump reports lots of errors both on the original M2TS stream as well as on the remuxed M2TS stream (with TSMuxer).
It simply dies with a target file with around 100 MB.

cNaluDumper: TS continuity offset 11
ERROR: skipped 558 bytes to sync on start of TS packet
ERROR: skipped 34 bytes to sync on start of TS packet
cNaluDumper: TS continuity offset 10
ERROR: skipped 11144 bytes to sync on start of TS packet
cNaluDumper: TS continuity offset 5
ERROR: skipped 26116 bytes to sync on start of TS packet
cNaluDumper: TS continuity offset 8
ERROR: skipped 13935 bytes to sync on start of TS packet
ERROR: skipped 25472 bytes to sync on start of TS packet
ERROR: skipped 24999 bytes to sync on start of TS packet
ERROR: skipped 42178 bytes to sync on start of TS packet
Packets: 551495 Dropped: 4878 (0%)

I am currently demuxing the source M2TS and will naludumper on the demuxed h264 file.

Last edited by Darksoul71 (2011-01-13 17:14:40)


My archlinux x86_64 host:
AMD E350 (2x1.6GHz) / 8GB DDR3 RAM / GeForce 9500GT (passive) / Arch running from 16GB USB Stick

Offline

#22 2011-01-13 19:27:35

Darksoul71
Member
Registered: 2010-04-12
Posts: 319

Re: Question on editing h264 TS -> which tool chain ?

Ok, short update:
naludump (at least the version I compiled) is useless. It gives error like this:

ERROR: skipped 65348 bytes to sync on start of TS packet
ERROR: skipped 26256 bytes to sync on start of TS packet

It dies for all files I tried:
- Native M2TS direct from DVB-S box
- Remuxed M2TS (with TSMuxer GUI)
- Demuxed h264 stream (with TSMuxer)

I'll contact the author on this.

Just for size comparision:
Raw h264 demuxed with TSMuxer is 12.1 GB big
The same h264 "converted" into a MKV with MKVMerge is only 3.6 GB big.

Last edited by Darksoul71 (2011-01-13 19:28:13)


My archlinux x86_64 host:
AMD E350 (2x1.6GHz) / 8GB DDR3 RAM / GeForce 9500GT (passive) / Arch running from 16GB USB Stick

Offline

#23 2011-01-14 23:28:12

ronnylov
Member
Registered: 2010-12-21
Posts: 65

Re: Question on editing h264 TS -> which tool chain ?

OK, so the size is shrinked when muxing to mkv with mkvmerge.
Then mkvmerge is stripping the empty data away and all is good.
Does it matter if you convert to mkv directly with FFMPEG or is it mkvmerge that does the job?
Or maybe there is a difference if you demux with tsmuxer instead of ffmpeg?

I wonder if maybe I can also strip off empty data or perhaps my stream is different?
Because I can not get this kind of data reduction without reencoding with x264.
But maybe I have missed some step. I can check your link to the german forum and see what they say.

I remember when I used TMPGEnc in the early 2000's for MPEG-2 encoding there was a setting to add this kind of "padding" when encoding.

I found a tool called dvbsnoop in AUR but it did not compile on my 64-bit Arch Linux, it complained it was not compatible with x86_64... It should be able to do some analyzing on TS streams with this tool.

Offline

#24 2011-01-15 12:17:53

Darksoul71
Member
Registered: 2010-04-12
Posts: 319

Re: Question on editing h264 TS -> which tool chain ?

Sorry if I do not use the quote method now but it goes quicker:

>Does it matter if you convert to mkv directly with FFMPEG or is it mkvmerge that does the job?
Yes it matters ! Only mkvmerge does the job. If I use ffmpeg for mkv stream copy the resulting MKV will be nearly as big as the orginal M2TS (beside the audio streams I removed).

>Or maybe there is a difference if you demux with tsmuxer instead of ffmpeg?
No, both tsmuxer and ffmpeg do not care about the NALU filler packages.

>I wonder if maybe I can also strip off empty data or perhaps my stream is different?
>Because I can not get this kind of data reduction without reencoding with x264.
I guess your streams are simple not filled as much as "mine" with filler NALUs. I guess TSDoctor is able to show the ratio between real video data and NALU filler packages.

You can clearly see the result in any h264 capable bitrate viewer. Demux one of your M2TS streams and remux the h264 video stream without any further processing into a MKV file with MKVMerge. If the bitrate curve of the MKV looks much different to the curve of your M2TS then you have filler NALUs there. If they look identical then be happy: Your TV network has high bitrate material.

For german ARD and ZDF HD I am not shure wether they recompress movies on the fly or simply send low bitrate material which they got from the big movie companies. Since I do not work for a TV station I can not tell smile

Do you think a wiki entry makes sense ?

I am not shure...esp. since no-one beside you seems interested in processing h264 here.

Edit:
I tried dvbsnoop on my Ubuntu 10.10 x64 system and it simply died after some similar messages to naludump:
>Omitting XXX bytes of TS packages to keep in sync
bla...bla...freezing xterm plus steady increasing CPU load. I killed the process then big_smile

Last edited by Darksoul71 (2011-01-15 12:21:25)


My archlinux x86_64 host:
AMD E350 (2x1.6GHz) / 8GB DDR3 RAM / GeForce 9500GT (passive) / Arch running from 16GB USB Stick

Offline

Board footer

Powered by FluxBB