[FFmpeg-user] HLS conversion fails with "Cannot use rename on non file protocol..." error

Hoggins! hoggins at radiom.fr
Sun Oct 20 13:07:52 EEST 2019


Le 20/10/2019 à 11:27, Dennis Mungai a écrit :
> On Sun, 20 Oct 2019 at 11:14, Hoggins! <hoggins at radiom.fr> wrote:
>> Le 20/10/2019 à 00:33, Dennis Mungai a écrit :
>>> On Sat, 19 Oct 2019 at 20:21, Hoggins! <hoggins at radiom.fr> wrote:
>>>> Hello there,
>>>>
>>>> First post on this list.
>>>> I'm trying to convert a file to HLS without reencoding, and I'm stuck
>>>> with an error I quite don't understand. Here's my command:
>>>>
>>>>     ffmpeg -i rockinspace-okoyome.mp4 -c:v copy -flags +cgop -g 50
>>>>     -hls_time 1 -hls_playlist_type vod rockinspace-okoyome.m3u8
>>>>
>>>>
>>>> So it starts normally and creates a bunch of .ts files as expected, but
>>>> at file no 1764, it stops with an error I cannot relate to:
>>>>
>>>>     [hls @ 0x55657b07ec00] Opening 'rockinspace-okoyome1761.ts' for writing
>>>>     [hls @ 0x55657b07ec00] Opening 'rockinspace-okoyome1762.ts' for writing
>>>>     [hls @ 0x55657b07ec00] Opening 'rockinspace-okoyome1763.ts' for writing
>>>>     [hls @ 0x55657b07ec00] Opening 'rockinspace-okoyome1764.ts' for writing
>>>>     [hls @ 0x55657b07ec00] Cannot use rename on non file protocol, this
>>>>     may lead to races and temporary partial files
>>>>     frame=69230 fps=436 q=-1.0 Lsize=N/A time=00:46:07.60 bitrate=N/A
>>>>     speed=17.4x
>>>>     video:1352238kB audio:42374kB subtitle:0kB other streams:0kB global
>>>>     headers:0kB muxing overhead: unknown
>>>>     [aac @ 0x55657b19b280] Qavg: 174.694
>>>>
>>>>
>>>> Source and destination files are on a local filesystem, so I quite don't
>>>> understand why I would get this error. But considering it always happens
>>>> at this particular file, I'm guessing there might be something odd with
>>>> the source file. But what?
>>>> Source file is available here if you have a chance to test it:
>>>> https://radiom.fr/media-rockinspace-okoyome.mp4
>>>>
>>>> Note that the same thing happens with another file but on another segment:
>>>>
>>>>     [hls @ 0x557732d14140] Opening 'rockinspace-enola2178.ts' for writing
>>>>     [hls @ 0x557732d14140] Opening 'rockinspace-enola2179.ts' for
>>>>     writingd=15.4x
>>>>     [hls @ 0x557732d14140] Opening 'rockinspace-enola2180.ts' for writing
>>>>     [hls @ 0x557732d14140] Opening 'rockinspace-enola2181.ts' for writing
>>>>     [hls @ 0x557732d14140] Cannot use rename on non file protocol, this
>>>>     may lead to races and temporary partial files
>>>>     frame=64024 fps=385 q=-1.0 Lsize=N/A time=00:43:03.63 bitrate=N/A
>>>>     speed=15.5x
>>>>     video:1250493kB audio:40609kB subtitle:0kB other streams:0kB global
>>>>     headers:0kB muxing overhead: unknown
>>>>     [aac @ 0x55772e883cc0] Qavg: 161.026
>>>>
>>>>
>>>> (source file is https://radiom.fr/media-rockinspace-enola.mp4)
>>>>
>>>> Also note that I was previously using the following command, but I quit
>>>> because it resulted in audio and video being out of sync: ffmpeg -i
>>>> rockinspace-okoyome.mp4 -c:v -c:v libx264 -crf 17 -preset slow -flags
>>>> +cgop -g 50 -hls_time 1 -hls_playlist_type vod rockinspace-okoyome.m3u8
>>>>
>>>> Any idea? Should I try to reencode the source file to "normalize" it?
>>>>
>>>>     Thanks!
>>>>
>>>>         Hoggins!
>>> Hello Hoggins,
>>>
>>> Please post the full console output from FFmpeg, such that we can see
>>> the build version, etc.
>>> On my end, using the latest ffmpeg git tip, I'm able to run your
>>> command with no issues whatsoever.
>>>
>>> Note that only git tip is supported here.
>> I will try to compile something using the latest git tip to see where I
>> can get.
>> Do you mean that you successfully ran my command along with the provided
>> source file on your end?
>>
>> Anyway, here is the requested console output using the second example
>> provided (https://radiom.fr/media-rockinspace-enola.mp4):
>>
>>     ffmpeg -i ../../rockinspace-enola.mp4 -c:v copy -flags +cgop -g 50
>>     -hls_time 1 -hls_playlist_type vod rockinspace-enola.m3u8
>>     ffmpeg version 4.1.4 Copyright (c) 2000-2019 the FFmpeg developers
>>       built with gcc 9 (GCC)
>>       configuration: --prefix=/usr --bindir=/usr/bin
>>     --datadir=/usr/share/ffmpeg --docdir=/usr/share/doc/ffmpeg
>>     --incdir=/usr/include/ffmpeg --libdir=/usr/lib64
>>     --mandir=/usr/share/man --arch=x86_64 --optflags='-O2 -g -pipe -Wall
>>     -Werror=format-security -Wp,-D_FORTIFY_SOURCE=2
>>     -Wp,-D_GLIBCXX_ASSERTIONS -fexceptions -fstack-protector-strong
>>     -grecord-gcc-switches -specs=/usr/lib/rpm/redhat/redhat-hardened-cc1
>>     -specs=/usr/lib/rpm/redhat/redhat-annobin-cc1 -m64 -mtune=generic
>>     -fasynchronous-unwind-tables -fstack-clash-protection
>>     -fcf-protection' --extra-ldflags='-Wl,-z,relro -Wl,--as-needed
>>     -Wl,-z,now -specs=/usr/lib/rpm/redhat/redhat-hardened-ld '
>>     --extra-cflags=' ' --enable-libopencore-amrnb
>>     --enable-libopencore-amrwb --enable-libvo-amrwbenc --enable-version3
>>     --enable-bzlib --disable-crystalhd --enable-fontconfig
>>     --enable-frei0r --enable-gcrypt --enable-gnutls --enable-ladspa
>>     --enable-libaom --enable-libass --enable-libbluray --enable-libcdio
>>     --enable-libdrm --enable-libjack --enable-libfreetype
>>     --enable-libfribidi --enable-libgsm --enable-libmp3lame
>>     --enable-nvenc --enable-openal --enable-opencl --enable-opengl
>>     --enable-libopenjpeg --enable-libopus --enable-libpulse
>>     --enable-librsvg --enable-libsoxr --enable-libspeex --enable-libssh
>>     --enable-libtheora --enable-libvorbis --enable-libv4l2
>>     --enable-libvidstab --enable-libvmaf --enable-libvpx
>>     --enable-libx264 --enable-libx265 --enable-libxvid --enable-libzvbi
>>     --enable-avfilter --enable-avresample --enable-postproc
>>     --enable-pthreads --disable-static --enable-shared --enable-gpl
>>     --disable-debug --disable-stripping --shlibdir=/usr/lib64
>>     --enable-libmfx --enable-runtime-cpudetect
>>       libavutil      56. 22.100 / 56. 22.100
>>       libavcodec     58. 35.100 / 58. 35.100
>>       libavformat    58. 20.100 / 58. 20.100
>>       libavdevice    58.  5.100 / 58.  5.100
>>       libavfilter     7. 40.101 /  7. 40.101
>>       libavresample   4.  0.  0 /  4.  0.  0
>>       libswscale      5.  3.100 /  5.  3.100
>>       libswresample   3.  3.100 /  3.  3.100
>>       libpostproc    55.  3.100 / 55.  3.100
>>     Input #0, mov,mp4,m4a,3gp,3g2,mj2, from '../../rockinspace-enola.mp4':
>>       Metadata:
>>         major_brand     : isom
>>         minor_version   : 512
>>         compatible_brands: isomiso2avc1mp41
>>         encoder         : Lavf58.12.100
>>       Duration: 00:43:03.65, start: 0.000000, bitrate: 4099 kb/s
>>         Stream #0:0(und): Video: h264 (High) (avc1 / 0x31637661),
>>     yuvj420p(pc), 1920x1080, 4001 kb/s, 25.01 fps, 50 tbr, 16k tbn, 50
>>     tbc (default)
>>         Metadata:
>>           handler_name    : VideoHandler
>>         Stream #0:1(und): Audio: aac (LC) (mp4a / 0x6134706D), 44100 Hz,
>>     stereo, fltp, 128 kb/s (default)
>>         Metadata:
>>           handler_name    : SoundHandler
>>     Stream mapping:
>>       Stream #0:0 -> #0:0 (copy)
>>       Stream #0:1 -> #0:1 (aac (native) -> aac (native))
>>     Press [q] to stop, [?] for help
>>     [hls @ 0x557d6ffaa140] Opening 'rockinspace-enola0.ts' for writing
>>     Output #0, hls, to 'rockinspace-enola.m3u8':
>>       Metadata:
>>         major_brand     : isom
>>         minor_version   : 512
>>         compatible_brands: isomiso2avc1mp41
>>         encoder         : Lavf58.20.100
>>         Stream #0:0(und): Video: h264 (High) (avc1 / 0x31637661),
>>     yuvj420p(pc), 1920x1080, q=2-31, 4001 kb/s, 25.01 fps, 50 tbr, 90k
>>     tbn, 25 tbc (default)
>>         Metadata:
>>           handler_name    : VideoHandler
>>         Stream #0:1(und): Audio: aac (LC), 44100 Hz, stereo, fltp, 128
>>     kb/s (default)
>>         Metadata:
>>           handler_name    : SoundHandler
>>           encoder         : Lavc58.35.100 aac
>>     [hls @ 0x557d6ffaa140] Opening 'rockinspace-enola1.ts' for writing
>>     [hls @ 0x557d6ffaa140] Opening 'rockinspace-enola2.ts' for writing
>>     [hls @ 0x557d6ffaa140] Opening 'rockinspace-enola3.ts' for writing
>>     [hls @ 0x557d6ffaa140] Opening 'rockinspace-enola4.ts' for writing
>>     [hls @ 0x557d6ffaa140] Opening 'rockinspace-enola5.ts' for
>>     writingpeed=14.4x
>>     [hls @ 0x557d6ffaa140] Opening 'rockinspace-enola6.ts' for writing
>>     [hls @ 0x557d6ffaa140] Opening 'rockinspace-enola7.ts' for writing
>>
>>     <snip>
>>
>>     [hls @ 0x557d6ffaa140] Opening 'rockinspace-enola2178.ts' for
>>     writingd=15.7x
>>     [hls @ 0x557d6ffaa140] Opening 'rockinspace-enola2179.ts' for writing
>>     [hls @ 0x557d6ffaa140] Opening 'rockinspace-enola2180.ts' for writing
>>     [hls @ 0x557d6ffaa140] Opening 'rockinspace-enola2181.ts' for writing
>>     [hls @ 0x557d6ffaa140] Cannot use rename on non file protocol, this
>>     may lead to races and temporary partial files
>>     frame=64024 fps=391 q=-1.0 Lsize=N/A time=00:43:03.63 bitrate=N/A
>>     speed=15.8x
>>     video:1250493kB audio:40609kB subtitle:0kB other streams:0kB global
>>     headers:0kB muxing overhead: unknown
>>     [aac @ 0x557d6bb19cc0] Qavg: 161.026
>>
>>
>> Thanks!
>>
>>     Hoggins!
>>
> Yes, I was able to run your command, as provided, with the latest git
> tip build of ffmpeg.
> You can also use the git master builds from here:
> https://johnvansickle.com/ffmpeg/ without the need to recompile from
> source.
>

Starting to pinpoint my problem (I guess): with the static build, indeed
I don't get any error anymore, but the actual problem persists, as it
silently stops at the same step, and so the resulting playlist is truncated.
So there must definitely be something at that time in the source file
that FFmpeg doesn't like, maybe bad metadata or something that tells it
there is nothing more to see after this point.

Even though I'm going to lose quality here, I'm going to try to reencode
the source file with FFmpeg (I noticed that it detects 25.01fps which I
would interpret as an oddity in the data) and see what I can do from there.

-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 195 bytes
Desc: OpenPGP digital signature
URL: <http://ffmpeg.org/pipermail/ffmpeg-user/attachments/20191020/86d65bbd/attachment.sig>


More information about the ffmpeg-user mailing list