Menu

#55 Failed to mux mp4 (AVC codec) to mpeg-ts

2.6.11
accepted
Mean
None
1
2015-10-26
2015-10-24
No

Fault in version 2.6.9 and in previous versions.
Fails to mux from mp4 (AVC codec) to mpeg-ts, no video present only audio. The AVC codec has so many variations but it seems to fail on any that I try.

So here is an example video info on a file that I try:

Video
ID                                       : 1
Format                                   : AVC
Format/Info                              : Advanced Video Codec
Format profile                           : High@L3.1
Format settings, CABAC                   : Yes
Format settings, ReFrames                : 2 frames
Codec ID                                 : avc1
Codec ID/Info                            : Advanced Video Coding
Duration                                 : 34s 659ms
Bit rate                                 : 3 556 Kbps
Width                                    : 1 280 pixels
Height                                   : 720 pixels
Display aspect ratio                     : 16:9
Frame rate mode                          : Variable
Frame rate                               : 29.747 fps
Minimum frame rate                       : 28.626 fps
Maximum frame rate                       : 371.901 fps
Color space                              : YUV
Chroma subsampling                       : 4:2:0
Bit depth                                : 8 bits
Scan type                                : Progressive
Bits/(Pixel*Frame)                       : 0.130
Stream size                              : 14.7 MiB (96%)
Writing library                          : x264 core 130 r2273 b3065e6
Encoding settings                        : cabac=1 / ref=2 / deblock=1:0:0 / analyse=0x3:0 / me=hex / subme=6 / psy=1 / psy_rd=1.00:0.00 / mixed_ref=0 / me_range=16 / chroma_me=1 / trellis=0 / 8x8dct=1 / cqm=0 / deadzone=21,11 / fast_pskip=1 / chroma_qp_offset=-4 / threads=3 / lookahead_threads=1 / sliced_threads=0 / nr=0 / decimate=1 / interlaced=0 / bluray_compat=0 / constrained_intra=0 / bframes=2 / b_pyramid=0 / b_adapt=0 / b_bias=0 / direct=1 / weightb=0 / open_gop=0 / weightp=0 / keyint=50 / keyint_min=25 / scenecut=40 / intra_refresh=0 / rc_lookahead=40 / rc=crf / mbtree=1 / crf=20.0 / qcomp=0.60 / qpmin=6 / qpmax=69 / qpstep=4 / ip_ratio=1.40 / aq=1:1.00
Encoded date                             : UTC 2015-01-25 18:10:13
Tagged date                              : UTC 2015-01-25 18:11:01
Color primaries                          : BT.709
Transfer characteristics                 : BT.709
Matrix coefficients                      : BT.709
Color range                              : Limited

Audio
ID                                       : 2
Format                                   : AAC
Format/Info                              : Advanced Audio Codec
Format profile                           : LC
Codec ID                                 : 40
Duration                                 : 34s 837ms
Bit rate mode                            : Variable
Bit rate                                 : 128 Kbps
Maximum bit rate                         : 132 Kbps
Channel(s)                               : 2 channels
Channel positions                        : Front: L R
Sampling rate                            : 48.0 KHz
Compression mode                         : Lossy
Stream size                              : 544 KiB (3%)
Title                                    : Stereo
Language                                 : English
Encoded date                             : UTC 2015-01-25 18:10:13
Tagged date                              : UTC 2015-01-25 18:11:00

And here is the errors in the log:
[TS Demuxer] Probing...
[checkMarker] [Ts Demuxer] Sync ok :11 Sync ko :3921
[checkMarker] [Ts Demuxer] Sync ok :14 Sync ko :3919
[detectTs] [TS Demuxer] Not a TS file
[TS Demuxer] Not a ts file
[flvHeader] Cannot open that
[mkvHeader] Cannot open that
Match ftyp
[MP4]MP4/MOV/3GP file detected...
[mxfHeader] Cannot open that (1c000000)
[openDML] Cannot open that
[picHeader] Cannot open that
[asfHeader] Cannot open that
match :0 / 455 (probeSize:1048576)
[PS Demuxer] Not a ps file
opening 3gpp files Analyzing file and atoms
Warning: scale is not in ms 90000!
Parsing Track
<<Parsing Mdia="">>
[HDLR]
hdlr video found
<<Parsing Stbl="">>
[STSD] VIDEO avc1, size 173
[STSD] vendor
[STSD] width :1280
[STSD] height :720
[STSD] datasize :0
[STSD] FrameCount :1
Codec string :14 <JVT AVC="" Coding="">
LEFT:85
Reading avcC, got avcC
avcC size:45
avcC Revision :1
avcC AVCProfileIndication :64
avcC profile_compatibility:0
avcC AVCLevelIndication :1f
avcC lengthSizeMinusOne :ff
avcC NumSeq :e1
avcC sequenceParSetLen :1c
0000 : gd..¬Ó.@.ì.¨.... 67 64 00 1f ac d3 01 40 16 ec 05 a8 08 08 0a 00
0010 : ......~@.0bp 00 03 00 02 00 05 7e 40 1e 30 62 70
avcC numOfPictureParSets :1
avcC Pic len :6

0000 : .hꁱ2 06 68 ea 81 b1 32stts:0
Time stts atom found (961)
Using myscale 90000
0 frames /1031 nbsz..
nbCo: 225
ctts:0
Found 1031 elements
Stss:21
[indexify] Build Track index
Index done
[parseStbl] Movie duration = 34659
[parseStbl] # images = 1031
[parseStbl] Avg fps 29746.962891
[updateCtts] [MP4]** Updating CTTS ****
[parseTrack] EDTS atom found
[parseEdts] Parsing Edts>>
[parseEdts] ELST atom found
[parseElst] Found 1 entries in list:
[parseElst] Duration : 3119324, mediaTime:242 speed=65536
[parseElst]
Audio Tracks need to be delayed , 242 vs trackscale 90000
[parseElst] ** Computed delay =00:00:00,002
Parsing Track
<<Parsing Mdia="">>
[HDLR]
hdlr audio found
<<Parsing Stbl="">>
[STSD] AUDIO <mp4a>, 0x6d703461, size 87
[STSD]Revision :0
[STSD]Vendor :
[STSD]Channels :2
[STSD]Bit per sample :16
[STSD]Encoding :0
[STSD]Packet size :0
[STSD]Fq:48000
[STSD]Fq :48000
Bytes left : 51
[STSD] chan:2 bpp:16 encoding:0 fq:48000 (left 51)

got esds atom
[MP4]Esds atom found
Tag : 3 Len : 34
ES_Desc
Tag : 4 Len : 20
DecConfigDesc : Tag 64
Tag : 5 Len : 2
DecSpecicInfo
Esds for audio
2 bytes of extraData
[refineAudio] Audio track is AAC, checking it...
stts:0
Time stts atom found (1)
Using myscale 48000
0 frames /1633 nbsz..
nbCo: 234
Cur audio track :0
[indexify] Build Track index
[splitAudio] No very large blocks found, 557489 bytes present over 1633 blocks
Index done
Indexed audio, nb blocks:0
Indexed audio, nb blocks:1633 (final)
Done finding main atoms

[adjustElstDelay] Compensating for a/v delay
0x1190 word, Channel : 2, fqIndex=3
[refineFps] MinDelta=2688 us
[refineFps] Computed fps1000=372023
[refineFps] Adjusting fps, the computed is higher than average, dropped frames ?
[open] 3gp/mov file successfully read..
[open] Nb images : 1031
[open] Movie duration : 00:00:34,659
[open] Last video PTS : 00:00:34,627
[open] Last video DTS : 00:00:34,627
[Editor]The video codec has some extradata (45 bytes)

0000 : .d..ÿá..gd..¬Ó.@ 01 64 00 1f ff e1 00 1c 67 64 00 1f ac d3 01 40
0010 : .ì.¨..........~@ 16 ec 05 a8 08 08 0a 00 00 03 00 02 00 05 7e 40
0020 : .0bp...hꁱ2. 1e 30 62 70 01 00 06 68 ea 81 b1 32 13
[ADM_PP] Initializing postproc
[cleanup] Deleting post proc
[update] updating post proc
[update] Disabled
[addFile] Clearing video filters
[ADM_vf_clearFilters] clear filters
[ADM_ad_plugin]Format 0xff : probing libADM_ad_a52.dll score 0
[ADM_ad_plugin]Format 0xff : probing libADM_ad_faad.dll score 100
[ADM_ad_plugin]Format 0xff : probing libADM_ad_ima_adpcm.dll score 0
[ADM_ad_plugin]Format 0xff : probing libADM_ad_lav.dll score 50
[ADM_ad_plugin]Format 0xff : probing libADM_ad_Mad.dll score 0
[ADM_ad_plugin]Format 0xff : probing libADM_ad_ms_adpcm.dll score 0
[ADM_ad_plugin]Format 0xff : probing libADM_ad_opencore_amrnb.dll score 0
[ADM_ad_plugin]Format 0xff : probing libADM_ad_opencore_amrwb.dll score 0
[ADM_ad_plugin]Format 0xff : probing libADM_ad_ulaw.dll score 0
[ADM_ad_plugin]Format 0xff : probing libADM_ad_vorbis.dll score 0
[initFaad] [FAAD] using 2 bytes of extradata
[initFaad] 11 [initFaad] 90 [initFaad]
[initFaad] [FAAD]Found :48000 rate 2 channels
[ADM_faad] [FAAD]Faad decoder created
[ADM_edAudioTrackFromVideo] Creating edAudio from video track 0 at 46e4a70
[Editor] Decoder FCC: H264 (34363248)[ADM_getDecoder]
Searching decoder in plugins
[tryCreatingVideoDecoder] No decoder found in plugin
[ADM_getDecoder] Searching decoder in coreVideoCodec(1280 x 720, extradataSize:45)...
[ADM_coreCodecGetDecoder] Searching decoder in coreVideoCodec(1280 x 720, extradataSize:45)...
[lavc] Build: 3676772
[decoderFFH264] [lavc] Initializing H264 decoder with 45 extradata
[adm_lavLogCallback] [lavc] The 'vismv' option is deprecated, see the codecview filter instead.
[lavc] Decoder init: CODEC_ID_H264 video decoder initialized! (H.264 / AVC / MPEG-4 AVC / MPEG-4 part 10)
[addReferenceVideo] [editor] Original frame increment 00:00:00,002
[addReferenceVideo] [Editor] min increment 00:00:00,002
[addReferenceVideo] [Editor] max increment 00:00:00,034
[addReferenceVideo] [Editor] About 2687 microseconds per frame
[addReferenceVideo] The first frame has a PTS >0, adjusting to 2 ms
[updateStartTime] Using pts2=00:00:00,002 to get dts, as this video does not start at zero
[ADM_verifyDts] Verifying DTS....
[ADM_verifyDts] Checking from 1 to 1031
[ADM_verifyDts] Pass 2..
[ADM_verifyDts] DTS verified
[Editor] B- frame possible with that codec
[addFile] [Editor] This is H264, check if we can fill missing PTS
[ADM_setH264MissingPts] We have 0 missing PTS
[addFile] H264 in mp4 sometimes has invalid timestamps which confuse avidemux, checking
[convertLinearTimeToSeg] Frame time=0, taking first segment
[goToTimeVideo] Fixating start time to 2 ms
[seektoTime] First frame of the new segment is a keyframe at 2ms
[DecodePictureUpToIntra] DecodeUpToInta 0 ref:0
[edCache] Flush
[decompressImage] uncompress failed
[DecodePictureUpToIntra] decode error for frame 0, not necessarily a problem
[goToTimeVideo] Seek done, in reference, gone to 2688 with segment start at 0
[checkForValidPts] Checking file for broken PTS...
[checkForValidPts] Checking 100 frames out of 1031.
[convertLinearTimeToSeg] Frame time=0, taking first segment
[goToTimeVideo] Fixating start time to 2 ms
[seektoTime] First frame of the new segment is a keyframe at 2ms
[DecodePictureUpToIntra] DecodeUpToInta 0 ref:0
[edCache] Flush
[decompressImage] uncompress failed
[DecodePictureUpToIntra] decode error for frame 0, not necessarily a problem
[goToTimeVideo] Seek done, in reference, gone to 2688 with segment start at 0
[checkForValidPts] -------- Stats :----------
[checkForValidPts] nbBFrames:64
[checkForValidPts] nbPFrames:34
[checkForValidPts] nbIFrames:2
[checkForValidPts] nbNoImage:0
[checkForValidPts] nbPtsgoingBack:0
[checkForValidPts] -------- /Stats ----------
[convertLinearTimeToSeg] Frame time=0, taking first segment
[goToTimeVideo] Fixating start time to 2 ms
[seektoTime] First frame of the new segment is a keyframe at 2ms
[DecodePictureUpToIntra] DecodeUpToInta 0 ref:0
[edCache] Flush
[decompressImage] uncompress failed
[DecodePictureUpToIntra] decode error for frame 0, not necessarily a problem
[goToTimeVideo] Seek done, in reference, gone to 2688 with segment start at 0
[checkForDoubledFps] Checking for doubled FPS.., time increment ceiling = 4836
[checkForDoubledFps] Checking DTS...
[checkTiming] Good : 1028
[checkTiming] Bad : 2
[checkForDoubledFps] Checking PTS...
[checkTiming] Good : 1029
[checkTiming] Bad : 1
[checkForDoubledFps] Cannot halve fps
[renderDisplayResize] Render to 1280x720 zoom=1
[spawnRenderer] Using simple renderer
[simpleRender] creating simple render.
[init] init, simple render. w=1280, h=720,zoom=1
[RDR] Resizing to 640 x 360
[renderCompleteRedrawRequest] RedrawRequest
[A_ResetMarkers] Video Total duration : 00:00:34,659 ms
[rewind] Rewinding
[switchToSegment] Trying to switch to seg 0 with startTime in reference pic= 0 ms
[seektoTime] First frame of the new segment is a keyframe at 2ms
[DecodePictureUpToIntra] DecodeUpToInta 0 ref:0
[edCache] Flush
[decompressImage] uncompress failed
[DecodePictureUpToIntra] decode error for frame 0, not necessarily a problem
[switchToSegment] Switched ok to segment 0 (dontdecode=0)
[start] admPreview,starting
[updateLoaded] conf updated
[HandleAction] *** SAVE_VIDEO *****
[admSaver] [Save] Encoder index=0
[save] Audio starting time 00:00:00,000
[save] [A_Save] Saving..
[checkCutsAreOnIntra] Checking cuts start on keyframe..
[switchToSegment] Trying to switch to seg 0 with startTime in reference pic= 0 ms
[seektoTime] First frame of the new segment is a keyframe at 2ms
[seektoTime] Seek to time without decoding ok
[switchToSegment] Switched ok to segment 0 (dontdecode=1)
[checkCutsAreOnIntra] seg:0 refDTS=0
[checkCutsAreOnIntra] seg:0 imgDTS=0
[checkCutsAreOnIntra] Ignoring first seg (unreliable DTS)
[checkCutsAreOnIntra] Segment 0 ok
[setupVideo] The video stream is H264
[setupVideo] The muxer prefers AnnexB H264 bitstream
[ADM_videoStreamCopy] Creating copy video stream, start time=0.00 s
[getPKFramePTS] This video does not start at 0 but at 2 ms, compensating
[ADM_videoStreamCopy] PTS/DTS delta=2688 us
[ADM_videoStreamCopy] Fixating start time by 0
[ADM_videoStreamCopy] Starting DTS=0, PTS=2 ms
[goToTime] go to time 0.00 secs
[convertLinearTimeToSeg] Frame time=0, taking first segment
[goToTime] => seg 0, rel time 0.00 secs
[resetAfterSeek] Resetting faad
[initFaad] [FAAD] using 2 bytes of extradata
[initFaad] 11 [initFaad] 90 [initFaad]
[initFaad] [FAAD]Found :48000 rate 2 channels
[MP4] Go to time succeeded chunk :0 time ask:0 time get:2
[setupAudio] Setting up 1 audio track(s)
[setupAudio] [audioTrack 0] Creating audio encoding stream, starttime 00:00:00,000(copy)
[audioCreateCopyStream] Creating audio stream copy with compensation : startTime=00:00:00,000
[audioCreateCopyStream] and shift =00:00:00,000
[ADM_audioStreamCopy] Creating copy stream, startTime=00:00:00,000, shift=0
[goToTime] go to time 0.00 secs
[convertLinearTimeToSeg] Frame time=0, taking first segment
[goToTime] => seg 0, rel time 0.00 secs
[resetAfterSeek] Resetting faad
[initFaad] [FAAD] using 2 bytes of extradata
[initFaad] 11 [initFaad] 90 [initFaad]
[initFaad] [FAAD]Found :48000 rate 2 channels
[MP4] Go to time succeeded chunk :0 time ask:0 time get:2
[FF] Muxer opened
[FF] Using 45 bytes for video extradata
[FF] Video initialized
[MP3] TimeBase for video 1000/372024
[FF] Bitrate 128
[initAudio] Language for track 0 is unknown
[FF] Audio initialized
[FF] Saving
[saveLoop] avg fps=372024
[initUI] Muxer, creating UI, video duration is 00:00:34,656
[adm_lavLogCallback] [lavc] H.264 bitstream malformed, no startcode found, use the video bitstream filter 'h264_mp4toannexb' to fix it ('-bsf:v h264_mp4toannexb' option with ffmpeg)
[adm_lavLogCallback] [lavc] H.264 bitstream error, startcode missing, size 34639[adm_lavLogCallback] [lavc] data 000002A9[adm_lavLogCallback] [lavc]
[adm_lavLogCallback] [lavc] H.264 bitstream error, startcode missing, size 21210[adm_lavLogCallback] [lavc] data 000052D6[adm_lavLogCallback] [lavc]

