link d_Qndfs '/video production/0_video notes.txt' www.BillHowell.ca 20Oct2016 initial # use OpenShot for simple snipping of audio & video https://fileinfo.com/extension/ogv What is an OGV file? An OGV file is a video file saved in the Xiph.Org open source Ogg container format. It contains video streams that may use one or more different codecs, such as Theora, Dirac, or Daala. OGV files can be played using a variety of media players. NOTE: Audio files that use the Ogg container are called Ogg Vorbis files, where "Vorbis" refers to the specific compression algorithm used for the audio data. The term "Vorbis" does not apply to Ogg video content. 48************************************************48 08********08 22Dec2020 +-----+ # https://stackoverflow.com/questions/18444194/cutting-the-videos-based-on-start-and-end-time-using-ffmpeg great descriptions for ffmpeg +--+ ffmpeg -i movie.mp4 -ss 00:00:03 -t 00:00:08 -async 1 -c copy cut.mp4 Use -c copy for make in instantly. In that case ffmpeg will not re-encode video, just will cut to according size. share improve this answer follow answered Oct 25 '16 at 15:42 Vlad Hudnitsky man ffmpeg : -async samples_per_second Audio sync method. "Stretches/squeezes" the audio stream to match the timestamps, the parameter is the maximum samples per second by which the audio is changed. -async 1 is a special case where only the start of the audio stream is corrected without any later correction. Note that the timestamps may be further modified by the muxer, after this. For example, in the case that the format option avoid_negative_ts is enabled. This option has been deprecated. Use the "aresample" audio filter instead. >> Howe- try it anyways +--+ new answer (fast) You can make bash do the math for you, and it works with milliseconds. toSeconds() { awk -F: 'NF==3 { print ($1 * 3600) + ($2 * 60) + $3 } NF==2 { print ($1 * 60) + $2 } NF==1 { print 0 + $1 }' <<< $1 } StartSeconds=$(toSeconds "45.5") EndSeconds=$(toSeconds "1:00.5") Duration=$(bc <<< "(${EndSeconds} + 0.01) - ${StartSeconds}" | awk '{ printf "%.4f", $0 }') ffmpeg -ss $StartSeconds -i input.mpg -t $Duration output.mpg This, like the old answer, will produce a 15 second clip. This method is ideal even when clipping from deep within a large file because seeking isn't disabled, unlike the old answer. And yes, I've verified it's frame perfect. NOTE: The start-time is INCLUSIVE and the end-time is normally EXCLUSIVE, hence the +0.01, to make it inclusive. If you use mpv you can enable millisecond timecodes in the OSD with --osd-fractions edited Sep 22 at 2:04 answered Oct 21 '18 at 14:45 y o >> Howell, based on comments in : https://stackoverflow.com/questions/18444194/cutting-the-videos-based-on-start-and-end-time-using-ffmpeg great descriptions for ffmpeg https://askubuntu.com/questions/44443/command-line-audio-players see also link "$d_Qndfs""audio notes.txt" >> maybe? : $ ffmpeg -i input.mpg -ss $StartSeconds -to $EndSeconds | ffplay +-----+ https://forum.videolan.org/viewtopic.php?t=124021 How to control window properties on VLC by command-line? Re: How to control window properties on VLC by command-line? Postby dewang2k3 » 05 Feb 2015 00:12 vlc.exe --no-embedded-video --video-x=100 --video-y=100 --width=400 --height=400 Movie1080p_1.mp4 +--+ Re: How to control window properties on VLC by command-line? Postby RePlay.be » 03 Apr 2015 00:57 For anyone else trying to get this to work: the width and height parameters appear to broken currently. See this bug report: https://trac.videolan.org/vlc/ticket/9931. Hopefully this will be fixed when VLC 3.0.0 is released. If you need this feature, you can download version 2.0.8, which was the last version where it still worked: http://download.videolan.org/pub/videolan/vlc/2.0.8/. I needed this feature only for Livestreamer so I downloaded the portable version so I can still keep the latest version installed. 08********08 20Dec2020 All video [capture, convert, produce] programs have been moved to link d_Qndfs 'video production' [merge, convert] [vidcam, Sony digicorder] - I will need this frequently for screen captures I've had programs for a long time, but I'm NOT happy with quality of output. $ diff "$d_Qndfs""video production/video conversion/0_vidConv - common data, operators 161219.ndf" "$d_Qndfs""video production/video conversion/0_vidConv - common data, operators.ndf" 1c1 < # /media/bill/VIDEO_PRODN/video production/0_vidConv - common data, operators.ndf --- > # /media/bill/HOWELL_BASE/Video production/video production/0_vidConv - common data, operators.ndf >> Essentially the same - move older to z_Archive $ diff "$d_Qndfs""video production/video production/0_vidProdn - common data, operators 170819.ndf" "$d_Qndfs""video production/video production/0_vidProdn - common data, operators.ndf" >> totally different files!!! leave it for now As per 'setup.ndf' : to add loaddef comments as each [expression (IS), operator(IS OP)] is loaded : see 'link d_Qnial_root 'setup.ndf' qnial> add_ISOP_debug (link d_Qndfs 'filename') the operator must be preceded by a comment line of standard format the comment in turn provides lightning fast Unix cmd extraction of comments (eg lists of operators) qnial> add_ISOP_debug (link d_Qndfs 'video production/video conversion/0_vidConv - common data, operators.ndf') >> works very nicely +-----+ https://stackoverflow.com/questions/28219049/combining-an-audio-file-with-video-file-in-python +--+ I got the answer of my Question, you can also try it and let me know if need further assistance cmd = 'ffmpeg -y -i Audio.wav -r 30 -i Video.h264 -filter:a aresample=async=1 -c:a flac -c:v copy av.mkv' subprocess.call(cmd, shell=True) print('Muxing Done') answered Feb 3 '15 at 15:20 Fahadkalis +--+ The best tool for manipulating audio and video stream is ffmpeg/libav. Do you have to use Python? You could use command-line binaries from these projects. For example, taken from https://wiki.libav.org/Snippets/avconv: avconv -v debug -i audio.wav -i video.mp4 -c:a libmp3lame -qscale 20 -shortest output.mov (Of course you'll want to tweak the parameters for your files, and qscale for the quality you want.) You can call this from within python using the subprocess module. If you have to do it in python directly, you could use PyAV (https://pypi.python.org/pypi/av/0.1.0), but this would involve more effort. answered Jan 29 '15 at 16:33 rod https://www.theora.org/faq/ Q. What is Ogg? What is Vorbis? What is Xiph.org? Vorbis is an audio codec, Theora is a video codec. Ogg is the transport layer that both are stored in, so a video file will be Theora-encoded data inside an Ogg file, while audio is normally Vorbis-encoded data inside an ogg file. The Xiph.org Foundation is a Delaware non-profit company devoted to producing, maintaining and supporting an open multimedia platform. https://streamshark.io/blog/understanding-codecs-and-formats/ Audio and Video Codecs A Codec is technology used to compress the data. Common video codecs (also called video format) include MPEG-4/H.264 and WebM(VP8). Common Audio codecs are AAC and MP3. Different players accept different types of codecs. For example, YouTube live player accepts only H.264 video codec. The figure below depicts the creation of an encoded video file from original video and sound files. One of the biggest sources of confusion about video is not realising that the file format (aka container format) is completely different from the video format (the video codec). Examples of file formats i.e. container formats are .mp4, .flv, .ogv, .mov and .avi. Flash (.flv) is a container format that utilizes H.264 for Video and AAC for Audio. The flash container could also hold video encoded with vp6 instead of H.264. More examples of containers are shown in the picture below. Is mp3 supported by avconv?? or is the problem the Lavf57.71.100 (isn't this mp3?)? Input #1, mp3, from '/media/bill/Linux_iso/rawVids/201216 black beauty anal cropped.mp3': Metadata: title : 201216_2155 artist : My Recording encoded_by : SONY IC RECORDER 7.4.0 encoder : Lavf57.71.100 Duration: 00:13:12.03, start: 0.025057, bitrate: 128 kb/s Stream #1:0: Audio: mp3, 44100 Hz, stereo, s16p, 128 kb/s Metadata: encoder : Lavc57.89 [ogv @ 0x559db363a240] Unsupported codec id in stream 1 Could not write header for output file #0 (incorrect codec parameters ?): Invalid argument 08********08 20Oct2016 All video Production programs ave been moved to /edia/bill/VIDEO_PRODN This allows me to run projects on a second computer 08********08 20Dec2020 man avconv Video Options -c[:stream_specifier] codec (input/output,per-stream) -codec[:stream_specifier] codec (input/output,per-stream) Select an encoder (when used before an output file) or a decoder (when used before an input file) for one or more streams. codec is the name of a decoder/encoder or a special value "copy" (output only) to indicate that the stream is not to be re-encoded. For example ffmpeg -i INPUT -map 0 -c:v libx264 -c:a copy OUTPUT encodes all video streams with libx264 and copies all audio streams. For each stream, the last matching "c" option is applied, so ffmpeg -i INPUT -map 0 -c copy -c:v:1 libx264 -c:a:137 libvorbis OUTPUT will copy all the streams except the second video, which will be encoded with libx264, and the 138th audio, which will be encoded with libvorbis. -f fmt (input/output) Force input or output file format. The format is normally auto detected for input files and guessed from the file extension for output files, so this option is not needed in most cases. -r[:stream_specifier] fps (input/output,per-stream) Set frame rate (Hz value, fraction or abbreviation). As an input option, ignore any timestamps stored in the file and instead generate timestamps assuming constant frame rate fps. This is not the same as the -framerate option used for some input formats like image2 or v4l2 (it used to be the same in older versions of FFmpeg). If in doubt use -framerate instead of the input option -r. As an output option, duplicate or drop input frames to achieve constant output frame rate fps. -t duration (input/output) When used as an input option (before "-i"), limit the duration of data read from the input file. When used as an output option (before an output url), stop writing the output after its duration reaches duration. duration must be a time duration specification, see the Time duration section in the ffmpeg-utils(1) manual. -to and -t are mutually exclusive and -t has priority. -vcodec codec (output) Set the video codec. This is an alias for "-codec:v". Audio Options -aframes number (output) Set the number of audio frames to output. This is an obsolete alias for "-frames:a", which you should use instead. -ar[:stream_specifier] freq (input/output,per-stream) Set the audio sampling frequency. For output streams it is set by default to the frequency of the corresponding input stream. For input streams this option only makes sense for audio grabbing devices and raw demuxers and is mapped to the corresponding demuxer options. -aq q (output) Set the audio quality (codec-specific, VBR). This is an alias for -q:a. -ac[:stream_specifier] channels (input/output,per-stream) Set the number of audio channels. For output streams it is set by default to the number of input audio channels. For input streams this option only makes sense for audio grabbing devices and raw demuxers and is mapped to the corresponding demuxer options. -an (output) Disable audio recording. -acodec codec (input/output) Set the audio codec. This is an alias for "-codec:a". enddoc