Transcoding is shortening videos

For questions and discussion that is NOT (I repeat NOT) specific to a certain Operating System.
Timothy Grove
Blank Cone
Blank Cone
Posts: 33
Joined: 07 Sep 2011 13:17

Transcoding is shortening videos

Postby Timothy Grove » 16 May 2017 17:31

VLC transcoding via the commandline is shortening my videos. I've been testing a number of different videos of different formats and durations on both Windows and MacOS and they all are being shortened by around 100ms (+-30ms). In many cases this doesn't make much difference, but in the video used in the example output below, vertical hand movement from the head level down to the waist, stops at around the chest level. Does this sound like a BUG in VLC, or is there some parameter which I could change which might make a difference? Thanks for any suggestion.

Input:
C:\Program Files (x86)\VideoLAN\VLC>vlc --verbose=3 --no-sout-x264-mbtree --sout=#transcode{venc=x264,vcodec=h264,acodec=None}:std{access=file,mux=mp4,dst='c:/Users/Samuel/Videos/Destination.mp4'} Source.mp4 -I rc

Console output:
[029280ac] mp4 demux debug: added fragment moov
[0290b2cc] mp4 stream debug: dumping root Box "root"
[0290b2cc] mp4 stream debug: | + ftyp size 24 offset 0
[0290b2cc] mp4 stream debug: | + moov size 1496 offset 24
[0290b2cc] mp4 stream debug: | | + mvhd size 108 offset 32
[0290b2cc] mp4 stream debug: | | + trak size 711 offset 140
[0290b2cc] mp4 stream debug: | | | + tkhd size 92 offset 148
[0290b2cc] mp4 stream debug: | | | + edts size 36 offset 240
[0290b2cc] mp4 stream debug: | | | | + elst size 28 offset 248
[0290b2cc] mp4 stream debug: | | | + mdia size 575 offset 276
[0290b2cc] mp4 stream debug: | | | | + mdhd size 32 offset 284
[0290b2cc] mp4 stream debug: | | | | + hdlr size 58 offset 316
[0290b2cc] mp4 stream debug: | | | | + minf size 477 offset 374
[0290b2cc] mp4 stream debug: | | | | | + vmhd size 20 offset 382
[0290b2cc] mp4 stream debug: | | | | | + dinf size 36 offset 402
[0290b2cc] mp4 stream debug: | | | | | | + dref size 28 offset 410
[0290b2cc] mp4 stream debug: | | | | | | | + url size 12 offset 426
[0290b2cc] mp4 stream debug: | | | | | + stbl size 413 offset 438
[0290b2cc] mp4 stream debug: | | | | | | + stsd size 173 offset 446
[0290b2cc] mp4 stream debug: | | | | | | | + avc1 size 157 offset 462
[0290b2cc] mp4 stream debug: | | | | | | | | + avcC size 43 offset 548
[0290b2cc] mp4 stream debug: | | | | | | | | + uuid size 28 offset 591
[0290b2cc] mp4 stream debug: | | | | | | + stts size 24 offset 619
[0290b2cc] mp4 stream debug: | | | | | | + stss size 20 offset 643
[0290b2cc] mp4 stream debug: | | | | | | + stsc size 52 offset 663
[0290b2cc] mp4 stream debug: | | | | | | + stsz size 108 offset 715
[0290b2cc] mp4 stream debug: | | | | | | + stco size 28 offset 823
[0290b2cc] mp4 stream debug: | | + trak size 669 offset 851
[0290b2cc] mp4 stream debug: | | | + tkhd size 92 offset 859
[0290b2cc] mp4 stream debug: | | | + edts size 36 offset 951
[0290b2cc] mp4 stream debug: | | | | + elst size 28 offset 959
[0290b2cc] mp4 stream debug: | | | + mdia size 533 offset 987
[0290b2cc] mp4 stream debug: | | | | + mdhd size 32 offset 995
[0290b2cc] mp4 stream debug: | | | | + hdlr size 58 offset 1027
[0290b2cc] mp4 stream debug: | | | | + minf size 435 offset 1085
[0290b2cc] mp4 stream debug: | | | | | + smhd size 16 offset 1093
[0290b2cc] mp4 stream debug: | | | | | + dinf size 36 offset 1109
[0290b2cc] mp4 stream debug: | | | | | | + dref size 28 offset 1117
[0290b2cc] mp4 stream debug: | | | | | | | + url size 12 offset 1133
[0290b2cc] mp4 stream debug: | | | | | + stbl size 375 offset 1145
[0290b2cc] mp4 stream debug: | | | | | | + stsd size 103 offset 1153
[0290b2cc] mp4 stream debug: | | | | | | | + mp4a size 87 offset 1169
[0290b2cc] mp4 stream debug: | | | | | | | | + esds size 51 offset 1205
[0290b2cc] mp4 stream debug: | | | | | | + stts size 24 offset 1256
[0290b2cc] mp4 stream debug: | | | | | | + stsc size 64 offset 1280
[0290b2cc] mp4 stream debug: | | | | | | + stsz size 144 offset 1344
[0290b2cc] mp4 stream debug: | | | | | | + stco size 32 offset 1488
[0290b2cc] mp4 stream debug: | + free size 8 offset 1520
[0290b2cc] mp4 stream debug: | + free size 8 offset 1528
[0290b2cc] mp4 stream debug: | + mdat size 41860 offset 1536
[029280ac] mp4 demux debug: unrecognized major file specification (mp42).
[029280ac] mp4 demux debug: found 2 tracks
[029280ac] mp4 demux warning: elst box found
[029280ac] mp4 demux debug: - [0] duration=733ms media time=0ms) rate=1.0
[029280ac] mp4 demux debug: track[Id 0x1] read 3 chunk
[029280ac] mp4 demux warning: STTS table of 1 entries
[029280ac] mp4 demux debug: track[Id 0x1] read 22 samples length:0s
[0294e1e4] core input debug: selecting program id=0
[029280ac] mp4 demux debug: adding track[Id 0x1] video (enable) language eng
[029280ac] mp4 demux warning: elst box found
[029280ac] mp4 demux debug: - [0] duration=700ms media time=0ms) rate=1.0
[029280ac] mp4 demux debug: track[Id 0x2] read 4 chunk
[029280ac] mp4 demux warning: STTS table of 1 entries
[029280ac] mp4 demux debug: track[Id 0x2] read 31 samples length:0s
[029280ac] mp4 demux debug: adding track[Id 0x2] audio (enable) language eng
[029280ac] mp4 demux debug: fragment offset 24, data 1544<->43396, duration 0
[029280ac] core demux debug: using demux module "mp4"
[0294e1e4] core input debug: looking for a subtitle file in C:\Program Files (x86)\VideoLAN\VLC\
[0294197c] core decoder debug: looking for packetizer module matching "any": 23 candidates
[0294197c] packetizer_h264 decoder debug: found NAL_SPS (sps_id=0)
[0294197c] packetizer_h264 decoder debug: found NAL_PPS (pps_id=0 sps_id=0)
[0294197c] packetizer_h264 decoder debug: avcC length size=4, sps=1, pps=1
[0294197c] core decoder debug: using packetizer module "packetizer_h264"
[02948e94] core decoder debug: looking for packetizer module matching "any": 23 candidates
[02948e94] packetizer_mpeg4audio decoder debug: running MPEG4 audio packetizer
[02948e94] packetizer_mpeg4audio decoder debug: AAC 44100Hz 1024 samples/frame
[02948e94] core decoder debug: using packetizer module "packetizer_mpeg4audio"
[0294e1e4] core input debug: starting in sync mode
[0298f814] core demux meta debug: looking for meta reader module matching "any": 2 candidates
[0298f814] lua demux meta debug: Trying Lua scripts in C:\Users\Samuel\AppData\Roaming\vlc\lua\meta\reader
[0298f814] lua demux meta debug: Trying Lua scripts in C:\Program Files (x86)\VideoLAN\VLC\lua\meta\reader
[0298f814] lua demux meta debug: Trying Lua playlist script C:\Program Files (x86)\VideoLAN\VLC\lua\meta\reader\filename.luac
[0298f814] core demux meta debug: no meta reader modules matched
[0294e1e4] core input debug: `file:///C:/Program%20Files%20%28x86%29/VideoLAN/VLC/Source.mp4' successfully opened
[029280ac] mp4 demux debug: elst (0) gives 0ms (movie)-> 0ms (track)
[029280ac] mp4 demux debug: track[Id 0x1] using Sync Sample Box (stss)
[029280ac] mp4 demux debug: stss gives 0 --> 0 (sample number)
[029280ac] mp4 demux debug: elst (0) gives 0ms (movie)-> 0ms (track)
[029280ac] mp4 demux debug: track[Id 0x2] does not provide Sync Sample Box (stss)
[0294e1e4] core input debug: Buffering 0%
[0294e1e4] core input debug: switching to async mode
[02916664] [0294e1e4] core stream output debug: core input debug: adding a new sout input (sout_input:0298ce60)Buffering 0%

[0294e1e4] [02917834] core input debug: stream_out_transcode stream out debug: Buffering 0%creating audio transcoding from fcc=`mp4a' to fcc=`None'

[0294b00c] [0294e1e4] core generic debug: core input debug: looking for decoder module matching "any": 43 candidatesBuffering 0%

[0294e1e4] [02916664] core input debug: core stream output debug: Buffering 11%adding a new sout input (sout_input:0298cda0)
[0294e1e4]
core input debug: Buffering 11%
[0294e1e4] core input debug: Buffering 22%
[0294e1e4] [0294b00c] core input debug: core generic debug: Buffering 22%using decoder module "faad"
[0294e1e4]
core input debug: [0294b354] Buffering 33%core encoder debug:
looking for encoder module matching "any": 21 candidates[0294e1e4]
core input debug: Buffering 33%
[0294e1e4] core input debug: Buffering 33%
[0294e1e4] core input debug: Buffering 44%
[0294b354] [0294e1e4] avcodec encoder debug: core input debug: CPU flags: 0x0107d3dbBuffering 44%

[0294e1e4] core input debug: Buffering 44%
[0294e1e4] core input debug: Buffering 55%
[0294e1e4] core input debug: Buffering 66%
[0294e1e4] core input debug: Buffering 66%
[0294e1e4] core input debug: Buffering 66%
[0294e1e4] core input debug: Buffering 66%
[0294e1e4] core input debug: Buffering 77%
[0294e1e4] core input debug: Buffering 77%
[0294e1e4] [0294b354] core input debug: core encoder debug: Buffering 88%no encoder modules matched
[0294e1e4]
core input debug: [02917834] Buffering 100%stream_out_transcode stream out error: cannot find audio encoder (module:any fourcc:None). Take a look few lines earlier to see possible reason.
[0294e1e4]
core input debug: [0294b00c] Buffering 100%core generic debug:
removing module "faad"[0294e1e4]
core input debug: [02917834] Buffering 100%stream_out_transcode stream out error: cannot create audio chain

