[FFmpeg-trac] #9752(undetermined:new): ffmpeg is affecting the parent shell's file stream
FFmpeg
trac at avcodec.org
Wed Apr 27 19:28:14 EEST 2022
#9752: ffmpeg is affecting the parent shell's file stream
-------------------------------------+-------------------------------------
Reporter: rgovostes | Type: defect
Status: new | Priority: normal
Component: | Version:
undetermined | unspecified
Keywords: | Blocked By:
Blocking: | Reproduced by developer: 0
Analyzed by developer: 0 |
-------------------------------------+-------------------------------------
I am invoking ffmpeg from within a bash loop like this:
{{{
while IFS="" read -r PLAYLIST; do
...
ffmpeg -f concat -i concat.txt -i chapters.txt -map_metadata 1 \
-c copy merged.mp4
....
done < <(head -n 3 playlists.txt)
}}}
Each iteration of this loop, it should read one line from `playlists.txt`
into the variable `PLAYLIST`. However, the lines are being unexpectedly
truncated. Each line should start `{"ie_key": "YoutubeTab"` but when the
truncation occurs the first 7 bytes are skipped and the loop reads `y":
"YoutubeTab"`.
This *only* happens when ffmpeg is invoked within the loop. I wasn't aware
a child process could affect the parent like this but maybe ffmpeg is
inheriting a file descriptor and inadvertently seeking it?
{{{
ffmpeg version 5.0.1 Copyright (c) 2000-2022 the FFmpeg developers
built with Apple clang version 13.1.6 (clang-1316.0.21.2)
}}}
--
Ticket URL: <https://trac.ffmpeg.org/ticket/9752>
FFmpeg <https://ffmpeg.org>
FFmpeg issue tracker
More information about the FFmpeg-trac
mailing list