Opened 6 years ago

Last modified 6 years ago

#7804 new defect

ffmpeg exit code incorrect

Reported by: razvan Owned by:
Priority: normal Component: undetermined
Version: git-master Keywords:
Cc: boris_petrov@live.com Blocked By:
Blocking: Reproduced by developer: no
Analyzed by developer: no

Description

I think I found an inconsistency in the exit code of fmpeg when reading http stream:

if I give ffmpeg a incorrect input url
ffmpeg -i http://....
which is not found on the streaming server then ffmpeg report
"HTTP error 404 Not Found"
and exit code is 1
I think this is correct as ffmpeg completes with an error,
so exit code !=0

If input url is correct and it starts reading it and so on (save the stream for example),
and after a while, the server return again "HTTP error 404 Not Found" for some chunk
then ffmpeg exit with code 0.

[hls,applehttp @ 0x6e0f6c0] Opening 'http://...../chunklist_w222613001.m3u8' for reading
[http @ 0x6e18100] Opening 'http://..../media_w222613001_15571.aac' for reading
[hls,applehttp @ 0x6e0f6c0] Opening 'http://..../media_w222613001_15571.aac' for reading
[http @ 0x6e6c0c0] Opening 'http://misatv.ro:1935/LiveMSTV_Safe/livestream_ao/chunklist_w222613001.m3u8' for reading
[hls,applehttp @ 0x6e0f6c0] Opening 'http://.../chunklist_w222613001.m3u8' for reading
[http @ 0x6e70600] HTTP error 404 Not Found
[hls,applehttp @ 0x6e0f6c0] Failed to reload playlist 0
[hls,applehttp @ 0x6e0f6c0] Opening 'http://.../chunklist_w222613001.m3u8' for reading
[http @ 0x6e19dc0] HTTP error 404 Not Found
[hls,applehttp @ 0x6e0f6c0] Failed to reload playlist 0
size= 36208kB time=00:37:49.95 bitrate= 130.7kbits/s speed= 1x
video:0kB audio:35539kB subtitle:0kB other streams:0kB global headers:0kB muxing overhead: 1.880420%

I think this is incorrect because ffmpeg ended with an error,
so it should return something other then 0.

Change History (5)

comment:1 by razvan, 6 years ago

ffmpeg -version
ffmpeg version N-48401-gd15117c996-static https://johnvansickle.com/ffmpeg/ Copyright (c) 2000-2019 the FFmpeg developers
built with gcc 6.3.0 (Debian 6.3.0-18+deb9u1) 20170516

Last edited 6 years ago by razvan (previous) (diff)

comment:2 by razvan, 6 years ago

Summary: ffmpeg exit codeffmpeg exit code incorrect

comment:3 by Carl Eugen Hoyos, 6 years ago

Please provide the command line you tested together with the complete, uncut console output to make this a valid ticket.

comment:4 by razvan, 6 years ago


if I give ffmpeg a incorrect input url

ffmpeg -i ​http://.../livestream_a/playlist.m3u8 <<<< incorrect
ffmpeg -i http://.../livestream_ao/playlist.m3u8 <<< this is the correct one

which is not found on the streaming server then ffmpeg report
"HTTP error 404 Not Found"
and exit code is 1
I think this is correct as ffmpeg completes with an error,
so exit code !=0

command and output


ffmpeg started on 2019-03-23 at 08:19:24
Report written to "/home/raz/radio.log"
Command line:
./ffmpeg -hide_banner -user_agent "VLC/3.0.6 LibVLC/3.0.6" -i http://.../livestream_a/playlist.m3u8 -y -nostats -c copy -bsf:a aac_adtstoasc /home/raz/radio.aac
[http @ 0x562df80] HTTP error 404 Not Found
http://.../livestream_a/playlist.m3u8: Server returned 404 Not Found

ffmpeg exit code=1


if input url is correct and it starts reading it and so on (save the stream for example),
and after a while, the server return again "HTTP error 404 Not Found" for some chunk
then ffmpeg exit with code 0.
This I cannot reproduce anytime as it depends on the streaming server to have a glitch of some sort

ffmpeg started on 2019-03-22 at 14:51:00
Report written to "/home/raz/radio-0.log"
Command line:
./ffmpeg -hide_banner -user_agent "VLC/3.0.6 LibVLC/3.0.6" -i http://.../livestream_ao/playlist.m3u8 -y -nostats -c copy -bsf:a aac_adtstoasc /home/raz/radio-0.aac
[hls,applehttp @ 0x6e0f6c0] Opening 'http://.../livestream_ao/chunklist_w222613001.m3u8' for reading
[hls,applehttp @ 0x6e0f6c0] Opening 'http://.../livestream_ao/media_w222613001_15345.aac' for reading
[hls,applehttp @ 0x6e0f6c0] Opening 'http://.../livestream_ao/media_w222613001_15346.aac' for reading
Input #0, hls,applehttp, from 'http://.../livestream_ao/playlist.m3u8':

