Can't use YouTube-dl to download specified bitrate [closed] - youtube-dl

Closed. This question does not meet Stack Overflow guidelines. It is not currently accepting answers.
This question does not appear to be about a specific programming problem, a software algorithm, or software tools primarily used by programmers. If you believe the question would be on-topic on another Stack Exchange site, you can leave a comment to explain where the question may be able to be answered.
Closed 6 years ago.
Improve this question
After needing something both easy and powerful that would allow me to download YouTube playlists and finding no better alternative, I've recently started using youtube-dl (with ffmpeg) in the command line. I'm currently in the process of playing around with and testing the quality of my downloaded playlists, but I've run into a problem converting a playlist to M4A audio at 192kbps. Here is what I'm using:
youtube-dl --extract-audio --audio-format m4a --audio-quality 192 --playlist-items 1-26 https://www.youtube.com/playlist?list=PLR3nWwHlZ9WBpi3uWsjSe6r1PiA8MTbnE
The --audio-quality 192 doesn't seem to be registering, even though the syntax seems right as far as I can tell, and when the audio files are downloaded and extracted, they consist of a whole range of different bitrates, from 189 to 254. Can anyone tell me why I might be having this problem?

According to the youtube-dl helpfile, for bitrate, you need to specify the K after 192. Otherwise it treats it as variable bit rate:
-audio-quality QUALITY Specify ffmpeg/avconv audio quality,
insert
a value between 0 (better) and 9 (worse)
for VBR or a specific bitrate like 128K
(default 5)
See: Post Processing Options in helpfile
UPDATE BASED ON COMMENT: There are open issues suggesting that ffmpeg does not report all the errors it faces when processing, particularly the mp4 (m4a) codec. See Issue 8230. An alternative format may be a workaround. Another workaround may be changing the system's mp4 codecs such that ffmpeg is happier with them.
If neither of these workarounds work for you, please post the output of running the command with the --verbose option so that we can see the debug info.
UPDATED SINCE DOESN'T AFFECT MP3s:
Since ffmpeg is known to have some mp4 codec issues, another thing you can try is use avconv and avprobe instead of ffmpeg and ffprobe as post-processors for youtube-dl. You can download the latest Windows binaries here: LibAV Windows binaries. Don't forget to add the executables to your PATH system environment variable so that youtube-dl can find them.
Then add the --prefer-avconv option in your youtube-dl command and see if it behaves better.
EDIT WITH KNOWN-BUG DETAILS:
It seems you may have tripped over a previously-missed version of this bug M4a Audio file post-processing skipped - While the developer has addressed the slightly different case in the bug description, it seems to occur in your case as well. It may be worth posting the details to the youtube-dl Github Issue Tracker.
Switching to a different format (like mp3) may be the only workaround at this point.

Related

Is there any command in specific to record a part of a livestream that still is in transmission?

The livestream doesn't end (for now, and if ended, I think will be erased of YouTube, that's my reason to download), actually, the video is still in transmission, you know, like the streams of the NASA or streams of channels news. The detail is that the transmission lasts about 10-11 hours, and the transmission has lasted about 3 days. So it was a matter of time before the first concerts were no longer available to watch on the broadcast.
This is the video: https://www.youtube.com/watch?v=rE6QI0ywr0c
I want to download some concerts, but the things that I wanted, are disappearing with the passing of time. Right now, I'm only interested in the Disclosure concert. His concert starts at approximately -3:38:12. I mention it in case someone wants to help me.
I was trying this command, but only appear a text that i don't understand (I'll post it in the comments, all the images with his info). The command is this → yt-dlp.exe -f (bestvideo+bestaudio/best) "link" --postprocessor-args "ffmpeg:-ss 00:00:00 -to 00:00:00" -o "%(title)s_method1.%(ext)s"
The idea of that command emerged on this ideas
https://www.reddit.com/r/youtubedl/wiki/howdoidownloadpartsofavideo/
https://github.com/yt-dlp/yt-dlp/issues/686
Also, I was trying to do this How do you use youtube-dl to download live streams (that are live)?, but I can't get the HLS m3u8 URL in Chrome and Chrome Dev (yes, I go to F12 (Chrome Developer Tools) - Network and I write m3u8, I didn't find anything.
I should mention that I don't have extensive knowledge on codes and yt-dlp. I only learned the necessary to download videos, you know, yt-dlp.exe -F (link) and then yt-dlp.exe -f (numbers of resolution and audio) (link).
So if you recommend any programs or commands, please let me know as precisely as possible.
Any new info I'm gonna update in the comments.
PS: sorry for my english

How can I analyze file and detect if the file is in H.264 video format? [closed]

Closed. This question needs to be more focused. It is not currently accepting answers.
Want to improve this question? Update the question so it focuses on one problem only by editing this post.
Closed 6 years ago.
Improve this question
I write software C/C++ to recover deleted files, and I need to identify files according to their binary content, so my question is there a simple way to know if a particular file is H.264 format video? is H.264 has an signature?
I saw the code of FFMPEG here, but can it help me, how?
For those who encounter this question but are looking for a cli solution you can use ffprobe:
ffprobe -loglevel error -select_streams v -show_entries stream=codec_name -of default=nw=1:nk=1 input.mkv
Outputs:
h264
The problem is that H.264 is not a file format, it is a video compression standard, and as such it can be found in multiple file formats. You can have a .f4v encoded with H.264 as much as you can have .mp4 with H.264.
So, how do you solve your issue? Well, I strongly advise you to use a library that does that for you. libavformat, for example, should do the trick (check the AVStream and AVFormatContext structures, and the avformat_open_input function).
Now, if you absolutely want to do it without libraries, you can check out the documentation for each video container format that supports H.264 to see how to retrieve the encoding information of the video stream, but expect this to take you at least a month or two.
If you want to use FFmpeg - avformat_find_stream_info() should help you. An there is an example.