[0294e1e4] [02948e94] [02917834] core input debug: core decoder error: stream_out_transcode stream out debug: Buffering 100%cannot create packetizer output (mp4a)creating video transcoding from fcc=`h264' to fcc=`h264'

[0294b2f4]
core generic debug: [0294e1e4] looking for decoder module matching "any": 43 candidatescore input debug: Stream buffering done (333 ms in 15 ms)

[0294b2f4] avcodec generic debug: CPU flags: 0x0107d3db
[0294b2f4] avcodec generic debug: trying to use direct rendering
[0294b2f4] avcodec generic debug: allowing 4 thread(s) for decoding
[0294b2f4] avcodec generic debug: avcodec codec (H264 - MPEG-4 AVC (part 10)) started
[0294b2f4] avcodec generic debug: using frame thread mode with 4 threads
[0294b2f4] core generic debug: using decoder module "avcodec"
[034820b4] core encoder debug: looking for encoder module matching "x264": 21 candidates
[034820b4] x264 encoder debug: version x264 0.142.X
[034820b4] x264 encoder: using cpu capabilities: MMX2 SSE2Fast SSSE3 SSE4.2 AVX AVX2 FMA3 LZCNT BMI2

[034820b4] x264 encoder: profile High, level 1.3

[034820b4] core encoder debug: using encoder module "x264"
[034820b4] core encoder debug: removing module "x264"
[034820b4] x264 encoder debug: framecount still in libx264 buffer: 0
[0294e1e4] core input debug: Decoder wait done in 5 ms
[0294b2f4] avcodec generic debug: available hardware decoder output format 61 (dxva2_vld)
[0294b2f4] avcodec generic debug: available hardware decoder output format 128 (d3d11va_vld)
[0294b2f4] avcodec generic debug: available software decoder output format 0 (yuv420p)
[02909c9c] core generic debug: looking for hw decoder module matching "none": 1 candidates
[02909c9c] core generic debug: no hw decoder modules matched
[0294b2f4] avcodec generic debug: enabling direct rendering
[02917834] stream_out_transcode stream out debug: decoder aspect is 1.268966:1
[02917834] stream_out_transcode stream out debug: source pixel aspect is 0.936122:1
[02917834] stream_out_transcode stream out debug: scaled pixel aspect is 0.936122:1
[02917834] stream_out_transcode stream out debug: source 366x270, destination 366x270
[02917834] stream_out_transcode stream out debug: source fps 30/1, destination 30/1
[02917834] stream_out_transcode stream out: input interval 33333 (base 1)
[02917834] stream_out_transcode stream out: output interval 33333 (base 1)
[02917834] stream_out_transcode stream out debug: encoder aspect is 368:290
[02917834] stream_out_transcode stream out debug: destination (after video filters) 368x290
[034820b4] core encoder debug: looking for encoder module matching "x264": 21 candidates
[034820b4] x264 encoder debug: version x264 0.142.X
[034820b4] x264 encoder: using SAR=1/1

