Avidemux Forum

Avidemux => Main version 2.6 => Topic started by: peterrabbit on October 22, 2016, 06:13:02 PM

Title: No video when copying MTS file
Post by: peterrabbit on October 22, 2016, 06:13:02 PM
Running 64-bit Windows 10. I have a large MTS file (4GB) that I need to extract 10 minutes of video from. File says Lavcodec=RGB, Codec 4CC=H264, 29.970 frame rate, 1440x1080 image size. I can view/mark for editing in Avidemux with no problems.

1. When I try to output using Copy option and any output format I get good audio, but only a partial second of good video, then snow. Takes less than two minutes, but unusable results.
2. If I change video output to Mpeg4 AVC (H264), I get good video, but the coding will take two hours, which is worse than even Movie Maker.

Any ideas/suggestions to get good output in a short time frame?
Title: Re: No video when copying MTS file
Post by: eumagga0x2a on October 22, 2016, 08:04:34 PM
Please specify the version of Avidemux you are using. If the most current nightly build fails to save the video in copy mode correctly too (you do set the markers A and B to keyframes, don't you?), please provide a sample (as short as possible, as long as necessary) e.g. via WeTransfer (no password, no email, just a link). See http://avidemux.org/smif/index.php/topic,17167.msg77211.html#msg77211 (http://avidemux.org/smif/index.php/topic,17167.msg77211.html#msg77211) for a possible tool for this task.
Title: Re: No video when copying MTS file
Post by: peterrabbit on October 23, 2016, 06:21:22 PM
using latest - 2.6.14. I set markers A & B and the output audio and brief frame or two of video I see reflects that. can't provide a sample as it is FOUO.
Title: Re: No video when copying MTS file
Post by: eumagga0x2a on October 24, 2016, 10:14:44 AM
Quote from: peterrabbit on October 23, 2016, 06:21:22 PM
using latest - 2.6.14. I set markers A & B

Do you set them at keyframes or not at keyframes? Have you tried different locations in the source video?

Quoteand the output audio and brief frame or two of video I see reflects that. can't provide a sample as it is FOUO.

Please provide at least the output of ffprobe (preferably) or MediaInfo both for the source file as well for the saved not working video (you may replace the file name), though I don't think much can be done without a sample.

QuoteWhen I try to output using Copy option and any output format I get good audio, but only a partial second of good video, then snow.

"Snow" is not what you get with damaged video streams in Avidemux. Is Avidemux unable to play the video is has saved?

Title: Re: No video when copying MTS file
Post by: peterrabbit on October 24, 2016, 08:32:54 PM
I can view/mark for editing in Avidemux with no problems.
Title: Re: No video when copying MTS file
Post by: eumagga0x2a on October 24, 2016, 08:45:29 PM
I'm somewhat unsure if there was no misunderstanding: I knew that Avidemux can play the source file, therefore I asked if Avidemux (and a reasonable software video player like mpv or vlc) were able to play that approx. 10 minutes long excerpt you have saved.
Title: Re: No video when copying MTS file
Post by: peterrabbit on October 25, 2016, 03:21:16 PM
sorry I misunderstood. Both Avidemux and VLC can open the excerpts and play, but video is distorted. Can see more of the video than with Media Player, etc but is unusable.
Title: Re: No video when copying MTS file
Post by: peterrabbit on October 25, 2016, 03:26:35 PM
just tried clipping first 10 minutes of video. first several seconds of this excerpt are clear, then slowly degrades to totally unusable.
Title: Re: No video when copying MTS file
Post by: eumagga0x2a on October 25, 2016, 04:05:49 PM
Have you tried a nightly? Does this happen if you clip not from the start but from somewhere else too? Could you please provide a sanitized admlog.txt file (search and replace all sensitive information like file name or full path with placeholders) and the output of ffprobe or MediaInfo for both the source and the excerpt? This is still unlikely that anything can be done about it without a sample, but without more in-depth information it is even less likelier.
Title: Re: No video when copying MTS file
Post by: peterrabbit on October 25, 2016, 05:09:37 PM
I apologize for being so naïve. My first clip was in the middle of the file, the second at the start.
1. what is a nightly?
2. how do I create admlog.txt and where would I find it?
3. I will install one of those programs and post reply.
Title: Re: No video when copying MTS file
Post by: eumagga0x2a on October 25, 2016, 05:30:43 PM
Quote from: peterrabbit on October 25, 2016, 05:09:37 PM
My first clip was in the middle of the file, the second at the start.

This means, it doesn't depend on the entry point.

Quotewhat is a nightly?

A nightly is built from the current git master (https://github.com/mean00/avidemux2) and reflects the current state of the developement (even if it is regarded Alpha, it has much less bugs than 2.6.14 and a newer FFmpeg at the core).

edit: you can download nightly builds from http://avidemux.org/nightly/ (http://avidemux.org/nightly/)

Quotehow do I create admlog.txt and where would I find it?

Look into the Help menu. Reading https://www.avidemux.org/admWiki/doku.php?id=general:bugtracker (https://www.avidemux.org/admWiki/doku.php?id=general:bugtracker) could be helpful too.
Title: Re: No video when copying MTS file
Post by: peterrabbit on October 26, 2016, 04:55:20 PM
sorry for the delay. have surgery planned Friday and have been preparing for that. here is the mediainfo file. will do more later.

just attached admlog
Title: Re: No video when copying MTS file
Post by: eumagga0x2a on October 26, 2016, 05:42:53 PM
Thanks, the admlog.txt includes just the initialisation sequence and nothing from loading and saving video, so it is worthless, unfortunately. Could you give it another try?

From the MediaInfo output the part

Format                                   : BDAV
Format/Info                              : Blu-ray Video
File size                                : 3.99 GiB
Duration                                 : 1 h 39 min
Overall bit rate mode                    : Variable
Overall bit rate                         : 5 721 kb/s
Maximum Overall bit rate                 : 18.0 Mb/s

Video
ID                                       : 4113 (0x1011)
Menu ID                                  : 1 (0x1)
Format                                   : AVC
Format/Info                              : Advanced Video Codec
Format profile                           : High@L4
Format settings, CABAC                   : Yes
Format settings, ReFrames                : 4 frames
Format settings, GOP                     : M=3, N=15
Codec ID                                 : 27
Duration                                 : 1 h 39 min
Bit rate mode                            : Variable
Bit rate                                 : 5 229 kb/s
Maximum bit rate                         : 16.8 Mb/s
Width                                    : 1 440 pixels
Height                                   : 1 080 pixels
Display aspect ratio                     : 16:9
Frame rate                               : 29.970 (30000/1001) FPS
Color space                              : YUV
Chroma subsampling                       : 4:2:0
Bit depth                                : 8 bits
Scan type                                : Interlaced
Scan type, store method                  : Separated fields
Scan order                               : Top Field First
Bits/(Pixel*Frame)                       : 0.112
Stream size                              : 3.65 GiB (91%)


shows that the video is interlaced. I wonder if this matters...

All the best for your surgery and recovery.
Title: Re: No video when copying MTS file
Post by: peterrabbit on October 27, 2016, 02:12:16 AM
updated admlog.txt. Had to remove the last several thousand lines to upload. can extract other lines if needed.
Title: Re: No video when copying MTS file
Post by: eumagga0x2a on October 27, 2016, 08:45:35 AM
Thank you (compressing admlog.txt would have allowed to upload the entire file though), I hope Mean will find time to look at the Avidemux log, especially the following spots might be helpful IMVHO:

[TsDemuxerer] Reading Video
[TsIndex] codec :<H264>
[indexFile] Token ExtraData not found
  [0]Version
  [1]Type
  [2]File
  [3]Append
  [4]Width
  [5]Height
  [6]Fps
  [7]Interlaced
  [8]AR
  [9]Pid
  [10]VideoCodec
[tsDemux] Video pid is 0x1011 4113
[psDemuxer] Reading Audio
00:fq=48000
00:br=32000
00:chan=2
00:codec=8192
00:pid=4352
00:muxing=0
Language=unknown
[indexFile] Token Track0.extraData not found
  [0]Version
  [1]Type
  [2]File
  [3]Append
  [4]Width
  [5]Height
  [6]Fps
  [7]Interlaced
  [8]AR
  [9]Pid
  [10]VideoCodec
  [11]Tracks
  [12]Track0.pid
  [13]Track0.codec
  [14]Track0.fq
  [15]Track0.chan
  [16]Track0.br
  [17]Track0.muxing
  [18]Track0.language
[readAudio] No extradata (Track0.extraData)
Checking if there are several files...
No.

Simple loading:
file: ***************.MTS, size: 4288425984
found 1 files
Done
[TsPacket] Detecting TS/TS2...
[TsPacket] Score : 188:1, 192:20 out of 20
[TsPacket] Probably TS2 (192)...
[ADM_tsAccess] Creating audio track, pid=1100, muxing =0
[TsDemuxerer] Reading index
[TsDemuxer] Found 0 I, 239637 B, 107838 P
[TsH264] Found 11982 IDR
[TsH264] Remapping IDR to I and I TO P
[psDemux] Fps not handled for DTS increment
[tsDemux] Found 359457 video frames


[addFile] [Editor] This is H264, check if we can fill missing PTS
[ADM_setH264MissingPts] We have 179728 missing PTS
[ADM_setH264MissingPts] Some PTS are missing, try to guess them...
[ADM_setH264MissingPts] H264 AVC scheme: 0/179728 failures.
[ADM_setH264MissingPts] Filling 2nd field PTS
[ADM_setH264MissingPts] Fixed 0 PTS
[ADM_setH264MissingPts] There is more than 5% unavailable PTS, wont even try (179728/359457)...
[ADM_setH264MissingPts] End of game, we have 179728 missing PTS


It looks like second fields don't have PTS (presentation time stamp) and ADM_setH264MissingPts in avidemux/common/ADM_editor/src/utils/ADM_edPtsDts.cpp gives up:

[FF] Saving
[saveLoop] avg fps=29970
[initUI] Muxer, creating UI, video duration is 00:20:46,245
Paint event
Paint event
[getCompressedPicture] Final DTS <0, dropping it
[getCompressedPicture] Compensating for rounding error with PTS=33366ms DTS=66732ms
Paint event
Paint event
[getCompressedPicture] Final DTS <0, dropping it
[getCompressedPicture] Compensating for rounding error with PTS=66733ms DTS=133464ms
[getCompressedPicture] Final DTS <0, dropping it
[getCompressedPicture] Frame 7 DTS is going back in time : expected:00:00:00,200 [getCompressedPicture] got:00:00:00,100 (200196 vs 100100)
[getCompressedPicture] Final DTS <0, dropping it
[getCompressedPicture] Compensating for rounding error with PTS=133466ms DTS=233562ms
[getCompressedPicture] Final DTS <0, dropping it
[getCompressedPicture] Compensating for rounding error with PTS=166833ms DTS=300294ms
[getCompressedPicture] Final DTS <0, dropping it
[getCompressedPicture] Frame 13 DTS is going back in time : expected:00:00:00,367 [getCompressedPicture] got:00:00:00,200 (367026 vs 200200)
[getCompressedPicture] Final DTS <0, dropping it
[getCompressedPicture] Compensating for rounding error with PTS=233566ms DTS=400392ms
[getCompressedPicture] Final DTS <0, dropping it
[getCompressedPicture] Compensating for rounding error with PTS=266933ms DTS=467124ms
[getCompressedPicture] Final DTS <0, dropping it
[getCompressedPicture] Frame 19 DTS is going back in time : expected:00:00:00,533 [getCompressedPicture] got:00:00:00,300 (533856 vs 300300)
[getCompressedPicture] Final DTS <0, dropping it
[getCompressedPicture] Compensating for rounding error with PTS=333666ms DTS=567222ms
[getCompressedPicture] Final DTS <0, dropping it
[getCompressedPicture] Compensating for rounding error with PTS=367033ms DTS=633954ms
[getCompressedPicture] Final DTS <0, dropping it
[getCompressedPicture] Frame 25 DTS is going back in time : expected:00:00:00,700 [getCompressedPicture] got:00:00:00,400 (700686 vs 400400)
[getCompressedPicture] Final DTS <0, dropping it
[getCompressedPicture] Compensating for rounding error with PTS=433766ms DTS=734052ms
[getCompressedPicture] Final DTS <0, dropping it
[getCompressedPicture] Compensating for rounding error with PTS=467133ms DTS=800784ms
[getCompressedPicture] Final DTS <0, dropping it
[getCompressedPicture] Frame 31 DTS is going back in time : expected:00:00:00,867 [getCompressedPicture] got:00:00:00,500 (867516 vs 500500)
[getCompressedPicture] Final DTS <0, dropping it
[getCompressedPicture] Compensating for rounding error with PTS=533866ms DTS=900882ms
[getCompressedPicture] Final DTS <0, dropping it
[getCompressedPicture] Compensating for rounding error with PTS=567233ms DTS=967614ms
[getCompressedPicture] Final DTS <0, dropping it
[getCompressedPicture] Frame 37 DTS is going back in time : expected:00:00:01,034 [getCompressedPicture] got:00:00:00,600 (1034346 vs 600600)


(for each 6th frame). Last messages originate from ADM_edVideoCopy.cpp.

Could you just give ffmpeg a try?

ffmpeg -i path\to\your\file\filename.mts -t 00:10:00 -c copy path\to\output\filename.mkv

should save the first 10 minutes of video to filename.mkv. Maybe ffmpeg copes better with this source video.