<snip> there are a lot of lines like this so no need to repeat them all for the entire video

[adm_lavLogCallback] [lavc] H.264 bitstream error, startcode missing, size 16756[adm_lavLogCallback] [lavc] data 00004170[adm_lavLogCallback] [lavc]
[adm_lavLogCallback] [lavc] H.264 bitstream error, startcode missing, size 7342[adm_lavLogCallback] [lavc] data 00001CAA[adm_lavLogCallback] [lavc]
[adm_lavLogCallback] [lavc] H.264 bitstream error, startcode missing, size 7825[adm_lavLogCallback] [lavc] data 00001E8D[adm_lavLogCallback] [lavc]
[switchToNextSegment] This is the last segment (0)
[getCompressedPicture] Cannot update to new segment
[getPacket] Get packet failed [saveLoop] [FF] Wrote 1029 frames, nb audio streams 1
[saveLoop] [FF] Found 0 missing PTS / 1029 total frames
[ffTS] Closing
[~DIA_encodingQt4] Destroying encoding qt4
[~DIA_encodingBase] DiaEncodingBase: Destroying
Close event!
[HandleAction] *** EXIT *****
[HandleAction] Closing ui
[Qvideo]Destroying QVideo
[~myQApplication] Cleaning render...
[renderDestroy] Cleaning up Render
[stop] stopping simple render.
[~simpleRender] Destroying simple render.
[~myQApplication] Cleaning preview...
[destroy] Destroying preview
[~myQApplication] Cleaning video body...
[deleteAll] [Editor] Deleting all videos
[lavc] Destroyed
[~ADM_faad] Faad decoder closed
[~ADM_edAudioTrackFromVideo] Destroying edAudio from video track 0 at 46e4a70

I have attached and example video that fails.

1 Attachments

Discussion

  • Donald Fraser

    Donald Fraser - 2015-10-24

    My description, after reading it again, seems a bit ambiguous. So to be clear: the final output after muxing has no video content in it and the mux mode is copy audio and copy video.

     
  • Mean

    Mean - 2015-10-25

    Convert to annex b format was missing
    It should be better now, even if not perfect, the sample video has weird timing (frame 0/1/2 are very very close to each other)

     
  • Mean

    Mean - 2015-10-26
    • status: open --> accepted
    • assigned_to: Mean
    • Group: v1.0_(example) --> 2.6.11
     

Log in to post a comment.