[FFmpeg-user] rw_timeout trouble

Marton Balint cus at passwd.hu
Tue Apr 21 22:24:50 EEST 2020



On Tue, 21 Apr 2020, Bouke / VideoToolShed wrote:

> Hi all,
> Strange issue:
> Trying to transcode MXF ‘while in the making’ with the rw_timeout option.

Shouldn't you use the -follow option as well?

> It works on my end using Adobe Media Encoder for the MXF, but if Avid MC (on another computer that I don’t control) generates the MXF, 
> the first video frame gets doubled, and a more than expected by the video frame doubled audio offset.

Could you clarify this?

>
> Below is the FFmpeg command (not the ‘real’ command, I use Python to fire FFmpeg, and that takes care of the quoting / escaping stuff, the line is a rip off from the list I send…),
> and the (JSON) FFprobe output I use to generate the command line.
>
> Clues?
> Thx,
>
> Bouke
>
> FFmpeg -threads 0 -rw_timeout 2000000 -i 
> /Users/giulio/Desktop/whatchforlder/in/TESTMXF TO MP4_SIMULPRORES.mxf 
> -vsync vfr -f lavfi -i anullsrc=channel_layout=mono:sample_rate=48000 
> -map 0:0 -filter_complex 
> [0:a]channelmap=0-0:channel_layout=0x1[a0];[1:a]channelmap=0-0:channel_layout=0x1[a1];[a0][a1]amerge=inputs=2[out] 
> -map [out] -c:a aac -strict -2 -ab 64k -ar 32000 -timecode 01:00:00:00 
> -metadata:s:v:0 reel_name=TESTMXF TO MP4_SIMULPRORES -c:v libx264 
> -pix_fmt yuv420p -preset ultrafast -crf 23 
> /Users/giulio/Desktop/whatchforlder/out/TESTMXF TO MP4_SIMULPRORES.mp4 
> -y

What is this magic with the -f lavfi - anullsrc=... ? I'd definitely try 
first without it and the filters. Also you may try using -seekable 0 
maybe it makes a difference about how the input mxf is read.

Regards,
Marton

>
> ffmpeg version git-2020-03-15-c467328 Copyright (c) 2000-2020 the FFmpeg developers
>  built with Apple clang version 11.0.0 (clang-1100.0.33.8)
>  configuration: --enable-gpl --enable-version3 --enable-sdl2 --enable-fontconfig --enable-gnutls --enable-iconv --enable-libass --enable-libdav1d --enable-libbluray --enable-libfreetype --enable-libmp3lame --enable-libopencore-amrnb --enable-libopencore-amrwb --enable-libopenjpeg --enable-libopus --enable-libshine --enable-libsnappy --enable-libsoxr --enable-libtheora --enable-libtwolame --enable-libvpx --enable-libwavpack --enable-libwebp --enable-libx264 --enable-libx265 --enable-libxml2 --enable-libzimg --enable-lzma --enable-zlib --enable-gmp --enable-libvidstab --enable-libvorbis --enable-libvo-amrwbenc --enable-libmysofa --enable-libspeex --enable-libxvid --enable-libaom --enable-appkit --enable-avfoundation --enable-coreimage --enable-audiotoolbox
>  libavutil      56. 42.100 / 56. 42.100
>  libavcodec     58. 75.100 / 58. 75.100
>  libavformat    58. 41.100 / 58. 41.100
>  libavdevice    58.  9.103 / 58.  9.103
>  libavfilter     7. 77.100 /  7. 77.100
>  libswscale      5.  6.101 /  5.  6.101
>  libswresample   3.  6.100 /  3.  6.100
>  libpostproc    55.  6.100 / 55.  6.100
> [mxf @ 0x7fcfe6800000] broken or empty index
> Guessed Channel Layout for Input Stream #0.1 : mono
> Guessed Channel Layout for Input Stream #0.2 : mono
> Input #0, mxf, from '/Users/giulio/Desktop/whatchforlder/in/TESTMXF TO MP4_SIMULPRORES.mxf':
>  Metadata:
>    operational_pattern_ul: 060e2b34.04010101.0d010201.01010900
>    product_uid     : d49f75ba-4965-4cfa-9d11-cd87206287e0
>    uid             : 60393316-83b2-11ea-bd8c-4c32759d7b9f
>    generation_uid  : 60393317-83b2-11ea-acf9-4c32759d7b9f
>    company_name    : Avid Technology, Inc.
>    product_name    : Avid MediaProcessor Plug-In
>    product_version : 1.0.43.10024.1
>    application_platform: MXF::SDK (4.6.51) on Mac OS X
>    modification_date: 2020-04-21T09:27:53.000000Z
>    material_package_umid: 0x060A2B340101010501010D12131C5C3690ED0702608905A5781F4C32759D7B9F
>    timecode        : 01:00:00:00
>  Duration: 00:01:30.04, start: 0.000000, bitrate: 7080 kb/s
>    Stream #0:0: Video: mpeg2video (4:2:2), yuv422p(tv, bt709, progressive), 1920x1080 [SAR 1:1 DAR 16:9], 50000 kb/s, 25 fps, 25 tbr, 25 tbn, 50 tbc
>    Metadata:
>      file_package_umid: 0x060A2B340101010501010D1213347B3C90ED0702608905A580D84C32759D7B9F
>      file_package_name: Source Package
>      track_name      : Track 2
>    Stream #0:1: Audio: pcm_s24le, 48000 Hz, mono, s32 (24 bit), 1152 kb/s
>    Metadata:
>      file_package_umid: 0x060A2B340101010501010D1213347B3C90ED0702608905A580D84C32759D7B9F
>      file_package_name: Source Package
>      track_name      : Track 3
>    Stream #0:2: Audio: pcm_s24le, 48000 Hz, mono, s32 (24 bit), 1152 kb/s
>    Metadata:
>      file_package_umid: 0x060A2B340101010501010D1213347B3C90ED0702608905A580D84C32759D7B9F
>      file_package_name: Source Package
>      track_name      : Track 4
> Input #1, lavfi, from 'anullsrc=channel_layout=mono:sample_rate=48000':
>  Duration: N/A, start: 0.000000, bitrate: 384 kb/s
>    Stream #1:0: Audio: pcm_u8, 48000 Hz, mono, u8, 384 kb/s
> Stream mapping:
>  Stream #0:1 (pcm_s24le) -> channelmap (graph 0)
>  Stream #1:0 (pcm_u8) -> channelmap (graph 0)
>  Stream #0:0 -> #0:0 (mpeg2video (native) -> h264 (libx264))
>  amerge (graph 0) -> Stream #0:1 (aac)
> Press [q] to stop, [?] for help
> [libx264 @ 0x7fcfe6011c00] using SAR=1/1
> [libx264 @ 0x7fcfe6011c00] using cpu capabilities: MMX2 SSE2Fast SSSE3 SSE4.2 AVX FMA3 BMI2 AVX2
> [libx264 @ 0x7fcfe6011c00] profile Constrained Baseline, level 4.0, 4:2:0, 8-bit
> [libx264 @ 0x7fcfe6011c00] 264 - core 159 - H.264/MPEG-4 AVC codec - Copyleft 2003-2019 - http://www.videolan.org/x264.html - options: cabac=0 ref=1 deblock=0:0:0 analyse=0:0 me=dia subme=0 psy=1 psy_rd=1.00:0.00 mixed_ref=0 me_range=16 chroma_me=1 trellis=0 8x8dct=0 cqm=0 deadzone=21,11 fast_pskip=1 chroma_qp_offset=0 threads=12 lookahead_threads=2 sliced_threads=0 nr=0 decimate=1 interlaced=0 bluray_compat=0 constrained_intra=0 bframes=0 weightp=0 keyint=250 keyint_min=25 scenecut=0 intra_refresh=0 rc=crf mbtree=0 crf=23.0 qcomp=0.60 qpmin=0 qpmax=69 qpstep=4 ip_ratio=1.40 aq=0
> [Parsed_amerge_2 @ 0x7fcfe5f047c0] Input channel layouts overlap: output layout will be determined by the number of distinct input channels
> Output #0, mp4, to '/Users/giulio/Desktop/whatchforlder/out/TESTMXF TO MP4_SIMULPRORES.mp4':
>  Metadata:
>    operational_pattern_ul: 060e2b34.04010101.0d010201.01010900
>    product_uid     : d49f75ba-4965-4cfa-9d11-cd87206287e0
>    uid             : 60393316-83b2-11ea-bd8c-4c32759d7b9f
>    generation_uid  : 60393317-83b2-11ea-acf9-4c32759d7b9f
>    company_name    : Avid Technology, Inc.
>    product_name    : Avid MediaProcessor Plug-In
>    product_version : 1.0.43.10024.1
>    application_platform: MXF::SDK (4.6.51) on Mac OS X
>    modification_date: 2020-04-21T09:27:53.000000Z
>    material_package_umid: 0x060A2B340101010501010D12131C5C3690ED0702608905A5781F4C32759D7B9F
>    timecode        : 01:00:00:00
>    encoder         : Lavf58.41.100
>    Stream #0:0: Video: h264 (libx264) (avc1 / 0x31637661), yuv420p(progressive), 1920x1080 [SAR 1:1 DAR 16:9], q=-1--1, 0.04 fps, 12800 tbn, 25 tbc
>    Metadata:
>      file_package_umid: 0x060A2B340101010501010D1213347B3C90ED0702608905A580D84C32759D7B9F
>      file_package_name: Source Package
>      track_name      : Track 2
>      reel_name       : TESTMXF TO MP4_SIMULPRORES
>      encoder         : Lavc58.75.100 libx264
>    Side data:
>      cpb: bitrate max/min/avg: 0/0/0 buffer size: 0 vbv_delay: N/A
>    Stream #0:1: Audio: aac (LC) (mp4a / 0x6134706D), 32000 Hz, stereo, fltp, 64 kb/s (default)
>    Metadata:
>      encoder         : Lavc58.75.100 aac
> frame=   27 fps=0.0 q=12.0 size=       0kB time=00:00:00.60 bitrate=   0.7kbits/s speed=1.21x 
> frame=   60 fps= 59 q=12.0 size=       0kB time=00:00:01.88 bitrate=   0.2kbits/s speed=1.86x 
> frame=   94 fps= 62 q=12.0 size=       0kB time=00:00:03.24 bitrate=   0.1kbits/s speed=2.12x 
> frame=  127 fps= 62 q=12.0 size=       0kB time=00:00:04.57 bitrate=   0.1kbits/s speed=2.24x 
> frame=  159 fps= 62 q=12.0 size=       0kB time=00:00:05.85 bitrate=   0.1kbits/s speed=2.29x 
> frame=  194 fps= 64 q=12.0 size=       0kB time=00:00:07.26 bitrate=   0.1kbits/s speed=2.38x 
> frame=  228 fps= 64 q=12.0 size=       0kB time=00:00:08.60 bitrate=   0.0kbits/s speed=2.42x 
> frame=  265 fps= 65 q=12.0 size=       0kB time=00:00:10.11 bitrate=   0.0kbits/s speed=2.49x 
> frame=  298 fps= 65 q=12.0 size=       0kB time=00:00:11.42 bitrate=   0.0kbits/s speed=2.51x 
> frame=  333 fps= 66 q=12.0 size=       0kB time=00:00:12.83 bitrate=   0.0kbits/s speed=2.53x 
> frame=  368 fps= 66 q=12.0 size=       0kB time=00:00:14.24 bitrate=   0.0kbits/s speed=2.55x 
> frame=  403 fps= 66 q=12.0 size=       0kB time=00:00:15.64 bitrate=   0.0kbits/s speed=2.56x 
> frame=  439 fps= 66 q=12.0 size=       0kB time=00:00:17.05 bitrate=   0.0kbits/s speed=2.58x 
> frame=  475 fps= 67 q=12.0 size=       0kB time=00:00:18.52 bitrate=   0.0kbits/s speed= 2.6x 
> frame=  508 fps= 67 q=13.0 size=       0kB time=00:00:19.80 bitrate=   0.0kbits/s speed= 2.6x 
> frame=  543 fps= 67 q=12.0 size=       0kB time=00:00:21.21 bitrate=   0.0kbits/s speed=2.61x 
> frame=  579 fps= 67 q=12.0 size=       0kB time=00:00:22.68 bitrate=   0.0kbits/s speed=2.62x 
> frame=  614 fps= 67 q=12.0 size=       0kB time=00:00:24.04 bitrate=   0.0kbits/s speed=2.63x 
> frame=  649 fps= 67 q=12.0 size=       0kB time=00:00:25.44 bitrate=   0.0kbits/s speed=2.64x 
> frame=  682 fps= 67 q=12.0 size=       0kB time=00:00:26.78 bitrate=   0.0kbits/s speed=2.64x 
> frame=  715 fps= 67 q=12.0 size=       0kB time=00:00:28.12 bitrate=   0.0kbits/s speed=2.64x 
> frame=  748 fps= 67 q=12.0 size=       0kB time=00:00:29.40 bitrate=   0.0kbits/s speed=2.63x 
> frame=  784 fps= 67 q=12.0 size=       0kB time=00:00:30.88 bitrate=   0.0kbits/s speed=2.65x 
> frame=  819 fps= 67 q=12.0 size=       0kB time=00:00:32.28 bitrate=   0.0kbits/s speed=2.65x 
> frame=  854 fps= 67 q=12.0 size=       0kB time=00:00:33.69 bitrate=   0.0kbits/s speed=2.66x 
> frame=  890 fps= 67 q=12.0 size=       0kB time=00:00:35.10 bitrate=   0.0kbits/s speed=2.66x 
> frame=  923 fps= 67 q=12.0 size=       0kB time=00:00:36.44 bitrate=   0.0kbits/s speed=2.66x 
> frame=  958 fps= 67 q=12.0 size=       0kB time=00:00:37.80 bitrate=   0.0kbits/s speed=2.66x 
> frame=  993 fps= 67 q=12.0 size=       0kB time=00:00:39.20 bitrate=   0.0kbits/s speed=2.66x 
> frame= 1027 fps= 67 q=12.0 size=       0kB time=00:00:40.60 bitrate=   0.0kbits/s speed=2.66x 
> frame= 1086 fps= 69 q=12.0 size=       0kB time=00:00:42.92 bitrate=   0.0kbits/s speed=2.72x 
> frame= 1121 fps= 69 q=12.0 size=       0kB time=00:00:44.32 bitrate=   0.0kbits/s speed=2.73x 
> frame= 1164 fps= 69 q=12.0 size=       0kB time=00:00:46.04 bitrate=   0.0kbits/s speed=2.75x 
> frame= 1199 fps= 69 q=12.0 size=       0kB time=00:00:47.48 bitrate=   0.0kbits/s speed=2.75x 
> frame= 1233 fps= 69 q=12.0 size=       0kB time=00:00:48.80 bitrate=   0.0kbits/s speed=2.74x 
> frame= 1267 fps= 69 q=12.0 size=       0kB time=00:00:50.20 bitrate=   0.0kbits/s speed=2.75x 
> frame= 1301 fps= 69 q=12.0 size=       0kB time=00:00:51.55 bitrate=   0.0kbits/s speed=2.75x 
> frame= 1336 fps= 69 q=12.0 size=       0kB time=00:00:52.96 bitrate=   0.0kbits/s speed=2.74x 
> frame= 1387 fps= 70 q=12.0 size=       0kB time=00:00:55.00 bitrate=   0.0kbits/s speed=2.78x 
> frame= 1437 fps= 71 q=12.0 size=       0kB time=00:00:56.99 bitrate=   0.0kbits/s speed= 2.8x 
> frame= 1468 fps= 70 q=12.0 size=       0kB time=00:00:58.20 bitrate=   0.0kbits/s speed= 2.8x 
> frame= 1502 fps= 70 q=12.0 size=       0kB time=00:00:59.56 bitrate=   0.0kbits/s speed=2.79x 
> frame= 1536 fps= 70 q=13.0 size=       0kB time=00:01:00.96 bitrate=   0.0kbits/s speed=2.79x 
> frame= 1571 fps= 70 q=12.0 size=       0kB time=00:01:02.36 bitrate=   0.0kbits/s speed=2.79x 
> frame= 1605 fps= 70 q=12.0 size=       0kB time=00:01:03.71 bitrate=   0.0kbits/s speed=2.79x 
> frame= 1638 fps= 70 q=12.0 size=       0kB time=00:01:05.00 bitrate=   0.0kbits/s speed=2.78x 
> frame= 1674 fps= 70 q=12.0 size=       0kB time=00:01:06.46 bitrate=   0.0kbits/s speed=2.78x 
> frame= 1721 fps= 71 q=12.0 size=       0kB time=00:01:08.32 bitrate=   0.0kbits/s speed= 2.8x 
> frame= 1756 fps= 71 q=13.0 size=       0kB time=00:01:09.72 bitrate=   0.0kbits/s speed= 2.8x 
> frame= 1796 fps= 71 q=12.0 size=       0kB time=00:01:11.32 bitrate=   0.0kbits/s speed=2.81x 
> frame= 1847 fps= 71 q=12.0 size=       0kB time=00:01:13.37 bitrate=   0.0kbits/s speed=2.83x 
> frame= 1876 fps= 72 q=-1.0 Lsize=     183kB time=00:01:15.04 bitrate=  20.0kbits/s speed=2.87x 
> video:123kB audio:16kB subtitle:0kB other streams:0kB global headers:0kB muxing overhead: 31.571526%
> [libx264 @ 0x7fcfe6011c00] frame I:8     Avg QP:11.25  size:  6164
> [libx264 @ 0x7fcfe6011c00] frame P:1868  Avg QP:12.08  size:    41
> [libx264 @ 0x7fcfe6011c00] mb I  I16..4: 100.0%  0.0%  0.0%
> [libx264 @ 0x7fcfe6011c00] mb P  I16..4:  0.1%  0.0%  0.0%  P16..4:  0.0%  0.0%  0.0%  0.0%  0.0%    skip:99.9%
> [libx264 @ 0x7fcfe6011c00] coded y,uvDC,uvAC intra: 0.7% 0.0% 0.0% inter: 0.0% 0.0% 0.0%
> [libx264 @ 0x7fcfe6011c00] i16 v,h,dc,p: 98%  0%  1%  0%
> [libx264 @ 0x7fcfe6011c00] i8c dc,h,v,p: 100%  0%  0%  0%
> [libx264 @ 0x7fcfe6011c00] kb/s:13.37
> [aac @ 0x7fcfe6007c00] Qavg: 65530.832
>
> Probe:
> {
>    "streams": [
>        {
>            "index": 0,
>            "codec_name": "mpeg2video",
>            "codec_long_name": "MPEG-2 video",
>            "profile": "4:2:2",
>            "codec_type": "video",
>            "codec_time_base": "1/25",
>            "codec_tag_string": "[0][0][0][0]",
>            "codec_tag": "0x0000",
>            "width": 1920,
>            "height": 1080,
>            "coded_width": 0,
>            "coded_height": 0,
>            "has_b_frames": 1,
>            "sample_aspect_ratio": "1:1",
>            "display_aspect_ratio": "16:9",
>            "pix_fmt": "yuv422p",
>            "level": 2,
>            "color_range": "tv",
>            "color_space": "bt709",
>            "color_transfer": "bt709",
>            "color_primaries": "bt709",
>            "chroma_location": "topleft",
>            "field_order": "progressive",
>            "refs": 1,
>            "r_frame_rate": "25/1",
>            "avg_frame_rate": "25/1",
>            "time_base": "1/25",
>            "start_pts": 0,
>            "start_time": "0.000000",
>            "duration_ts": 2251,
>            "duration": "90.040000",
>            "bit_rate": "50000000",
>            "disposition": {
>                "default": 0,
>                "dub": 0,
>                "original": 0,
>                "comment": 0,
>                "lyrics": 0,
>                "karaoke": 0,
>                "forced": 0,
>                "hearing_impaired": 0,
>                "visual_impaired": 0,
>                "clean_effects": 0,
>                "attached_pic": 0,
>                "timed_thumbnails": 0
>            },
>            "tags": {
>                "file_package_umid": "0x060A2B340101010501010D1213D4DDA7986E1502608905A514314C32759D7B9F",
>                "file_package_name": "Source Package",
>                "track_name": "Track 2"
>            }
>        },
>        {
>            "index": 1,
>            "codec_name": "pcm_s24le",
>            "codec_long_name": "PCM signed 24-bit little-endian",
>            "codec_type": "audio",
>            "codec_time_base": "1/48000",
>            "codec_tag_string": "[0][0][0][0]",
>            "codec_tag": "0x0000",
>            "sample_fmt": "s32",
>            "sample_rate": "48000",
>            "channels": 1,
>            "bits_per_sample": 24,
>            "r_frame_rate": "0/0",
>            "avg_frame_rate": "0/0",
>            "time_base": "1/48000",
>            "start_pts": 0,
>            "start_time": "0.000000",
>            "duration_ts": 4321920,
>            "duration": "90.040000",
>            "bit_rate": "1152000",
>            "bits_per_raw_sample": "24",
>            "disposition": {
>                "default": 0,
>                "dub": 0,
>                "original": 0,
>                "comment": 0,
>                "lyrics": 0,
>                "karaoke": 0,
>                "forced": 0,
>                "hearing_impaired": 0,
>                "visual_impaired": 0,
>                "clean_effects": 0,
>                "attached_pic": 0,
>                "timed_thumbnails": 0
>            },
>            "tags": {
>                "file_package_umid": "0x060A2B340101010501010D1213D4DDA7986E1502608905A514314C32759D7B9F",
>                "file_package_name": "Source Package",
>                "track_name": "Track 3"
>            }
>        },
>        {
>            "index": 2,
>            "codec_name": "pcm_s24le",
>            "codec_long_name": "PCM signed 24-bit little-endian",
>            "codec_type": "audio",
>            "codec_time_base": "1/48000",
>            "codec_tag_string": "[0][0][0][0]",
>            "codec_tag": "0x0000",
>            "sample_fmt": "s32",
>            "sample_rate": "48000",
>            "channels": 1,
>            "bits_per_sample": 24,
>            "r_frame_rate": "0/0",
>            "avg_frame_rate": "0/0",
>            "time_base": "1/48000",
>            "start_pts": 0,
>            "start_time": "0.000000",
>            "duration_ts": 4321920,
>            "duration": "90.040000",
>            "bit_rate": "1152000",
>            "bits_per_raw_sample": "24",
>            "disposition": {
>                "default": 0,
>                "dub": 0,
>                "original": 0,
>                "comment": 0,
>                "lyrics": 0,
>                "karaoke": 0,
>                "forced": 0,
>                "hearing_impaired": 0,
>                "visual_impaired": 0,
>                "clean_effects": 0,
>                "attached_pic": 0,
>                "timed_thumbnails": 0
>            },
>            "tags": {
>                "file_package_umid": "0x060A2B340101010501010D1213D4DDA7986E1502608905A514314C32759D7B9F",
>                "file_package_name": "Source Package",
>                "track_name": "Track 4"
>            }
>        }
>    ],
>    "format": {
>        "filename": "/Users/giulio/Desktop/whatchforlder/in/TESTMXF TO MP4_SIMULPRORES.mxf",
>        "nb_streams": 3,
>        "nb_programs": 0,
>        "format_name": "mxf",
>        "format_long_name": "MXF (Material eXchange Format)",
>        "start_time": "0.000000",
>        "duration": "90.040000",
>        "size": "41943040",
>        "bit_rate": "3726613",
>        "probe_score": 100,
>        "tags": {
>            "operational_pattern_ul": "060e2b34.04010101.0d010201.01010900",
>            "product_uid": "d49f75ba-4965-4cfa-9d11-cd87206287e0",
>            "uid": "70521245-83b4-11ea-aa4f-4c32759d7b9f",
>            "generation_uid": "70521246-83b4-11ea-9d0e-4c32759d7b9f",
>            "company_name": "Avid Technology, Inc.",
>            "product_name": "Avid MediaProcessor Plug-In",
>            "product_version": "1.0.43.10024.1",
>            "application_platform": "MXF::SDK (4.6.51) on Mac OS X",
>            "modification_date": "2020-04-21T09:42:39.000000Z",
>            "material_package_umid": "0x060A2B340101010501010D1213FD843B986E1502608905A5401C4C32759D7B9F",
>            "timecode": "01:00:00:00"
>        }
>    }
> }
> _______________________________________________
> ffmpeg-user mailing list
> ffmpeg-user at ffmpeg.org
> https://ffmpeg.org/mailman/listinfo/ffmpeg-user
>
> To unsubscribe, visit link above, or email
> ffmpeg-user-request at ffmpeg.org with subject "unsubscribe".


More information about the ffmpeg-user mailing list