[034820b4] x264 encoder: using cpu capabilities: MMX2 SSE2Fast SSSE3 SSE4.2 AVX AVX2 FMA3 LZCNT BMI2

[034820b4] x264 encoder: profile High, level 1.3

[034820b4] core encoder debug: using encoder module "x264"
[0292f4a4] core mux debug: adding a new input
[0292f4a4] mux_mp4 mux debug: adding input
[0294b2f4] avcodec generic warning: plane 0 not aligned
[0294b2f4] avcodec generic warning: disabling direct rendering
[0294b2f4] avcodec generic debug: enabling direct rendering
[0294e1e4] core input debug: EOF reached
[0294e1e4] core input debug: waiting decoder fifos to empty
[029388ac] core playlist debug: finished input[0294197c]
core decoder debug: removing module "packetizer_h264"
[0294197c] core decoder debug: killing decoder fourcc `h264', 0 PES in FIFO
[02916664] core stream output debug: removing a sout input (sout_input:0298cda0)
[0294b2f4] core generic debug: removing module "avcodec"
[0294b2f4] avcodec generic debug: ffmpeg codec (H264 - MPEG-4 AVC (part 10)) stopped
[034820b4] core encoder debug: removing module "x264"
[034820b4] x264 encoder debug: framecount still in libx264 buffer: 0
[034820b4] x264 encoder: frame I:1 Avg QP:17.40 size: 5002

[034820b4] x264 encoder: frame P:5 Avg QP:20.76 size: 1206

[034820b4] x264 encoder: frame B:12 Avg QP:24.46 size: 395

[034820b4] x264 encoder: consecutive B-frames: 11.1% 0.0% 0.0% 88.9%

[034820b4] x264 encoder: mb I I16..4: 32.7% 40.2% 27.1%

[034820b4] x264 encoder: mb P I16..4: 0.2% 1.1% 0.6% P16..4: 23.4% 7.8% 5.1% 0.0% 0.0% skip:61.9%

[034820b4] x264 encoder: mb B I16..4: 0.0% 0.0% 0.1% B16..8: 28.3% 0.0% 0.0% direct: 0.7% skip:70.8% L0:45.0% L1:46.8% BI: 8.2%

[034820b4] x264 encoder: 8x8 transform intra:41.1% inter:54.1%

[034820b4] x264 encoder: coded y,uvDC,uvAC intra: 64.8% 60.0% 28.5% inter: 4.4% 8.7% 2.2%

[034820b4] x264 encoder: i16 v,h,dc,p: 34% 38% 6% 22%

[034820b4] x264 encoder: i8 v,h,dc,ddl,ddr,vr,hd,vl,hu: 28% 19% 23% 5% 6% 5% 4% 4% 6%

[034820b4] x264 encoder: i4 v,h,dc,ddl,ddr,vr,hd,vl,hu: 30% 21% 15% 7% 7% 5% 7% 5% 5%

[034820b4] x264 encoder: i8c dc,h,v,p: 51% 18% 24% 6%

[034820b4] x264 encoder: Weighted P-Frames: Y:0.0% UV:0.0%

[034820b4] x264 encoder: ref P L0: 75.5% 5.0% 13.9% 5.6%

[034820b4] x264 encoder: ref B L0: 87.8% 9.9% 2.3%

[034820b4] x264 encoder: ref B L1: 94.8% 5.2%

[034820b4] x264 encoder: kb/s:210.32

[0292f4a4] mux_mp4 mux debug: removing input
[0292f4a4] core mux warning: no more input streams for this mux
[02948e94] core decoder debug: removing module "packetizer_mpeg4audio"
[02948e94] core decoder debug: killing decoder fourcc `mp4a', 0 PES in FIFO
[029280ac] core demux debug: removing module "mp4"
[029280ac] mp4 demux debug: freeing all memory
[0290b2cc] core stream debug: removing module "record"
[028adcbc] core access debug: removing module "filesystem"
[0294e1e4] core input debug: Program doesn't contain anymore ES
[029388ac] core playlist debug: dead input
[02916664] core stream output debug: destroying useless sout
[02917834] core stream out debug: destroying chain... (name=transcode)
[02917834] core stream out debug: removing module "stream_out_transcode"
[02917834] core stream out debug: destroying chain done
[02916074] core stream out debug: destroying chain... (name=std)
[02916074] core stream out debug: removing module "stream_out_standard"
[0292f4a4] core mux debug: removing module "mux_mp4"
[0292f4a4] mux_mp4 mux debug: Close
[0292f4a4] mux_mp4 mux debug: movie duration 0s
[0292f4a4] mux_mp4 mux debug: created 1 chunks (stco)
[02909a5c] core access out debug: removing module "access_output_file"
[02909a5c] access_output_file access out debug: file access output closed
[02916074] core stream out debug: destroying chain done
[029388ac] core playlist debug: changing item without a request (current 0/1)
[029388ac] core playlist debug: nothing to play