Duration: N/A, start: 88660.092678, bitrate: 84 kb/s
Program 0

Metadata:

variant_bitrate : 132811

Stream #0:0: Audio: aac (LC), 44100 Hz, stereo, fltp, 84 kb/s
Metadata:

variant_bitrate : 132811
id3v2_priv.com.apple.streaming.transportStreamTimestamp: \x00\x00\x00\x01\xdb\x9c\x1b\xd5

Output #0, adts, to '/home/raz/radio-0.aac':

Metadata:

encoder : Lavf58.26.101
Stream #0:0: Audio: aac (LC), 44100 Hz, stereo, fltp, 84 kb/s
Metadata:

variant_bitrate : 132811
id3v2_priv.com.apple.streaming.transportStreamTimestamp: \x00\x00\x00\x01\xdb\x9c\x1b\xd5

Stream mapping:

Stream #0:0 -> #0:0 (copy)

Press [q] to stop, ? for help
[http @ 0x6e1b500] Opening 'http://.../livestream_ao/media_w222613001_15347.aac' for reading
[http @ 0x6e181c0] Opening 'http://.../livestream_ao/chunklist_w222613001.m3u8' for reading
[hls,applehttp @ 0x6e0f6c0] Opening 'http://.../livestream_ao/chunklist_w222613001.m3u8' for reading
[http @ 0x6e1b500] Opening 'http://.../livestream_ao/media_w222613001_15348.aac' for reading
[hls,applehttp @ 0x6e0f6c0] Opening 'http://.../livestream_ao/media_w222613001_15348.aac' for reading
[http @ 0x6e6e1c0] Opening 'http://.../livestream_ao/chunklist_w222613001.m3u8' for reading
[hls,applehttp @ 0x6e0f6c0] Opening 'http://.../livestream_ao/chunklist_w222613001.m3u8' for reading
[http @ 0x6e1b440] Opening 'http://.../livestream_ao/media_w222613001_15349.aac' for reading
[hls,applehttp @ 0x6e0f6c0] Opening 'http://.../livestream_ao/media_w222613001_15349.aac' for reading
[http @ 0x6e18140] Opening 'http://.../livestream_ao/chunklist_w222613001.m3u8' for reading
[hls,applehttp @ 0x6e0f6c0] Opening 'http://.../livestream_ao/chunklist_w222613001.m3u8' for reading
[http @ 0x6e5f8c0] Opening 'http://.../livestream_ao/media_w222613001_15350.aac' for reading
[hls,applehttp @ 0x6e0f6c0] Opening 'http://.../livestream_ao/media_w222613001_15350.aac' for reading
[http @ 0x6e18180] Opening 'http://.../livestream_ao/chunklist_w222613001.m3u8' for reading
[hls,applehttp @ 0x6e0f6c0] Opening 'http://.../livestream_ao/chunklist_w222613001.m3u8' for reading

  • after some time of running fine with output as above

the streaming server seems to have a glitch of some sort

[http @ 0x6e5f8c0] Opening 'http://.../livestream_ao/chunklist_w222613001.m3u8' for reading
[hls,applehttp @ 0x6e0f6c0] Opening 'http://.../livestream_ao/chunklist_w222613001.m3u8' for reading
[http @ 0x6e18100] Opening 'http://.../livestream_ao/media_w222613001_15571.aac' for reading
[hls,applehttp @ 0x6e0f6c0] Opening 'http://.../livestream_ao/media_w222613001_15571.aac' for reading
[http @ 0x6e6c0c0] Opening 'http://.../livestream_ao/chunklist_w222613001.m3u8' for reading
[hls,applehttp @ 0x6e0f6c0] Opening 'http://.../livestream_ao/chunklist_w222613001.m3u8' for reading
[http @ 0x6e70600] HTTP error 404 Not Found
[hls,applehttp @ 0x6e0f6c0] Failed to reload playlist 0
[hls,applehttp @ 0x6e0f6c0] Opening 'http://.../livestream_ao/chunklist_w222613001.m3u8' for reading
[http @ 0x6e19dc0] HTTP error 404 Not Found
[hls,applehttp @ 0x6e0f6c0] Failed to reload playlist 0
size= 36208kB time=00:37:49.95 bitrate= 130.7kbits/s speed= 1x
video:0kB audio:35539kB subtitle:0kB other streams:0kB global headers:0kB muxing overhead: 1.880420%


ffmpeg exit code=0

I think this is incorrect because ffmpeg ended with an error,
so it should return something other then 0.

Thanks

comment:5 by boris-petrov, 6 years ago

Cc: boris_petrov@live.com added
Note: See TracTickets for help on using tickets.