FFMPEG with Start Time

This is a follow up to a previous post about FFMPEG. In addition to sending a RTMP stream, you can also set a start time and duration.

Here’s how to set the start time using -ss option and -to for the duration. Video will start at 1 min 23 secs and play until 2 mins.

ffmpeg -ss 00:01:23 -i video.mp4 -to 00:02:00 -c copy -copyts cut.mp4

Here’s how to start time to start the video at 1 min 23 sec for RTMP streaming. Please note, the start time option needs to be before the input file.

ffmpeg -ss 00:01:23 \
-re -i $1 -acodec libmp3lame -ar 44100 -b:a 128k \
-pix_fmt yuv420p -profile:v baseline -s 1280x720 -bufsize 6000k \
-vb 1200k -maxrate 1500k -deinterlace -vcodec libx264           \
-preset veryfast -g 30 -r 30 -f flv                            \
-flvflags no_duration_filesize                                 \

GCP StackDriver Firewall Log

Here’s one way how to look at traffic hitting a GCP firewall. To view the traffic activity, go to Stackdriver Logging > Viewer. Enter the following search string. Just replace the network name and firewall name.

AND jsonPayload.rule_details.reference:("network:network-name/firewall:firewall-name")

GCP Increase Download Speed for gsutil

If you’re downloading large files, you can speed up download speeds by modifying gsutil. Decrease the number of threads and increase the number of components.

gsutil \
-o "GSUtil:parallel_thread_count=1" \
-o "GSUtil:parallel_process_count=8" \
cp gs://bucket/source.dat /download/dest/file.dat