[Libav-user] Fwd: resize video stream
sergbest0 at gmail.com
Mon Apr 5 15:23:08 EEST 2021
Sorry for not adding this right away
I am trying to replace this command
ffmpeg -re -i input.ts -map 0:0 -map 0:1 -vf scale=320:240 out.ts
due to the fact that the stream is written to input.ts and the usual ffmpeg
command all overtakes the end of the file and ends
that's why I want to make my own implementation of this command because I
know when the end of the input.ts file will actually come
пн, 5 квіт. 2021 о 11:13 Сергей Икол <sergbest0 at gmail.com> пише:
> Gonzalo GarramuñoThank you very much for your help.
> I think I'm completely confused ((
> I just want to read the incoming video file (it contains video and audio),
> then resize the video and save it in the same format (.ts).
> My plan:
> 1. Open the video and select the desired streams (line 123-126)
> 2. Prepare AVCodecContext (line 207-214)
> 3. Decode video frame
> 4. I change the size of the frame (sws_scale ())
> 5. I encode the frame (line 352)
> 6. I write the frame to a file (line 372)
> line 352 (avcodec_send_frame ()) constantly returns -22
> it seems to me that somewhere I am making a fundamental mistake ((
> сб, 3 квіт. 2021 о 16:29 Gonzalo Garramuño <ggarra13 at gmail.com> пише:
>> El 3/4/21 a las 06:21, Сергей Икол escribió:
>> I use this example
>> I want to change this example a little to resize the output video stream
>> Is it posible?
>> Can I use sws_scale() for this? Or do I need to use some other method for
>> I would be glad for any advice!)
>> Yes it is possible and yes you can use sws_scale for this. Just make
>> sure you are using the right pix_fmt and have the right linesizes in
>> addition to the new resolution and all should be fine.
>> Libav-user mailing list
>> Libav-user at ffmpeg.org
>> To unsubscribe, visit link above, or email
>> libav-user-request at ffmpeg.org with subject "unsubscribe".
-------------- next part --------------
An HTML attachment was scrubbed...
More information about the Libav-user