C++: Writing images to video file independent of installed codecs

I'm trying to save a series of images (16 bit grayscale pgm) as video. The video has to be compressed. My program has to be independent of the codecs installed in the system.
My initial idea was to use OpenCV for this, unfortunately it depends on codecs installed in the system (unless I'm missing something).
I feel like there should be a way to compile an encoder (H264 or similar would be perfect) into the program or redistribute it as a dll with my program. I just can't find any good up to date guidance/examples.
I've been swimming in the deep vast ocean of AV encoding for a couple of days and would really appreciate it if someone could point me to a right direction.
Thanks.
As Ben suggests, it would be a good idea to use an established library in your code.
FFMPEG is probably the most used at the moment - it can be used on the command line, with a 'wrapper' program or the libraries it is built with can be used directly.
I think the last case sounds like the one you want - you can find documentation here:
https://trac.ffmpeg.org/wiki/Using%20libav*
Note the comment about disambiguation at the start - this is important to understand as the project lib and the library (which is what you want) are different things.
and there is some notes in this answer on how to build it into a program:
FFMpeg sample program

how to rapidly extract intraframe from a video (in c++ or python)

i want to capture some frame from a video so i used command like this:
ffmpeg -i MyVideo.mp4 -ss 1:20:12 -vframes 1 test-pic.jpg
but ffmpeg proccess frame from begin of video so this command is too slow. i research and i found some article about keyframe so i try to extract keyframe by a command like this
ffmpeg -vf select="eq(pict_type\,PICT_TYPE_I)" -i MyVideo.mp4 -vsync 2 -s 160x90 -f image2 thumbnails-%02d.jpeg
but this command also is to slow and capture too many frame.
I need a linux command or c++ or python code to capture a frame that dont take long time
The ffmpeg wiki states regarding fast seeking:
The -ss parameter needs to be specified before -i:
ffmpeg -ss 00:03:00 -i Underworld.Awakening.avi -frames:v 1 out1.jpg
This example will produce one image frame (out1.jpg) somewhere around
the third minute from the beginning of the movie. The input will be
parsed using keyframes, which is very fast. The drawback is that it
will also finish the seeking at some keyframe, not necessarily located
at specified time (00:03:00), so the seeking will not be as accurate
as expected.
You could also use hybrid mode, combining fast seeking and slow (decode) seeking, which is kind of the middle ground.
If you want to implement this in C/C++, see the docs/examples directory of ffmpeg to get started and av_seek_frame.
I recently hacked together some C code to do thumbnails myself, which uses the hybrid mode effectively. May be helpful to you, or not.
Hello, Mr. Anderson.
I'm not familiar with using C++ or Python to do such a thing. I'm sure it's possible (I could probably get a good idea of how to do this if I researched for an hour), but the time it would take to implement a full solution may outweigh the time cost of finding a better frame capturing program. After a bit of Googling, I came up with:
VirtualDub
Camtasia
Frame-shots

c++ creating 1 video from multiple video files [closed]

Closed. This question does not meet Stack Overflow guidelines. It is not currently accepting answers.
Questions asking us to recommend or find a tool, library or favorite off-site resource are off-topic for Stack Overflow as they tend to attract opinionated answers and spam. Instead, describe the problem and what has been done so far to solve it.
Closed 8 years ago.
Improve this question
I need to write a program that is a television like.
I will need to create 1 video form
e.g. 4 video files (lets say first video should be in top-left corner, second in top-right corner of the stream, etc.).
Also I'll need to add some scrolling text to the video and so on and so on...
So, the question is,
if there are any libs that could help me with that?
Thank you.
You question missed many details. Do you write cross-platform program? Or should it work on Windows or *nix only? Also do you have unlimited budget for possible libraries? Or are you looking for open source libraries? So...
From common sense you could use FFMPEG library which is crossplatform. If you can use Windows platform than you could use Avisynth, it provides really powerful scripting mechanism that allows you to combine multiple videos into one and you could add your own filters that add watermark or other kind of effects
Not sure about libraries, and you also haven't mentioned the format of the video input files (I'll presume they are in a compressed format like H.264 since if they are raw that is just a subset), but I would need to do shis on Windows, I'd do the following:
1) Read and decoded the frames from the input files (either with FFMPEG or VFW) an then put the encoded data in a larger bitmap with the resulting size of the 4 screens
2) Since now it is a raw bitmap apply the text or whatever is needed using e.g. DrawText(http://msdn.microsoft.com/en-us/library/windows/desktop/dd162498(v=vs.85).aspx), to ease the use of WinAPI you could use some GDI wrapper library.
I guess one of the main pitfalls here is to properly synchronize the presentation times of the frames from different files, since they can all have different fps and time breaks so you can't just read frame by frame but you need to keep track which frame from which file is supposed to be presented at each step when applying the transformations you need.