Timothy Grove
Blank Cone
Blank Cone
Posts: 33
Joined: 07 Sep 2011 13:17

Re: Transcoding is shortening videos

Postby Timothy Grove » 26 May 2017 17:30

Oh boy... this is one I really need to solve... If anyone even has an inkling of a solution, I'd love to hear it. Thanks.

Rémi Denis-Courmont
Developer
Developer
Posts: 15265
Joined: 07 Jun 2004 16:01
VLC version: master
Operating System: Linux
Contact:

Re: Transcoding is shortening videos

Postby Rémi Denis-Courmont » 28 May 2017 17:18

This is a known issue. VLC output was designed for live streaming, not bit-exact conversion.
Rémi Denis-Courmont
https://www.remlab.net/
Private messages soliciting support will be systematically discarded

Timothy Grove
Blank Cone
Blank Cone
Posts: 33
Joined: 07 Sep 2011 13:17

Re: Transcoding is shortening videos

Postby Timothy Grove » 29 May 2017 14:58

Is this issue listed somewhere? Is it likely to be fixed at some point or is it out of the scope of VLC development? I had a similar issue with VLC playback where some (not all) videos seemed to stop just short of the end (I use 'play-and-pause' to pause on the last frame), but with 2.2.4 this problem went away. I tried the latest VLC builds, but transcoding is still shortening all videos I've tried.

I'm the developer for a sign language application (https://www.soosl.net) in which it is important that I don't lose any hand movements, etc., by shortening videos added to a project. We use VLC through the python bindings for video playback and FFmpeg for transcoding purposes. It seems a shame to use two different external applications for these purposes when both have so much in common. Now and again I've attempted to either build a video player with FFmpeg or transcode with VLC, and I 'thought' that I was just starting to succeed with this second option!

I guess I'm going to have to bring FFmpeg back into play until this issue is fixed or some other 'work-around' to the problem is discovered... :(


Return to “General VLC media player Troubleshooting”

Who is online

Users browsing this forum: No registered users and 11 guests