-
Notifications
You must be signed in to change notification settings - Fork 250
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Trying to pass rtc media packet to ffmpeg #53
Comments
In your code, ffmpeg \
-vsync cfr \
-f rawvideo \ # (I'm not very sure ffmpeg can read raw VP8 stream as rawvideo *1)
-c:v rawvideo \ # it specifies input codec as raw, but actually VP8 stream is given
-fflags nobuffer
-s 320x180 \
-pix_fmt yuv420p \
-i unix:./video.sock \
-f s16le \ # it specifies input format as raw signed 16^bit little-endian, but actually OPUS stream is given
-ar 48k \
-ac 1 \
-fflags nobuffer \
-i unix:./audio.sock \
-flags +global_header -acodec libfdk_aac -vsync 1 -vcodec libx264 -r 25 -b:v 4000k -pix_fmt yuv420p \
-preset slow -qp 0 vid.mp4 VP8 RTP descriptor https://tools.ietf.org/html/rfc7741#section-4.1 *1: In general, raw stream of encoded video is difficult to be handled since it usually doesn't have information of frame boundary. Using RTP is easier. |
Thanks for the info, i will follow the process |
@generalomosco sorry, payload descriptor is already parsed by |
Hey @generalomosco it would be really amazing if you were able to share this with others! If you are able to open a PR to this repo me and @at-wat would be able to help also :) no rush though. The PR doesn't have to be perfect. I can refactor the code to make it pass our tests, as long as you can get something basic working. Thanks for using Pion, I love seeing cool stuff like this. |
Thanks i will by tomorrow |
I've be trying to pass rtc media packet to ffmpeg, so i decide using unix socket but seems the frame is not valid!
I'm passing the frame bytes
s.vCallback(s.width,s.height,videoKeyframe, int64(t), sample.Data);
via unix socket then use ffmpeg to convert it to mp4 by connecting to the socket but unfortunately the mp4 is always corrupted without displaying anything.The command line
ffmpeg -vsync cfr -f rawvideo -c:v rawvideo -fflags nobuffer -s 320x180 -pix_fmt yuv420p -i unix:./video.sock -f s16le -ar 48k -ac 1 -fflags nobuffer -i unix:./audio.sock -flags +global_header -acodec libfdk_aac -vsync 1 -vcodec libx264 -r 25 -b:v 4000k -pix_fmt yuv420p -preset slow -qp 0 vid.mp4
Here is the code below which i strap scope from save-to-webm
The text was updated successfully, but these errors were encountered: