[FFmpeg-user] Parse environment variables in command line
Denis Mysenko
duster at mail.ru
Mon Apr 20 03:02:52 CEST 2015
Hi there
This is not really related to FFmpeg, and I'm afraid there is no quick solution.
If you use environment variable (like you proposed) or any shell/UNIX 'hack' (eg. -i `cat url.txt`), at the moment of execution a plain-text password will be inserted anyway. And 'ps' will show what really was launched, not the string before parsing.
So the question becomes – can you pass incomplete information to FFmpeg at the execution time, and then make it fetch extra information itself? I don't think it's possible.
Воскресенье, 19 апреля 2015, 8:03 +05:00 от Ilya Melnikov <rayanayar at mail.ru>:
>Hello.
>
>ffmpeg records video stream from IP-cam.
>IP-cam has authentiation.
>
>ffmpeg \
> -t $DT_SECONDS_TO_RECORD \
> -i rtsp://$SRC_USER:$SRC_PASS@$SRC_ADDR/stream1.sdp \
> -vcodec copy \
> -acodec copy \
> $DST_FILE
>
>ffmpeg starts from cron script by unpriviledged user.
>At the same host can be logged interactive users.
>
>The problem is: interactive users can see ffmpeg command line "by ps", thus users can see IP-cam password.
>
>$ ps -f -C ffmpeg
>UID PID PPID C STIME TTY TIME CMD
>backup 1506 1423 88 07:47 pts/11 00:00:08 ffmpeg -t 3600 -i rtsp://admin:password@192.168.0.100/stream1.sdp -vcodec copy -acodec copy out.mkv
>
>The question is: can ffmpeg parse environment variables themselves?
>For example:
>
>ffmpeg \
> -t $DT_SECONDS_TO_RECORD \
> -i rtsp://$SRC_USER:'$SRC_PASS'@$SRC_ADDR/stream1.sdp \
> -vcodec copy \
> -acodec copy \
> $DST_FILE
>
>$ ps -f -C ffmpeg
>UID PID PPID C STIME TTY TIME CMD
>backup 1506 1423 88 07:47 pts/11 00:00:08 ffmpeg -t 3600 -i rtsp://admin:$SRC_PASS@192.168.0.100/stream1.sdp -vcodec copy -acodec copy out.mkv
>
>
>
>--
>Ilya Melnikov
>Sunday 19 April 2015 07:35:46
>_______________________________________________
>ffmpeg-user mailing list
>ffmpeg-user at ffmpeg.org
>http://ffmpeg.org/mailman/listinfo/ffmpeg-user
Sincerely,
--
Denis Mysenko, CCNA, MCP, MCSA
Skype: denismysenko, ICQ: 555955
Forskarbacken 9 / 209
10405 Stockholm, Sweden
Mobile: +46 (0) 70 405 49 04
More information about the ffmpeg-user
mailing list